Deluge Firmware 1.3.0
Build date: 2026.11.28
Loading...
Searching...
No Matches
VoiceNoteLocks Class Referencefinal

#include <voice_note_locks.h>

Inheritance diagram for VoiceNoteLocks:
Collaboration diagram for VoiceNoteLocks:

Public Member Functions

bool takePending ()
bool giveSustain (Sound &sound, ParamManagerForTimeline *paramManager) const
bool sourceEverActive (ModelStackWithSoundFlags *modelStack, int32_t s) const
bool sourceActiveCurrently (Sound &sound, int32_t s, ParamManagerForTimeline *paramManager) const
 Sound::isSourceActiveCurrently, with a lock on the source's volume in place of its knob value.
bool oscSyncCurrently (Sound &sound, ParamManagerForTimeline *paramManager) const
 Sound::renderingOscillatorSyncCurrently, with a lock on osc B's volume in place of its knob value.
bool modulatorActive (Sound &sound, int32_t m, ParamManagerForTimeline *paramManager) const
 The FM modulator's volume is above -inf, from a lock if there is one, else its knob value.
bool noiseEverActive (ParamManager *paramManager) const
 The noise volume is ever above -inf, from its knob / automation or a lock.
Public Member Functions inherited from deluge::note_locks::LockSet
int32_t size () const
bool empty () const
bool full () const
std::span< const uint8_t > params () const
std::span< const int32_t > values () const
uint64_t mask () const
 Bit p set if param p is locked.
bool has (int32_t param) const
bool hasAnyOf (uint64_t paramMask) const
std::optional< int32_t > get (int32_t param) const
 The locked value of param, if it's locked.
bool set (int32_t param, int32_t value)
bool remove (int32_t param)
 False if param wasn't locked.
bool merge (const LockSet &other)
 Sets each of other's locks, on top of these. False if any of them didn't fit.
void clear ()
bool operator== (const LockSet &other) const

Static Public Member Functions

static bool pendingTurnsOnASource (Sound &sound)

Public Attributes

uint16_t liveEditTag {0}
 note_locks::LiveEdit::tag of the held pad whose uncommitted lock edits this voice was started with, else 0

Static Public Attributes

static constexpr uint64_t kPan = deluge::note_locks::paramMask(deluge::modulation::params::LOCAL_PAN)
static constexpr uint64_t kStereo
 Sound::renderingVoicesInStereo only looks for stereo samples in the sources the knob values have on.
static constexpr uint64_t kLPF
static constexpr uint64_t kHPF

Private Member Functions

bool volumeLocked (int32_t param) const
bool giveSustainLocked (Sound &sound, ParamManagerForTimeline *paramManager) const
bool sourceEverActiveLocked (ModelStackWithSoundFlags *modelStack, int32_t s) const
bool sourceActiveCurrentlyLocked (Sound &sound, int32_t s) const
bool oscSyncCurrentlyLocked (Sound &sound) const
bool modulatorActiveLocked (Sound &sound, int32_t m) const
bool noiseEverActiveLocked () const

Static Private Attributes

static constexpr uint64_t kEnvelope0Tail
static constexpr uint64_t kOscBVolume
static constexpr uint64_t kSourceVolumes
static constexpr uint64_t kNoiseVolume

Detailed Description

The parameter locks of the note a Voice is playing: its own copy, taken at note-on (pool entries can move while the voice sounds). The Voice's patcher reads them in place of the locked params' knob values.

Sound's checks of whether a source / modulator / noise / osc sync / filter is on, or whether envelope 1 sustains, look at the knob values. A lock replaces the knob value for its note, so a Voice asks the versions here instead. Each is the Sound's own answer unless a lock is involved.

Member Function Documentation

◆ giveSustain()

bool VoiceNoteLocks::giveSustain ( Sound & sound,
ParamManagerForTimeline * paramManager ) const
inlinenodiscard

The locks give envelope 1 a sustain (they lock one of its sustain / decay / release, and with those values it sustains). Lets a note-off through on a sound whose own values have no tails.

◆ pendingTurnsOnASource()

bool VoiceNoteLocks::pendingTurnsOnASource ( Sound & sound)
staticnodiscard

The note about to start (note_locks::pending) locks a source's or the noise's volume up from -inf, so it sounds even if the Sound's knob values have everything off

◆ sourceEverActive()

bool VoiceNoteLocks::sourceEverActive ( ModelStackWithSoundFlags * modelStack,
int32_t s ) const
inlinenodiscard

Sound::isSourceActiveEver (through the model stack's cache), or a lock turns the source's volume up. "Ever" stays true for a source the sound has on and a lock turns off: that only skips its rendering.

◆ takePending()

bool VoiceNoteLocks::takePending ( )

Takes over the locks - or lack of them - of the note being started (note_locks::pending). True if this voice had or now has any, i.e. unless nothing changed.

◆ volumeLocked()

bool VoiceNoteLocks::volumeLocked ( int32_t param) const
inlinenodiscardprivate

has(), for a volume param: they're all below 32, so this only reads the low word of the mask and skips a 64-bit variable shift - it's checked per voice per render

Member Data Documentation

◆ kEnvelope0Tail

uint64_t VoiceNoteLocks::kEnvelope0Tail
staticconstexprprivate
Initial value:
deluge::modulation::params::LOCAL_ENV_0_SUSTAIN, deluge::modulation::params::LOCAL_ENV_0_DECAY,
deluge::modulation::params::LOCAL_ENV_0_RELEASE)
constexpr uint64_t paramMask(Params... params)
A bit per param, as LockSet::mask() has them.
Definition note_locks.h:55

◆ kHPF

uint64_t VoiceNoteLocks::kHPF
staticconstexpr
Initial value:
= deluge::note_locks::paramMask(deluge::modulation::params::LOCAL_HPF_FREQ,
deluge::modulation::params::LOCAL_HPF_MORPH)

◆ kLPF

uint64_t VoiceNoteLocks::kLPF
staticconstexpr
Initial value:
= deluge::note_locks::paramMask(deluge::modulation::params::LOCAL_LPF_FREQ,
deluge::modulation::params::LOCAL_LPF_MORPH)

◆ kNoiseVolume

uint64_t VoiceNoteLocks::kNoiseVolume
staticconstexprprivate
Initial value:
=
deluge::note_locks::paramMask(deluge::modulation::params::LOCAL_NOISE_VOLUME)

◆ kOscBVolume

uint64_t VoiceNoteLocks::kOscBVolume
staticconstexprprivate
Initial value:
=
deluge::note_locks::paramMask(deluge::modulation::params::LOCAL_OSC_B_VOLUME)

◆ kSourceVolumes

uint64_t VoiceNoteLocks::kSourceVolumes
staticconstexprprivate
Initial value:
deluge::modulation::params::LOCAL_OSC_A_VOLUME, deluge::modulation::params::LOCAL_OSC_B_VOLUME)

◆ kStereo

uint64_t VoiceNoteLocks::kStereo
staticconstexpr
Initial value:
= kPan
| deluge::note_locks::paramMask(deluge::modulation::params::LOCAL_OSC_A_VOLUME,
deluge::modulation::params::LOCAL_OSC_B_VOLUME)

Sound::renderingVoicesInStereo only looks for stereo samples in the sources the knob values have on.


The documentation for this class was generated from the following files: