Class: Musicality::SuperCollider::Performer
- Inherits:
-
Object
- Object
- Musicality::SuperCollider::Performer
- Defined in:
- lib/musicality/performance/supercollider/performer.rb
Constant Summary collapse
- MASTER_AUDIO_BUS =
0
Instance Attribute Summary collapse
-
#part ⇒ Object
readonly
Returns the value of attribute part.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #bundles(parent_group: nil, aux_audio_bus: 16, volume_control_bus: 0, lead_time: 0.1) ⇒ Object
-
#initialize(part) ⇒ Performer
constructor
A new instance of Performer.
Constructor Details
#initialize(part) ⇒ Performer
Returns a new instance of Performer.
8 9 10 11 12 13 14 15 16 |
# File 'lib/musicality/performance/supercollider/performer.rb', line 8 def initialize part @settings = part.synthdef_settings || SynthDefs::DEFAULT.settings @part = part unless @settings.synthdef.params.has_key?(:out) raise ArgumentError "SynthDef #{@settings.synthdef} does not have :out param" end @takes_freq = @settings.synthdef.params.has_key? :freq @takes_gate = @settings.synthdef.params.has_key? :gate end |
Instance Attribute Details
#part ⇒ Object (readonly)
Returns the value of attribute part.
7 8 9 |
# File 'lib/musicality/performance/supercollider/performer.rb', line 7 def part @part end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
7 8 9 |
# File 'lib/musicality/performance/supercollider/performer.rb', line 7 def settings @settings end |
Instance Method Details
#bundles(parent_group: nil, aux_audio_bus: 16, volume_control_bus: 0, lead_time: 0.1) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/musicality/performance/supercollider/performer.rb', line 18 def bundles parent_group: nil, aux_audio_bus: 16, volume_control_bus: 0, lead_time: 0.1 raise ArgumentError, "Lead time #{lead_time} is not positive" unless lead_time > 0.0 bundles = [] group = create_part_group parent_group, bundles set_start_volume volume_control_bus, bundles add_volume_control group, aux_audio_bus, volume_control_bus, lead_time, bundles add_volume_changes group, volume_control_bus, lead_time, bundles add_part_notes group, aux_audio_bus, lead_time, bundles bundles end |