mirror of
https://codeberg.org/armin/monostep.git
synced 2026-09-01 04:10:46 +02:00
Retrig pattern from step 1 while host transport is running
This commit is contained in:
parent
4732240cc7
commit
8925199aa3
2 changed files with 19 additions and 3 deletions
|
|
@ -524,9 +524,25 @@ void MonostepAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juc
|
|||
{
|
||||
lastStep = -1;
|
||||
lastGateApplied = false;
|
||||
retrigPpq = 0.0;
|
||||
}
|
||||
|
||||
freePpq = hostPpq;
|
||||
// Optional retrigger: a fresh note-on restarts the pattern from
|
||||
// step 1, offset from the host transport position.
|
||||
const bool retrigOn = seqRetrigParam->load() >= 0.5f;
|
||||
|
||||
if (noteOnSeen && retrigOn)
|
||||
{
|
||||
retrigPpq = hostPpq;
|
||||
lastStep = -1;
|
||||
lastGateApplied = false;
|
||||
}
|
||||
else if (! retrigOn)
|
||||
{
|
||||
retrigPpq = 0.0;
|
||||
}
|
||||
|
||||
freePpq = hostPpq - retrigPpq;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -537,8 +553,7 @@ void MonostepAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juc
|
|||
}
|
||||
|
||||
// Optional retrigger: a fresh note-on restarts the pattern from
|
||||
// step 1. Only honoured in free-run mode; while the host transport
|
||||
// is running, the pattern follows the host grid instead.
|
||||
// step 1 in free-run mode.
|
||||
if (noteOnSeen && seqRetrigParam->load() >= 0.5f)
|
||||
{
|
||||
freePpq = 0.0;
|
||||
|
|
|
|||
|
|
@ -127,4 +127,5 @@ private:
|
|||
bool wasPlaying = false;
|
||||
double lastHostPpq = -1.0;
|
||||
double freePpq = 0.0;
|
||||
double retrigPpq = 0.0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue