/synth

Primary LanguageRuby

A Mono FM Synthesizer!

Requirements:

  • sox
  • mplayer
  • ruby
  • pry (gem install pry) for the console

Usage:

  • open console with make c
  • type expressions (look at wave.rb for some of the stuff available)
  • r <filename>, <expr> renders an expression into a file
  • a <expr> auditions the expression with mplayer
  • i <expr> attempts to show the shape of the wave in the terminal

Examples:

  • A bell:
sin.shift(sin.pitch(11).vol(falloff(4)))
  • A distorted pad
sqr.mod { |x| 2 * Math.exp(x % 2) - 1 }
  • Maybe a nice bass?
saw.shift(saw.pitch(1.5).vol(falloff))
  • A crunchy hi-hat or snare
nse.vol(sqr.pitch(4).unsign).vol(falloff.pitch(15)).vol(6)