research/opl/scale/gen-sequence
Simon Howard 9d4ebed414 Add instrument 36 scale data.
Subversion-branch: /research
Subversion-revision: 1674
2009-09-17 18:21:00 +00:00

46 lines
624 B
Ruby
Executable file

#!/usr/bin/env ruby
def note_on(delay, channel, note, volume)
# note on
putc delay
putc 0x90 + channel
putc note
putc volume
end
def note_off(delay, channel, note)
# note on
putc delay
putc 0x80 + channel
putc note
putc 0x00
end
def program_change(delay, channel, instrument)
putc delay
putc 0xc0 + channel
putc instrument
end
def end_of_track
putc 0x00
putc 0xff
putc 0x2f
putc 0x00
end
#program_change(0, 8, 36)
for i in 0...128
# note on
note_on(0xf, 8, i, 0x7b)
# note off
note_off(0xf, 8, i)
end
# end of track
end_of_track