Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby2faust/dsl.rb

Overview

Numeric extensions for audio conversions These return DSP nodes that can be used in signal chains

Instance Method Summary collapse

Instance Method Details

#dbObject

dB to linear gain -6.db => ba.db2linear(-6)



1311
1312
1313
# File 'lib/ruby2faust/dsl.rb', line 1311

def db
  Ruby2Faust::DSL.db2linear(self)
end

#hzObject

Hz (pass-through for clarity) 440.hz => 440



1329
1330
1331
# File 'lib/ruby2faust/dsl.rb', line 1329

def hz
  Ruby2Faust::DSL.literal(self.to_s)
end

#midiObject

MIDI note number to Hz 60.midi => ba.midikey2hz(60)



1305
1306
1307
# File 'lib/ruby2faust/dsl.rb', line 1305

def midi
  Ruby2Faust::DSL.midi2hz(self)
end

#msObject

Milliseconds to samples 100.ms => ba.sec2samp(0.1)



1323
1324
1325
# File 'lib/ruby2faust/dsl.rb', line 1323

def ms
  Ruby2Faust::DSL.sec2samp(self / 1000.0)
end

#secObject

Seconds to samples 0.1.sec => ba.sec2samp(0.1)



1317
1318
1319
# File 'lib/ruby2faust/dsl.rb', line 1317

def sec
  Ruby2Faust::DSL.sec2samp(self)
end