Frausto
A Ruby toolkit for Faust DSP: generate Faust code from Ruby, or convert Faust to Ruby.
Installation
gem install frausto
Or add to your Gemfile:
gem 'frausto'
Tools
- ruby2faust - Ruby DSL that generates Faust DSP code
- faust2ruby - Convert Faust DSP code to Ruby DSL
Quick Examples
require 'ruby2faust'
code = Ruby2Faust.generate do
freq = ("freq", init: 48, min: 20, max: 100, step: 1) >> midi2hz >> smoo
amp = ("amp", init: -12, min: -60, max: 0, step: 1) >> db2linear >> smoo
osc(freq) >> lp(2000) >> gain(amp)
end
puts code
# import("stdfaust.lib");
#
# process =
# os.osc(hslider("freq", 48, 20, 100, 1) : ba.midikey2hz : si.smoo)
# : fi.lowpass(1, 2000)
# : *(hslider("amp", -12, -60, 0, 1) : ba.db2linear : si.smoo);
require 'faust2ruby'
ruby_code = Faust2Ruby.to_ruby('process = os.osc(440) : *(0.5);')
# => "0.5 * osc(440)"
License
MIT