Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- 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
-
#db ⇒ Object
dB to linear gain -6.db => ba.db2linear(-6).
-
#hz ⇒ Object
Hz (pass-through for clarity) 440.hz => 440.
-
#midi ⇒ Object
MIDI note number to Hz 60.midi => ba.midikey2hz(60).
-
#ms ⇒ Object
Milliseconds to samples 100.ms => ba.sec2samp(0.1).
-
#sec ⇒ Object
Seconds to samples 0.1.sec => ba.sec2samp(0.1).
Instance Method Details
#db ⇒ Object
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 |
#hz ⇒ Object
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 |
#midi ⇒ Object
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 |
#ms ⇒ Object
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 |
#sec ⇒ Object
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 |