Ruck uses continuations and a simple scheduler to ensure "shreds" (threads in Ruck) are woken at precisely the right time according to its virtual clock. Schedulers can map virtual time to samples in a WAV file, real time, time in a MIDI file, or anything else by overriding "sim_to" in the Shreduler class. A small library of useful unit generators and plenty of examples are provided. See the README or the web page for details.
Gemfile gem 'ruck', '~> 0.1.2'
install gem install ruck -v 0.1.2