Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hardware:music_processor [2016/06/14 00:22]
ex_writer
hardware:music_processor [2016/06/14 09:01] (current)
ex_writer [Port Summary]
Line 29: Line 29:
 | 1 | QUIET | | Stops music and sets volume = 0 | | 1 | QUIET | | Stops music and sets volume = 0 |
 | 2 | OUTPUT | p,d | Port #(0–7), Data | | 2 | OUTPUT | p,d | Port #(0–7), Data |
-| 9 | OUTPUT ​| SNDBX,DATA10,​D11,​D12,​D13,​D14,​D15,​D16,​D17 |+| 9 | OUTPUT | SNDBX,D10,​D11,​D12,​D13,​D14,​D15,​D16,​D17 ​| Sound block transfer for all 8 output ports via SNDBX ($18) |
 | 3 | VOLUME | VOLAB, VOLC | Sets volume Tones A–C | | 3 | VOLUME | VOLAB, VOLC | Sets volume Tones A–C |
 | 1 | PUSHN | | Push # between 1-16 onto the stack | | 1 | PUSHN | | Push # between 1-16 onto the stack |
Line 40: Line 40:
 <WRAP round info>The port numbers (0–7) passed to OUTPUT assume that output port $10 (VOLMO) is the "​base"​ port (i.e., port $0). Port numbers are offset from that base. For example, to set Tone B's frequency to $82, one would call OUTPUT $02,$82. This would store the value $82 in output port $12 (TONEB).</​WRAP>​ <WRAP round info>The port numbers (0–7) passed to OUTPUT assume that output port $10 (VOLMO) is the "​base"​ port (i.e., port $0). Port numbers are offset from that base. For example, to set Tone B's frequency to $82, one would call OUTPUT $02,$82. This would store the value $82 in output port $12 (TONEB).</​WRAP>​
  
-<WRAP round help>​Testing:​\\ * PUSHN creates a loop index that DSJNZ decrements until zero (for looping music sections)?​\\ * What does CREL do?\\ * Why NOTE4 and NOTE5?</​WRAP>​+<WRAP round help>​Testing:​\\ * PUSHN creates a loop index that DSJNZ decrements until zero (for looping music sections)?​\\ * What does CREL do?\\ * Why NOTE4 and NOTE5? ​(Dogpatch uses NOTE4)</​WRAP>​
 ===== Master Oscillator ===== ===== Master Oscillator =====
  
Line 65: Line 65:
 The tone volumes are controlled by output ports $15 (VOLC) and $16 (VOLAB). The lower 4 bits of port $16 set Tone A volume, the upper 4 bits set Tone B volume. The lower 4 bits of port $15 set Tone C volume. Noise can be mixed with the tones by setting bit 5 of port $15 to 1. In this case, the noise volume is given by the upper 4 bits of port $17 (VOLN). In all cases, a volume of 0 is silence and a volume of all 1's is loudest. The tone volumes are controlled by output ports $15 (VOLC) and $16 (VOLAB). The lower 4 bits of port $16 set Tone A volume, the upper 4 bits set Tone B volume. The lower 4 bits of port $15 set Tone C volume. Noise can be mixed with the tones by setting bit 5 of port $15 to 1. In this case, the noise volume is given by the upper 4 bits of port $17 (VOLN). In all cases, a volume of 0 is silence and a volume of all 1's is loudest.
  
-=== Port Summary ===+=== Music Processor ​Port Summary ===
  
 <​code>​ <​code>​
Line 139: Line 139:
 ---- ----
  
-==== Example: Football Anthem & Cheer ====+==== Example: Football ​National ​Anthem & Cheer ====
  
 <code z80> <code z80>
Line 182: Line 182:
          ​LEGSTA          ​LEGSTA
          QUIET          QUIET
 +
 +</​code>​
 +
 +----
 +
 +==== Example: Astro Battle Base Explosion ====
 +
 +<code z80>
 +MUSSTK ​ EQU   ​$4F12 ​    ; Music Stack Pointer
 +
 +; [...]
 +
 +; Begin Music system routine
 +        SYSSUK ​ BMUSIC ​         ; UPI Begin playing MUSIC
 +        DW      MUSSTK ​         ; ... Music Stack = $4F12
 +        DB      $FC             ; Setup Voices, Use Tones A, B, and C
 +        DW      L28A9           ; Score Address of "Base Exploding"​
 +        ​
 +; [...]
 +
 +; Sound Effect of "Base Exploding"​
 +L28A9: ​ MASTER ​ 255             ; Set Tone of Master Oscillator to $FF
 +        VOLUME ​ $FF,​$1F ​        ; Sets Volumes Tone A = 15, Tone B = 15, Tone C = 15, [and NM = 1]
 +        LEGSTA ​                 ; Flip to LEGato from STAccato
 +        OUTPUT ​ $07,​$F0 ​        ; Noise Volume = 15 
 +        NOTE3   ​50,​$88,​$D4,​$F8 ​ ; Duration = 50/​60'​th of a sec, TC= TB= TA=
 +        VOLUME ​ $CA,​$1C ​        ; Sets Volumes Tone A = 10, Tone B = 12, Tone C = 12, [and NM = 1]
 +        OUTPUT ​ $07,​$B8 ​        ; Noise Volume = 184
 +        NOTE3   ​30,​$88,​$D2,​$FA ​ ; Duration = 30/​60'​th of a Sec, TC= TB= TA=
 +        VOLUME ​ $BA,​$1B ​        ; Sets Volumes Tone A = 10, Tone B = 11, Tone C = 11, [and NM = 1]
 +        OUTPUT ​ $07,​$80 ​        ; Noise Volume = 8
 +        NOTE3   ​30,​$8E,​$DD,​$FF ​ ; Duration = 30/​60'​th of a Sec, TC= TB= TA=
 +        VOLUME ​ $86,​$16 ​        ; Sets Volumes Tone A = 6, Tone B = 8, Tone C = 6, [and NM = 0]
 +        OUTPUT ​ $07,​$00 ​        ; Noise Volume = 0
 +        NOTE3   ​25,​$90,​$E0,​$FF ​ ; Duration = 25/​60'​th of a Sec, TC= TB= TA=
 +        QUIET
  
 </​code>​ </​code>​