playTicks

maelzel.snd.features.playTicks(times, engine=None, chan=1, midinote=69, amp=0.5, attack=0.01, decay=0.05, sustain=0.5, release=0.1, extraLatency=0.0)[source]

Given a list of times offsets, play these as ticks

Parameters:
  • times (list[float] | ndarray) – a list of time offsets

  • chan – which channel to play the ticks to

  • midinote (int | float | list[float]) – the pitch of the ticks or a list of pitches, one for each tick

  • amp – the amplitude of the ticks

  • attack – attack duration

  • decay – decay duration

  • sustain – sustain amplitude

  • release – release dur.

Return type:

SynthGroup

Returns:

a csoundengine.SynthGroup, which constrols playback.

Examples

>>> import sndfileio
>>> samples, info = sndfileio.sndget("/path/to/sound.wav")
>>> onsets = onsetsAubio(samples, info.sr)
>>> synthgroup = playTicks(onsets)
# if needed to stop the playback at any moment:
>>> synthgroup.stop()