Insert Credit Art Jam 2.0 | February 2023 | Machines

WELCOME BACK TO THE INSERT CREDIT ART JAM 2.0!!!

SHORTEST MONTH AND EVEN MORE LATE THAN USUAL

i'm sorry

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, 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 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:

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

Machines

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

If you have any prompt ideas, feel free to submit them to this form.

Once again, shout out to @antillese 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
-

April 2022 | Delicious
-

May 2022 | Zones
-

June 2022 | Slow
-

August 2022 | purple (part II)
-

September 2022 | LOUD!!!
-

October 2022 | Mysteerie
-

November 2022 | Windy
-

December 2022 | BIG
-

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 I picked up their “Concentration” album at a thrift shop last year and its very 90's Industrial, which I liked.

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

  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.

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

machines | Tracy McGrath

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 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.

    .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<i>

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

.segment "ZEROPAGE"
frame: .res 1
beat: .res 1
seed:	.res 2 ; for randomness<i>

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

.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

	; 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

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<i>

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

.segment "VECTORS"
	.word nmi
	.word reset
.segment "CHARS"<i>

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: NESdev Wiki

@TracyDMcGrath 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 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 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 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 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 Its a tough hurdle to get over, I know, but perfection has no place in art. The imperfections are the style.

@antillese @TracyDMcGrath That EP is some of my favorite Autechre.

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

@DaveedNoo" 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