Player#

namespace YSE

Public API of libYSE — sound playback, mixing, and 3D positional audio.

Entry points: YSE::System (lifecycle and audio device), YSE::Listener (3D origin), YSE::sound (a playable source), YSE::channel (mixing tree), YSE::reverb (positioned reverb zone), YSE::patcher (modular DSP graph), YSE::player (note sequencer). Sub-namespaces group domain-specific types: YSE::DSP for signal processing, YSE::MIDI for MIDI I/O, YSE::MUSIC for note / chord / motif primitives.

Note

Apart from their constructors, the oscillator and vcf classes must only be invoked from inside a DSP callback / process body.

namespace YSE

Public API of libYSE — sound playback, mixing, and 3D positional audio.

Entry points: YSE::System (lifecycle and audio device), YSE::Listener (3D origin), YSE::sound (a playable source), YSE::channel (mixing tree), YSE::reverb (positioned reverb zone), YSE::patcher (modular DSP graph), YSE::player (note sequencer). Sub-namespaces group domain-specific types: YSE::DSP for signal processing, YSE::MIDI for MIDI I/O, YSE::MUSIC for note / chord / motif primitives.

Note

Apart from their constructors, the oscillator and vcf classes must only be invoked from inside a DSP callback / process body.

class player#

Generative note sequencer.

Plays random notes within configurable pitch / velocity / gap / length ranges, optionally constrained to a scale, optionally drawing from one or more weighted motif patterns instead of pure randomness. All numeric setters accept an optional time parameter that linearly interpolates from the current value to the target over that many seconds.

See also

YSE::scale

See also

YSE::motif

Public Functions

player()#
~player()#
player &play()#

Start producing notes.

player &stop()#

Stop producing notes.

Bool isPlaying()#

Whether the player is currently producing notes.

player &setMinimumPitch(Flt target, Flt time = 0)#

Set the lowest pitch the player may produce.

Range [0, 126].

player &setMaximumPitch(Flt target, Flt time = 0)#

Set the highest pitch the player may produce.

Range [1, 127].

player &setMinimumVelocity(Flt target, Flt time = 0)#

Set the lowest velocity.

Range [0, 0.999999].

player &setMaximumVelocity(Flt target, Flt time = 0)#

Set the highest velocity.

Range [0.000001, 1].

player &setMinimumGap(Flt target, Flt time = 0)#

Set the minimum gap between successive notes / motifs, in seconds.

player &setMaximumGap(Flt target, Flt time = 0)#

Set the maximum gap between successive notes / motifs, in seconds.

player &setMinimumLength(Flt target, Flt time = 0)#

Set the minimum note length, in seconds.

Used when no motif is active.

player &setMaximumLength(Flt target, Flt time = 0)#

Set the maximum note length, in seconds.

Used when no motif is active.

player &setVoices(UInt target, Flt time = 0)#

Set the number of simultaneous voices.

player &setScale(scale &scale, Flt time = 0)#

Constrain generated pitches to a scale.

Note

The player keeps its own copy — modifying scale after this call has no effect on the player.

player &addMotif(motif &motif, UInt weight = 1)#

Add a motif to the player’s pool.

When the player decides to play a motif (see playMotifs) it picks one weighted by weight.

player &removeMotif(motif &motif)#

Remove a previously added motif.

player &adjustMotifWeight(motif &motif, UInt weight)#

Adjust the selection weight of an already-added motif.

player &playPartialMotifs(Flt target, Flt time = 0)#

Probability that the player plays only part of a motif.

target == 0 always plays full motifs, target == 1 always plays partial motifs, values in between mix the two.

player &playMotifs(Flt target, Flt time = 0)#

Probability that the player draws notes from a motif vs.

random.

target == 0 is pure random, target == 1 is motifs only.

player &fitMotifsToScale(Flt target, Flt time = 0)#

Probability that motif notes are quantised to the active scale.

target == 0 plays motifs as written (only the first note is forced onto the scale); target == 1 snaps every note to the scale.

Private Members

PLAYER::implementationObject *pimpl#
Bool _isPlaying#