ipytone.MembraneSynth#

class ipytone.MembraneSynth(**kwargs: Any)#

Bases: Synth

A synth that makes kick and tom sounds.

__init__(pitch_decay=0.05, octaves=8, **kwargs)#

Public constructor

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 destinations audio nodes in parallel.

to_destination()

Convenience method to directly connect the output of this audio node to the main output (speakers) node.

trigger_attack(note[, time, velocity])

Trigger the attack portion of the note.

trigger_attack_release(note, duration[, ...])

Play a note of a given duration.

trigger_note(note[, time])

Trigger a note.

trigger_release([time])

Trigger the release of the active note.

Attributes

channel_count

An int trait.

channel_count_mode

An enum whose value must be in a given sequence.

channel_interpretation

An enum whose value must be in a given sequence.

detune

disposed

Returns True if the node was disposed (i.e., disconnected and web audio node freed for garbage collection).

frequency

input

Returns the input node, or None if this node is a source.

log

A trait whose value must be an instance of a specified class.

name

A trait for unicode strings.

number_of_inputs

Returns the number of input slots for the input node (0 for source nodes).

number_of_outputs

Returns the number of output slots for the output node (0 for sink nodes).

octaves

The number of octaves the pitch envelope ramps.

output

Returns the output node, or None if this node is a sink.

pitch_decay

Amount of time the frequency envelope takes.

portamento

glide time between notes

volume

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.

Parameters:
  • destination (AudioNode or NativeAudioNode or Param or NativeAudioParam) – The destination node.

  • output_number (int) – The channel number of the output of this node (default: 0).

  • input_number (int) – The channel number of the input of the destination node (default: 0).

disconnect(destination, output_number=0, input_number=0)#

Disconnect the ouput of this audio node from a connected node.

Parameters:
  • destination (AudioNode or NativeAudioNode or Param or NativeAudioParam) – The connected destination node.

  • output_number (int) – The channel number of the output of this node (default: 0).

  • input_number (int) – The channel number of the input of the destination node (default: 0).

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 destinations audio nodes in parallel.

property input#

Returns the input node, or None if this node is a source.

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 octaves#

The number of octaves the pitch envelope ramps.

property output#

Returns the output node, or None if this node is a sink.

property pitch_decay#

Amount of time the frequency envelope takes.

portamento#

glide time between notes

to_destination()#

Convenience method to directly connect the output of this audio node to the main output (speakers) node.

trigger_attack(note, time=None, velocity=1)#

Trigger the attack portion of the note.

Parameters:
  • note (float or str) – The frequency or 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 the note (any value between 0 and 1).

trigger_attack_release(note, duration, time=None, velocity=1)#

Play a note of a given duration.

Parameters:
  • note (float or str or list) – The frequency or note to play. Also accepts a list of notes to play one after another.

  • 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 the note (any value between 0 and 1).

trigger_note(note, time=None)#

Trigger a note.

Parameters:
  • note (Note) – The note object to play. Depending on its trigger_type attribute, this method dispatches either to trigger_attack, trigger_release or trigger_attack_relase using 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 time attribute of the note object.

trigger_release(time=None)#

Trigger the release of the active note.

Parameters:

time (float or str, optional) – The time at which the note is released (default: now).

property volume: Param#

The instrument volume parameter.