Insert Credit Art Jam 2.0 | February 2023 | Machines

[size=100]WELCOME BACK TO THE INSERT CREDIT ART JAM 2.0!!![/size]
-

[size=30][color=Mediumpurple]_SHORTEST MONTH AND EVEN MORE LATE THAN USUAL_[/color][/size] -

[size=1]i'm sorry[/size]

_**To those new to the concept:**_
A monthly event in where the ever-growing Insert Credit community can come together and create art based on a rotating topic! First created and hosted by @"SuperEffective"#337, now taken over by me. Everyone is welcome to participate and create whatever they consider art. Every possible medium and art discipline is welcomed here. Go wild! Show us your hidden or not so hidden talents!

Here’s the original premise @"SuperEffective"#337 wrote:

>

This is not necessarily a contest, but more like a weekly monthly art challenge/show-and-tell. The plan is to introduce a new prompt every Sunday the first day of each month to make a piece of art to. To participate, you can simply post anything from a drawing, sculpture, crochet, animation, writing, a sick beat, heck, why not even a cake! You can post whenever you’re finished, and I’m sure none will mind if you’re a bit late as this thread is all in good fun. Heck, if you’re loving the prompt, post more than one! Send any suggestions you think would be fun to do in the next week, if you have any fun ideas!

**_HERE'S TONIGHT'S (TO-MONTH'S???) PROMPT:_**

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

[size=1000][color=hotpink] **Machines**[/color][/size]

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

[If you have any prompt ideas, feel free to submit them to this form.](https://docs.google.com/forms/d/1fnVw7d9LFrwqsvNTVa9lt9X20KPYNmJCa-LcJFe_a-Q/viewform?edit_requested=true)

Once again, shout out to @"antillese"#59 for letting me know that February had already started without me noticing

You can read a more detailed introduction of the Art Jams 2.0 and see the amazing stuff y’all came up based on the previous prompt on the thread(s) linked below:

_**[March 2022 | Support and Cooperation](https://forums.insertcredit.com/d/1421-insert-credit-art-jam-20-april-2022-delicious)**_ -

_**[April 2022 | Delicious](https://forums.insertcredit.com/d/1367-insert-credit-art-jam-20-march-2022-support-and-cooperation)**_ -

_**[May 2022 | Zones ](https://forums.insertcredit.com/d/1477-insert-credit-art-jam-20-may-2022-zones)**_ -

_**[June 2022 | Slow ](https://forums.insertcredit.com/d/1477-insert-credit-art-jam-20-may-2022-zones)**_ -

_**[August 2022 | purple (part II) ](https://forums.insertcredit.com/d/1694-insert-credit-art-jam-20-august-2022-purple-part-ii)**_ -

_**[September 2022 | LOUD!!!!!! ](https://forums.insertcredit.com/d/1846-insert-credit-art-jam-20-september-2022)**_ -

_**[October 2022 | Mysteerie ](https://forums.insertcredit.com/d/1993-insert-credit-art-jam-20-october-2022-mysteerie)**_ -

_**[November 2022 | Windy ](https://forums.insertcredit.com/d/2094-insert-credit-art-jam-20-november-2022)**_ -

_**[December 2022 | BIG ](https://forums.insertcredit.com/d/2242-insert-credit-art-jam-20-december-2022-big)**_ -

_**[January 2023 | Magic ](https://forums.insertcredit.com/d/2300-insert-credit-art-jam-20-january-2023-magic)**_ -

I have the absolute worst idea for this one.

Nice! This may be the first time I participate.

Of loving grace!?

https://youtu.be/bpmukoeoqpU

I never heard a single other song by this band after the crow soundtrack

@“exodus”#p104033 I picked up their “Concentration” album at a thrift shop last year and its very 90's Industrial, which I liked.

[upl-image-preview url=https://i.imgur.com/u4piejL.png]


I‘m bad for not paying attention to or posting in these threads practically at all, probably because I’m scared of drawing

https://youtu.be/NryLbB_c4-Y

here's my submission. gotta be one of my favorite machines.

@“treefroggy”#p105589 1. me too, I am also scared 2. all two or three of your drawings I‘ve seen now I’ve loved so I hope you will consider sharing more of them.

>

@“TracyDMcGrath”#p103126 I have the absolute worst idea for this one.

Turn your headphones down, or, maybe even off for this one:

https://tracymcgrath.bandcamp.com/track/machines

So what was that terrible idea? I figured the only place to go from making tracker mods natively on an Amiga last month would be to code the next song in machine language, get it? Machine....language, anyway....

No one can write in machine language though, so I did the next best thing, and wrote some 6502 assembly targeting the NES.

As @"antillese"#59 has explained in the context of much better NES songs, the NES has 5 audio channels. 2 pulse channels, a triangle channel, a noise channel, and a sample playback channel. The channels each have 4 bytes of memory mapped to the APU, which actually lives on the NES's modified 6502 CPU, but it gives us discrete bits of things that we can control and it handles most of the hard stuff for us without having to code anything. Most NES games have songs written in some external tool like a tracker, and then a subroutine in the program rom loads in those songs into the APU on a per frame basis from rom, no direct fiddling with the APU required. But I ask you, where's the fun in that?

We're going to write a simple program to load in randomly generated garbage into the APU channels, and then we're going to turn the channels on and off by increasing the APU flag counter at $4015 and then resetting it in a 16 beat cycle. This will create "music" in so far as it will be pitched notes in a repeated order, as music was defined by the [Criminal Justice and Public Order Act 1994](https://en.wikipedia.org/wiki/Anti_EP). Ready? Let's jam!

First we're going to set up the iNES header. We don't need anything fancy so we're setting it to the NROM mapper (or lack thereof) that SMB 1 uses.

``` 6502 .segment "HEADER" .byte "NES" .byte $1a .byte 02 ; progrom .byte 01 ; charrom .byte 00 ; nrom mapper .byte 00, 00, 00, 00 .byte 00, 00, 00, 00, 00 ```

Then we're going to declare some variables in the zeropage, the first 256 bytes of memory that's fastest to access

``` 6502 .segment "ZEROPAGE"

frame: .res 1
beat: .res 1
seed: .res 2 ; for randomness
```

Then we're going to set up our program rom, most of this is boiler plate like setting up memory and waiting for the crt that we're hypothetically plugged into to cycle twice so we know we're ready to rock

``` 6502

.segment “STARTUP”

reset:

;boiler
sei
cld

ldx #%10000000
stx $4017
ldx #$00
stx $4010

ldx #$00
txs

ldx #$00
stx $2000
stx $2001

:
bit $2002
bpl :-

txa

clearmem:
sta $0000, x
sta $0100, x
sta $0300, x
sta $0400, x
sta $0500, x
sta $0600, x
sta $0700, x
lda #$ff
sta $0200, x
lda #$00
inx
cpx #$00
bne clearmem

:
bit $2002
bpl :-

lda #$02
sta $4014
nop

cli

lda #%10010000
sta $2000 ; nmi on vblank

lda #%00011110
sta $2001 ; turn on graphics<i>

```

Now we're going to initialize our counters and our random seed and get ready for our main loop

``` 6502
; initialize counters
lda #$00
sta frame
sta beat

; initialize the seed to non zero or else it will always be 0
lda #$01
sta seed+0
sta seed+1

; turn pulse on to start
lda #$01
sta $4015

    ; loop forever and wait for interupts 
forever:
	jmp forever<i>

```

Now in our main loop we're going to fill our APU with garbage and increase the channel on off flags in $4015 to 00010000 and then loop back to 00000001 for, uh "music". The bits in the byte at $4015 turns on things as follows : nothing nothing nothing sample noise triangle pulse2 pulse1

``` 6502
nmi:
jsr prng ; set the a register to a random value to store in everything

sta $4000
sta $4001
sta $4002
sta $4003
sta $4004
sta $4005
sta $4006
sta $4007
sta $4008
sta $4009
sta $400a
sta $400b
sta $400c
sta $400d
sta $400e
sta $400f
sta $4010
sta $4011
sta $4012
sta $4013

lda frame
cmp #$1d
bne incframe
lda #$ff ; if we're at 30 prepare to roll over
sta frame
; if we're at 30 increment the beat counter
inc $4015 ; change what's playing every beat
lda beat
cmp #$10
bne incbeat
lda #$ff ; if we're at 16 prepare to roll over
sta beat
   ; if we're at 16 reset the seed
lda #$01
sta seed+0
sta seed+1
sta $4015

incbeat:
inc beat
incframe:
inc frame
rti

prng:
ldy #8
lda seed+0

:
asl
rol seed+1
bcc :+
eor #$39
:
dey
bne :–
sta seed+0
cmp #0
rts

```

Finally set up where the interrupts are and then where our non existent character rom lives:

``` 6502
.segment “VECTORS”
.word nmi
.word reset
.segment “CHARS”

```

Voila we have.....something that sounds awful. But hey! It's audible!

If you want to fiddle around with NES programming, I learned how to do most of this from the truly exhaustive NES dev wiki here: https://www.nesdev.org/wiki/Nesdev_Wiki

@“TracyDMcGrath”#p106113 This rules and is very cool. Thanks as always for sharing! And thanks for teaching me about the Anti EP!

My entry is going to be a few days “late” as if that means anything. Next weekend at the worst so I won’t eat into my time for March.

@TracyDMcGrath is this repeatable/deterministic? I know you’ve got an MP3 recording there, but is the pseudorandom generation stable in that application given the same seed? I doubt it would be on a modern processor, but that A203 isn’t exactly famous for being secure in its RNG!

@“antillese”#p106134 good question and I‘m not sure! I’m using an rng subroutine from the wiki, and while I am resetting the seed to the same thing and the zeropage is relatively stable, I don't understand the rng gen subroutune well enough to know for certain if it will always return the same result for the same seed.

@“TracyDMcGrath”#p106113 This is really neat! It fits with how I was thinking about the prompt this month too, insofar as creating a system that outputs pseudorandom stuff within a range. I need to scan in my drawings, and they‘re honestly not much, but I’d still like to share what I've been scratching at this month.

@treefroggy @connrrr No one is bad at drawing. All you need to be good at drawing is the will to draw.

@“tomjonjon”#p106392 Nah, it‘s not that, I used to draw a lot, got more of a complex surrounding drawing for social media, now I only doodle for pragmatism or when it’s for myself. You could say I‘m all drawled out. That’s why I am posting 10 year old scribbles haha

@“tomjonjon”#p106392 I have tons of baggage from being doted on about it as a kid and also perfectionist tendencies and I'm still working through it lol

@“connrrr”#p106397 Its a tough hurdle to get over, I know, but perfection has no place in art. The imperfections are the style.

@“antillese”#p106117 @TracyDMcGrath That EP is some of my favorite Autechre.

i tried to upload some pics but it ain't working!

@“DavidNoo”#p106501 I am also having this problem. I got a temporary workaround though it might drop the img quality.

edit: I'm not gonna make an account for a new uploader right now. This one is called [_Heartless Machine God_](https://prnt.sc/oSo1jOoLMXWP)