#define clockrate 32768 #define fraction 100 #define changerate 128 #define quarter changerate*60/tempo #define whole quarter*4 ;whole note length #define half quarter*2 ;half note length #define eighth quarter/2 ;eighth note length #define sixteenth quarter/4 ;sixteenth note length #define thirtysecond quarter/8 ;thirtysecond note length #define sixtyfourth quarter/16 ;sixtyfourth note length #define quarterd quarter+eighth #define wholed whole+half #define halfd half+quarter #define eighthd eighth+sixteenth #define sixteenthd sixteenth+thirtysecond #define thirtysecondd thirtysecond+sixtyfourth #define half3 whole/3 ;half note triplets #define quarter3 half/3 ;quarter note triplets #define eighth3 quarter/3 ;eighth note triplets #define sixteenth3 eighth/3 ;sixteenth note triplets #define thirtysecond3 sixteenth/3 ;thirtysecond note triplets #define sixtyfourth3 thirtysecond/3 ;sixtyfourth note triplets #macro tone(duration,note) .dw duration .dw note .dw 0 #endmacro #macro noise(duration,lower,upper) .dw duration .dw lower #if lower>upper .dw lower-upper #else .dw 0 #endif #endmacro #macro notec(note) ((clockrate*fraction)/(note*2)) #endmacro c0 = notec(1635) cs0 = notec(1732) d0 = notec(1835) ds0 = notec(1945) e0 = notec(2060) f0 = notec(2183) fs0 = notec(2312) g0 = notec(2450) gs0 = notec(2596) a0 = notec(2750) as0 = notec(2914) b0 = notec(3087) c1 = notec(3270) cs1 = notec(3465) d1 = notec(3671) ds1 = notec(3889) e1 = notec(4120) f1 = notec(4365) fs1 = notec(4625) g1 = notec(4900) gs1 = notec(5191) a1 = notec(5500) as1 = notec(5827) b1 = notec(6174) c2 = notec(6541) cs2 = notec(6930) d2 = notec(7342) ds2 = notec(7778) e2 = notec(8241) f2 = notec(8731) fs2 = notec(9250) g2 = notec(9800) gs2 = notec(10383) a2 = notec(11000) as2 = notec(11654) b2 = notec(12347) c3 = notec(13081) cs3 = notec(13859) d3 = notec(14683) ds3 = notec(15556) e3 = notec(16481) f3 = notec(17461) fs3 = notec(18500) g3 = notec(19600) gs3 = notec(20765) a3 = notec(22000) as3 = notec(23308) b3 = notec(24694) c4 = notec(26163) cs4 = notec(27718) d4 = notec(29366) ds4 = notec(31113) e4 = notec(32963) f4 = notec(34923) fs4 = notec(36999) g4 = notec(39200) gs4 = notec(41530) a4 = notec(44000) as4 = notec(46616) b4 = notec(49388) c5 = notec(52325) cs5 = notec(55437) d5 = notec(58733) ds5 = notec(62225) e5 = notec(65926) f5 = notec(69846) fs5 = notec(73999) g5 = notec(78399) gs5 = notec(83061) a5 = notec(88000) as5 = notec(93233) b5 = notec(98777) #define c#0 cs0 #define d#0 ds0 #define f#0 fs0 #define g#0 gs0 #define a#0 as0 #define c#1 cs1 #define d#1 ds1 #define f#1 fs1 #define g#1 gs1 #define a#1 as1 #define c#2 cs2 #define d#2 ds2 #define f#2 fs2 #define g#2 gs2 #define a#2 as2 #define c#3 cs3 #define d#3 ds3 #define f#3 fs3 #define g#3 gs3 #define a#3 as3 #define c#4 cs4 #define d#4 ds4 #define f#4 fs4 #define g#4 gs4 #define a#4 as4 #define c#5 cs5 #define d#5 ds5 #define f#5 fs5 #define g#5 gs5 #define a#5 as5