Class: Synthesizer::Oscillator
- Inherits:
-
Object
- Object
- Synthesizer::Oscillator
- Defined in:
- lib/synthesizer/oscillator.rb
Instance Attribute Summary collapse
-
#pan ⇒ Object
readonly
Returns the value of attribute pan.
-
#phase ⇒ Object
readonly
Returns the value of attribute phase.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#sym ⇒ Object
readonly
Returns the value of attribute sym.
-
#sync ⇒ Object
readonly
Returns the value of attribute sync.
-
#tune_cents ⇒ Object
readonly
Returns the value of attribute tune_cents.
-
#tune_semis ⇒ Object
readonly
Returns the value of attribute tune_semis.
-
#uni_detune ⇒ Object
readonly
Returns the value of attribute uni_detune.
-
#uni_num ⇒ Object
readonly
Returns the value of attribute uni_num.
-
#uni_stereo ⇒ Object
readonly
Returns the value of attribute uni_stereo.
-
#volume ⇒ Object
readonly
Returns the value of attribute volume.
Instance Method Summary collapse
-
#initialize(source: OscillatorSource::Sine.instance, volume: 1.0, pan: 0.0, tune_semis: 0, tune_cents: 0, sym: 0, phase: nil, sync: 0, uni_num: 1.0, uni_detune: 0.0, uni_stereo: 0.0) ⇒ Oscillator
constructor
A new instance of Oscillator.
Constructor Details
#initialize(source: OscillatorSource::Sine.instance, volume: 1.0, pan: 0.0, tune_semis: 0, tune_cents: 0, sym: 0, phase: nil, sync: 0, uni_num: 1.0, uni_detune: 0.0, uni_stereo: 0.0) ⇒ Oscillator
Returns a new instance of Oscillator.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/synthesizer/oscillator.rb', line 27 def initialize(source: OscillatorSource::Sine.instance, volume: 1.0, pan: 0.0, tune_semis: 0, tune_cents: 0, sym: 0, phase: nil, sync: 0, uni_num: 1.0, uni_detune: 0.0, uni_stereo: 0.0) @source = source @volume = ModulationValue.create(volume) @pan = ModulationValue.create(pan) @tune_semis = ModulationValue.create(tune_semis) @tune_cents = ModulationValue.create(tune_cents) @sym = ModulationValue.create(sym) @phase = ModulationValue.create(phase) @sync = ModulationValue.create(sync) @uni_num = ModulationValue.create(uni_num) @uni_detune = ModulationValue.create(uni_detune) end |
Instance Attribute Details
#pan ⇒ Object (readonly)
Returns the value of attribute pan.
6 7 8 |
# File 'lib/synthesizer/oscillator.rb', line 6 def pan @pan end |
#phase ⇒ Object (readonly)
Returns the value of attribute phase.
10 11 12 |
# File 'lib/synthesizer/oscillator.rb', line 10 def phase @phase end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
4 5 6 |
# File 'lib/synthesizer/oscillator.rb', line 4 def source @source end |
#sym ⇒ Object (readonly)
Returns the value of attribute sym.
9 10 11 |
# File 'lib/synthesizer/oscillator.rb', line 9 def sym @sym end |
#sync ⇒ Object (readonly)
Returns the value of attribute sync.
11 12 13 |
# File 'lib/synthesizer/oscillator.rb', line 11 def sync @sync end |
#tune_cents ⇒ Object (readonly)
Returns the value of attribute tune_cents.
8 9 10 |
# File 'lib/synthesizer/oscillator.rb', line 8 def tune_cents @tune_cents end |
#tune_semis ⇒ Object (readonly)
Returns the value of attribute tune_semis.
7 8 9 |
# File 'lib/synthesizer/oscillator.rb', line 7 def tune_semis @tune_semis end |
#uni_detune ⇒ Object (readonly)
Returns the value of attribute uni_detune.
13 14 15 |
# File 'lib/synthesizer/oscillator.rb', line 13 def uni_detune @uni_detune end |
#uni_num ⇒ Object (readonly)
Returns the value of attribute uni_num.
12 13 14 |
# File 'lib/synthesizer/oscillator.rb', line 12 def uni_num @uni_num end |
#uni_stereo ⇒ Object (readonly)
Returns the value of attribute uni_stereo.
14 15 16 |
# File 'lib/synthesizer/oscillator.rb', line 14 def uni_stereo @uni_stereo end |
#volume ⇒ Object (readonly)
Returns the value of attribute volume.
5 6 7 |
# File 'lib/synthesizer/oscillator.rb', line 5 def volume @volume end |