Skip to content

Instantly share code, notes, and snippets.

@mistydemeo
Created November 12, 2012 20:45
Show Gist options
  • Save mistydemeo/4061764 to your computer and use it in GitHub Desktop.
Save mistydemeo/4061764 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
$: << File.expand_path(File.join(__FILE__,"..","..", "lib"))
require 'paula/mdxmini'
require 'paula/xmp'
require 'open3'
# player = Paula::XMP::Player.new ARGV[0], frequency: 44100, loops: 1
player = Paula::MDXMini::Player.new ARGV[0], frequency: 44100, loops: 1
stdin, stdout, stderr, thr = Open3.popen3(*%w[play -b 16 -r 44100 -c 2 -e signed-integer -t raw -q -])
player.each do |sample|
stdin.write sample
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment