gb-asm-tutorial icon indicating copy to clipboard operation
gb-asm-tutorial copied to clipboard

Part II, Lesson 6

Open ISSOtm opened this issue 3 years ago • 9 comments

This lesson will introduce sound to the game. Sound effects are the most important, and will begin with simple "fire-and-forget" sound effects. The core intent is introducing the NRxy registers, their functionality, and basic APU concepts.

Music is optional, but some basic beeps would help introduce concepts that will be abstracted away when we introduce a music driver.

ISSOtm avatar Jan 08 '23 18:01 ISSOtm

Sounds great! We may have to break this into smaller parts in the process but it's a great start.

Pandocs' Audio section should be used as a reference and the chapter should function as a way to expose better information there and make it a bit more "organic" with small easy tasks to follow (e.g. how to design a subroutine to produce a sound effect etc)

avivace avatar Jan 10 '23 14:01 avivace

what do you mean by music? would a less scuffed version of my scuffed as hell driver from a few years ago which reads 32 bytes in a loop and uses a LUT to then play those bytes as notes (with hardcoded envelope and duty, and always lowest octave) count as music? if so, how would i de-scuff it? i wouldnt want to accidentally encourage people to use a somewhat compatibile format to the not-scuffed driver i plan on writting "one day"

zlago avatar Jan 10 '23 15:01 zlago

The plan is not to use a driver at all yet, and directly write to NRxy. This is why music may not really be an option, and SFX are the most important part.

ISSOtm avatar Jan 10 '23 18:01 ISSOtm

Here's my plan: turn on one of the square wave channels upon interaction with the paddle/walls/bricks and implement a frame timer to turn it off again. Atari style beeps and boops. Do you want to save things like duty cycle until later?

DenebolaInteractive avatar Jan 10 '23 19:01 DenebolaInteractive

isnt that just writting $00 (sweep), $02 (len/duty), $a2 (vol/env), $xx (freq), and $8x (freq/retrig) to rNR10-rNR14? assuming NR50, NR51 and NR52 are all $ff

zlago avatar Jan 10 '23 19:01 zlago

I think we should mention duty cycle, since it's a fairly simple concept, and is important to defining the wave being emitted. Besides, we can iterate on the design, it's no big deal if the first draft is not fully on point.

ISSOtm avatar Jan 10 '23 20:01 ISSOtm

To be honest I haven't thought about sound registers in a while and didn't realize NRx1 can set duration! Perhaps a potential trap to point out in the tutorial text?

DenebolaInteractive avatar Jan 10 '23 21:01 DenebolaInteractive

Is it a trap?

ISSOtm avatar Jan 11 '23 20:01 ISSOtm

I've created a draft for this lesson.

evie-calico avatar Feb 25 '23 17:02 evie-calico