Class: Synthesizer::OscillatorSource::Base::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/synthesizer/oscillator_source/base.rb

Direct Known Subclasses

FormantVocoder::Context, Pulse::Context

Instance Attribute Summary collapse

Instance Method Summary collapse

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_phaseObject (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_performObject (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

#posObject (readonly)

Returns the value of attribute pos.



39
40
41
# File 'lib/synthesizer/oscillator_source/base.rb', line 39

def pos
  @pos
end

#soundinfoObject (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

#channelsObject



52
53
54
# File 'lib/synthesizer/oscillator_source/base.rb', line 52

def channels
  @channels ||= soundinfo.channels
end

#framerateObject



60
61
62
# File 'lib/synthesizer/oscillator_source/base.rb', line 60

def framerate
  @framerate ||= soundinfo.framerate
end

#samplerateObject



56
57
58
# File 'lib/synthesizer/oscillator_source/base.rb', line 56

def samplerate
  @samplerate ||= soundinfo.samplerate
end

#window_sizeObject



48
49
50
# File 'lib/synthesizer/oscillator_source/base.rb', line 48

def window_size
  @window_size ||= soundinfo.window_size
end