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;
|
lastStep = -1;
|
||||||
lastGateApplied = false;
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -537,8 +553,7 @@ void MonostepAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juc
|
||||||
}
|
}
|
||||||
|
|
||||||
// Optional retrigger: a fresh note-on restarts the pattern from
|
// Optional retrigger: a fresh note-on restarts the pattern from
|
||||||
// step 1. Only honoured in free-run mode; while the host transport
|
// step 1 in free-run mode.
|
||||||
// is running, the pattern follows the host grid instead.
|
|
||||||
if (noteOnSeen && seqRetrigParam->load() >= 0.5f)
|
if (noteOnSeen && seqRetrigParam->load() >= 0.5f)
|
||||||
{
|
{
|
||||||
freePpq = 0.0;
|
freePpq = 0.0;
|
||||||
|
|
|
||||||
|
|
@ -127,4 +127,5 @@ private:
|
||||||
bool wasPlaying = false;
|
bool wasPlaying = false;
|
||||||
double lastHostPpq = -1.0;
|
double lastHostPpq = -1.0;
|
||||||
double freePpq = 0.0;
|
double freePpq = 0.0;
|
||||||
|
double retrigPpq = 0.0;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue