ipytone.PolySynth#
- class ipytone.PolySynth(**kwargs: Any)#
Bases:
AudioNodeA PolySynth allows any given monophonic synthesizer to be polyphonic.
- __init__(voice=<class 'ipytone.instrument.Synth'>, volume=0, **kwargs)#
- Parameters:
voice (subclass of
Monophonic) – Any monophonic type used to create each voice of the poly-synth.volume (int) – Output volume (in decibels).
Methods
chain(*nodes)Connect the output of this audio node to the other audio nodes in series.
connect(destination[, output_number, ...])Connect the output of this audio node to the input of another node.
disconnect(destination[, output_number, ...])Disconnect the ouput of this audio node from a connected node.
dispose()Dispose and disconnect this audio node (as well as its input/output).
fan(*destinations)Connect the output of this audio node to the
destinationsaudio nodes in parallel.release_all([time])Trigger the release of all currently active voices.
Convenience method to directly connect the output of this audio node to the main output (speakers) node.
trigger_attack(notes[, time, velocity])Trigger the attack portion of one or more notes.
trigger_attack_release(notes, duration[, ...])Play one or more notes with given duration(s).
trigger_note(note[, time])Trigger a note.
trigger_release(notes[, time])Trigger the release of one or more notes.
Attributes
channel_countAn int trait.
channel_count_modeAn enum whose value must be in a given sequence.
channel_interpretationAn enum whose value must be in a given sequence.
Returns True if the node was disposed (i.e., disconnected and web audio node freed for garbage collection).
Returns the input node, or None if this node is a source.
logA trait whose value must be an instance of a specified class.
Max.
nameA trait for unicode strings.
Returns the number of input slots for the input node (0 for source nodes).
Returns the number of output slots for the output node (0 for sink nodes).
Returns the output node, or None if this node is a sink.
Returns an instance of the
Monophonicclass used to create all the voices of this PolySynth.The instrument volume parameter.
- chain(*nodes)#
Connect the output of this audio node to the other audio nodes in series.
- connect(destination, output_number=0, input_number=0)#
Connect the output of this audio node to the input of another node.
- disconnect(destination, output_number=0, input_number=0)#
Disconnect the ouput of this audio node from a connected node.
- dispose()#
Dispose and disconnect this audio node (as well as its input/output).
- property disposed#
Returns True if the node was disposed (i.e., disconnected and web audio node freed for garbage collection).
- fan(*destinations)#
Connect the output of this audio node to the
destinationsaudio nodes in parallel.
- property input#
Returns the input node, or None if this node is a source.
- max_polyphony#
Max. number of polyphonic voices alloweed
- property number_of_inputs#
Returns the number of input slots for the input node (0 for source nodes).
- property number_of_outputs#
Returns the number of output slots for the output node (0 for sink nodes).
- property output#
Returns the output node, or None if this node is a sink.
- release_all(time=None)#
Trigger the release of all currently active voices.
- to_destination()#
Convenience method to directly connect the output of this audio node to the main output (speakers) node.
- trigger_attack(notes, time=None, velocity=1)#
Trigger the attack portion of one or more notes.
- trigger_attack_release(notes, duration, time=None, velocity=1)#
Play one or more notes with given duration(s).
- Parameters:
notes (float or str or list) – The frequency(ies) or note(s) to play. Unlike monophonic instruments, all notes are triggered at the same time.
duration (float or str or list) – The duration(s) of (each of) the note to play.
time (float or str, optional) – The time at which the note attack is triggered (default: now).
velocity (float, optional) – The velocity of all of the notes (any value between 0 and 1).
- trigger_note(note, time=None)#
Trigger a note.
- Parameters:
note (
Note) – The note object to play. Depending on itstrigger_typeattribute, this method dispatches either totrigger_attack,trigger_releaseortrigger_attack_relaseusing the the other attribute values.time (float or str, optional) – The time at which the note attack or release is triggered (default: now). This overrides the
timeattribute of thenoteobject.
- trigger_release(notes, time=None)#
Trigger the release of one or more notes.
- property voice: Monophonic#
Returns an instance of the
Monophonicclass used to create all the voices of this PolySynth.Although the individual voices used by the
PolySynthto generate the single notes are not accessible, you can use this (deactivated) voice to change some parameters of this PolySynth. Changing the value of an attribute accessed through this property will automatically update all active voices.