Class: Synthesizer::Amplifier

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(shape: Shape::Sine, volume: 1.0, pan: 0.0, tune_semis: 0, tune_cents: 0, uni_num: 1.0, uni_detune: 0.0, uni_stereo: 0.0) ⇒ Amplifier

Returns a new instance of Amplifier.

Parameters:

  • volume (Float) (defaults to: 1.0)

    master volume. mute=0.0 max=1.0

  • pan (Float) (defaults to: 0.0)

    master pan. left=-1.0 center=0.0 right=1.0 (-1.0~1.0)

  • tune_semis (Integer) (defaults to: 0)

    master pitch semitone

  • tune_cents (Integer) (defaults to: 0)

    master pitch cent

  • uni_num (Float) (defaults to: 1.0)

    master voicing number (1.0~16.0)

  • uni_detune (Float) (defaults to: 0.0)

    master voicing detune percent. 0.01=1cent 1.0=semitone (0.0~1.0)

  • uni_stereo (Float) (defaults to: 0.0)

    oscillator voicing spread pan. -1.0=full inv 0.0=mono 1.0=full (-1.0~1.0)



19
20
21
22
23
24
25
26
27
28
# File 'lib/synthesizer/amplifier.rb', line 19

def initialize(shape: Shape::Sine, volume: 1.0, pan: 0.0, tune_semis: 0, tune_cents: 0, uni_num: 1.0, uni_detune: 0.0, uni_stereo: 0.0)
  @volume = ModulationValue.create(volume)
  @pan = ModulationValue.create(pan)
  @tune_semis = ModulationValue.create(tune_semis)
  @tune_cents = ModulationValue.create(tune_cents)

  @uni_num = ModulationValue.create(uni_num)
  @uni_detune = ModulationValue.create(uni_detune)
  @uni_stereo = ModulationValue.create(uni_stereo)
end

Instance Attribute Details

#panObject (readonly)

Returns the value of attribute pan.



5
6
7
# File 'lib/synthesizer/amplifier.rb', line 5

def pan
  @pan
end

#tune_centsObject (readonly)

Returns the value of attribute tune_cents.



7
8
9
# File 'lib/synthesizer/amplifier.rb', line 7

def tune_cents
  @tune_cents
end

#tune_semisObject (readonly)

Returns the value of attribute tune_semis.



6
7
8
# File 'lib/synthesizer/amplifier.rb', line 6

def tune_semis
  @tune_semis
end

#uni_detuneObject (readonly)

Returns the value of attribute uni_detune.



9
10
11
# File 'lib/synthesizer/amplifier.rb', line 9

def uni_detune
  @uni_detune
end

#uni_numObject (readonly)

Returns the value of attribute uni_num.



8
9
10
# File 'lib/synthesizer/amplifier.rb', line 8

def uni_num
  @uni_num
end

#uni_stereoObject (readonly)

Returns the value of attribute uni_stereo.



10
11
12
# File 'lib/synthesizer/amplifier.rb', line 10

def uni_stereo
  @uni_stereo
end

#volumeObject (readonly)

Returns the value of attribute volume.



4
5
6
# File 'lib/synthesizer/amplifier.rb', line 4

def volume
  @volume
end