mirror of
https://codeberg.org/armin/chromaflock.git
synced 2026-09-01 04:10:47 +02:00
Fix arp INVERT dropping an octave; invert Stab/Pinky patterns
This commit is contained in:
parent
3b23a5b0db
commit
502565156b
1 changed files with 26 additions and 23 deletions
|
|
@ -188,8 +188,7 @@ private:
|
|||
if (pattern == AsPlayed) {
|
||||
for (int n : heldNotes) {
|
||||
for (int k = 0; k < octaves; ++k) {
|
||||
int off = (direction == DirectionUp ? 12 * k : -12 * k);
|
||||
addPitch(n + off, velocities[n]);
|
||||
addPitch(n + 12 * k, velocities[n]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -197,8 +196,7 @@ private:
|
|||
std::sort(sorted.begin(), sorted.end());
|
||||
for (int n : sorted) {
|
||||
for (int k = 0; k < octaves; ++k) {
|
||||
int off = (direction == DirectionUp ? 12 * k : -12 * k);
|
||||
addPitch(n + off, velocities[n]);
|
||||
addPitch(n + 12 * k, velocities[n]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -288,13 +286,15 @@ private:
|
|||
up = up > 127 ? 127 : up;
|
||||
float vel = heldNotes.empty() ? 0.9f : velocities[heldNotes.back()];
|
||||
NotePitch rest{restNote, vel};
|
||||
int lo = (direction == DirectionDown) ? up : anchor;
|
||||
int hi = (direction == DirectionDown) ? anchor : up;
|
||||
order.clear();
|
||||
if (pattern == PinkyUp) {
|
||||
order = {{anchor, vel}, rest, {up, vel}, {anchor, vel},
|
||||
rest, {up, vel}, {anchor, vel}, {anchor, vel}};
|
||||
order = {{lo, vel}, rest, {hi, vel}, {lo, vel},
|
||||
rest, {hi, vel}, {lo, vel}, {lo, vel}};
|
||||
} else {
|
||||
order = {{up, vel}, rest, {anchor, vel}, {up, vel},
|
||||
rest, {anchor, vel}, {up, vel}, {up, vel}};
|
||||
order = {{hi, vel}, rest, {lo, vel}, {hi, vel},
|
||||
rest, {lo, vel}, {hi, vel}, {hi, vel}};
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -311,27 +311,30 @@ private:
|
|||
up = up > 127 ? 127 : up;
|
||||
float vel = heldNotes.empty() ? 0.9f : velocities[heldNotes.back()];
|
||||
NotePitch rest{restNote, vel};
|
||||
// Invert swaps the lower/upper notes (C3 <-> C4) so the Stab
|
||||
// patterns play upside down when direction is Down.
|
||||
int lo = (direction == DirectionDown) ? up : anchor;
|
||||
int hi = (direction == DirectionDown) ? anchor : up;
|
||||
order.clear();
|
||||
if (pattern == C3C4A) {
|
||||
order = {{anchor, vel}, {anchor, vel}, {up, vel}, {anchor, vel},
|
||||
{up, vel}, {anchor, vel}, rest, {up, vel}};
|
||||
order = {{lo, vel}, {lo, vel}, {hi, vel}, {lo, vel},
|
||||
{hi, vel}, {lo, vel}, rest, {hi, vel}};
|
||||
} else if (pattern == C3C4B) {
|
||||
order = {{up, vel}, {anchor, vel}, rest, {anchor, vel},
|
||||
{anchor, vel}, {anchor, vel}, rest, {anchor, vel}};
|
||||
order = {{hi, vel}, {lo, vel}, rest, {lo, vel},
|
||||
{lo, vel}, {lo, vel}, rest, {lo, vel}};
|
||||
} else if (pattern == C3C4C) {
|
||||
order = {{anchor, vel}, {anchor, vel}, rest, {up, vel},
|
||||
rest, {anchor, vel}, rest, {anchor, vel}};
|
||||
order = {{lo, vel}, {lo, vel}, rest, {hi, vel},
|
||||
rest, {lo, vel}, rest, {lo, vel}};
|
||||
} else if (pattern == C3C4D) {
|
||||
order = {{anchor, vel}, {anchor, vel}, {up, vel}, {anchor, vel},
|
||||
{anchor, vel}, {up, vel}, {anchor, vel}, {anchor, vel},
|
||||
{up, vel}, {anchor, vel}, {anchor, vel}, {up, vel},
|
||||
{anchor, vel}, {anchor, vel}, {anchor, vel}, {anchor, vel}};
|
||||
order = {{lo, vel}, {lo, vel}, {hi, vel}, {lo, vel},
|
||||
{lo, vel}, {hi, vel}, {lo, vel}, {lo, vel},
|
||||
{hi, vel}, {lo, vel}, {lo, vel}, {hi, vel},
|
||||
{lo, vel}, {lo, vel}, {lo, vel}, {lo, vel}};
|
||||
} else {
|
||||
NotePitch rest{restNote, vel};
|
||||
order = {{anchor, vel}, {anchor, vel}, rest, {anchor, vel},
|
||||
{anchor, vel}, rest, {anchor, vel}, {anchor, vel},
|
||||
rest, {anchor, vel}, {anchor, vel}, rest,
|
||||
{anchor, vel}, {anchor, vel}, {anchor, vel}, {anchor, vel}};
|
||||
order = {{lo, vel}, {lo, vel}, rest, {lo, vel},
|
||||
{lo, vel}, rest, {lo, vel}, {lo, vel},
|
||||
rest, {lo, vel}, {lo, vel}, rest,
|
||||
{lo, vel}, {lo, vel}, {lo, vel}, {lo, vel}};
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue