arirusso / unimidi

Realtime MIDI IO for Ruby
Other
255 stars 28 forks source link

output.puts doesnt product sound consistently #26

Open udit99 opened 10 years ago

udit99 commented 10 years ago

I'm using the tutorial here: http://tx81z.blogspot.com/2011/06/unimidi-platform-independent-realtime.html

I've found that if I try running the following loop immediately after running it once, it doesnt produce any sound:

output.open do |output|

notes.each do |note| output.puts(0x90, note, 100) # note on message sleep(duration) # wait output.puts(0x80, note, 100) # note off message end

end

But if I give it a few seconds (20-30) to "catch up"...I can make sounds again...Doing individual output.puts also seems to result in similar "silent lags".

arirusso commented 10 years ago

Sorry for the late response. If you're still interested, what platform/ruby are you on? What MIDI interface are you using?