Class: Synthesizer::OscillatorSource::Base::Context
- Inherits:
-
Object
- Object
- Synthesizer::OscillatorSource::Base::Context
- Defined in:
- lib/synthesizer/oscillator_source/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#init_phase ⇒ Object
readonly
Returns the value of attribute init_phase.
-
#note_perform ⇒ Object
readonly
Returns the value of attribute note_perform.
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#soundinfo ⇒ Object
readonly
Returns the value of attribute soundinfo.
Instance Method Summary collapse
- #channels ⇒ Object
- #framerate ⇒ Object
-
#initialize(soundinfo, note_perform, init_phase) ⇒ Context
constructor
A new instance of Context.
- #samplerate ⇒ Object
- #window_size ⇒ Object
Constructor Details
#initialize(soundinfo, note_perform, init_phase) ⇒ Context
Returns a new instance of Context.
41 42 43 44 45 46 |
# File 'lib/synthesizer/oscillator_source/base.rb', line 41 def initialize(soundinfo, note_perform, init_phase) @soundinfo = soundinfo @note_perform = note_perform @init_phase = init_phase @pos = ShapePos.new(@soundinfo.samplerate, init_phase) end |
Instance Attribute Details
#init_phase ⇒ Object (readonly)
Returns the value of attribute init_phase.
38 39 40 |
# File 'lib/synthesizer/oscillator_source/base.rb', line 38 def init_phase @init_phase end |
#note_perform ⇒ Object (readonly)
Returns the value of attribute note_perform.
37 38 39 |
# File 'lib/synthesizer/oscillator_source/base.rb', line 37 def note_perform @note_perform end |
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
39 40 41 |
# File 'lib/synthesizer/oscillator_source/base.rb', line 39 def pos @pos end |
#soundinfo ⇒ Object (readonly)
Returns the value of attribute soundinfo.
36 37 38 |
# File 'lib/synthesizer/oscillator_source/base.rb', line 36 def soundinfo @soundinfo end |
Instance Method Details
#channels ⇒ Object
52 53 54 |
# File 'lib/synthesizer/oscillator_source/base.rb', line 52 def channels @channels ||= soundinfo.channels end |
#framerate ⇒ Object
60 61 62 |
# File 'lib/synthesizer/oscillator_source/base.rb', line 60 def framerate @framerate ||= soundinfo.framerate end |
#samplerate ⇒ Object
56 57 58 |
# File 'lib/synthesizer/oscillator_source/base.rb', line 56 def samplerate @samplerate ||= soundinfo.samplerate end |
#window_size ⇒ Object
48 49 50 |
# File 'lib/synthesizer/oscillator_source/base.rb', line 48 def window_size @window_size ||= soundinfo.window_size end |