; A program that stops while a note is still held down. ; ; The gate is a register on the sound device, and only a program can drop one. This one does ; not: it starts a note whose envelope sustains at full and then hands the machine back, so ; the note is left sounding with nothing left in the world able to end it. ; ; WHAT SHOULD HAPPEN IS THAT COSMOS ENDS IT, the way it puts the screen back and the drive and ; the vectors - and for a stronger reason, since a program that faults cannot tidy up after ; itself either. Without that this note sustains for as long as the machine runs. ; ; Sustain at full and a short release, so the difference between the two answers is loud: a ; gate left up rings for ever and a gate dropped is quiet within a fraction of a second. ; ; Written by Anachronaut #Include services.asm #Program #Base 0x5000 start: RSTA OUTA 0x41 ; Channel 0 OUTA 0x42 INIA 0d2 OUTA 0x43 ; Saw INIA 0x01 OUTA 0x42 INIA 0xFF OUTA 0x43 ; at full gain INIA 0x05 OUTA 0x42 INIA 0x01 OUTA 0x43 ; and on. INIA 0x20 OUTA 0x42 RSTA OUTA 0x43 ; No attack INIA 0x21 OUTA 0x42 RSTA OUTA 0x43 ; no decay INIA 0x22 OUTA 0x42 INIA 0xFF OUTA 0x43 ; and held at full, for ever, until a gate says otherwise. INIA 0x23 OUTA 0x42 INIA 0d5 OUTA 0x43 ; A short release, so a dropped gate is quiet almost at once. INIA 0xC0 OUTA 0x46 INIA 0d60 OUTA 0x44 ; Middle C, started and never let go of. SWI osExit #Data #Base 0x3000 Unused: 0x00 #Vectors Boot start