Skip to content
/ frausto Public

Write Faust DSP code with a Ruby DSL; includes ruby2faust and faust2ruby.

License

Notifications You must be signed in to change notification settings

dfl/frausto

Repository files navigation

Frausto

Gem Version CI License: MIT Ruby

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 = hslider("freq", init: 48, min: 20, max: 100, step: 1) >> midi2hz >> smoo
  amp = hslider("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

About

Write Faust DSP code with a Ruby DSL; includes ruby2faust and faust2ruby.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages