mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 20:48:27 +00:00
Merge pull request #938 from tidalcycles/pianoroll-sorting
fix: pianoroll sorting
This commit is contained in:
commit
dd64bf0fc9
@ -160,8 +160,13 @@ export function pianoroll({
|
|||||||
maxMidi = max;
|
maxMidi = max;
|
||||||
valueExtent = maxMidi - minMidi + 1;
|
valueExtent = maxMidi - minMidi + 1;
|
||||||
}
|
}
|
||||||
// foldValues = values.sort((a, b) => a - b);
|
foldValues = values.sort((a, b) =>
|
||||||
foldValues = values.sort((a, b) => String(a).localeCompare(String(b)));
|
typeof a === 'number' && typeof b === 'number'
|
||||||
|
? a - b
|
||||||
|
: typeof a === 'number'
|
||||||
|
? 1
|
||||||
|
: String(a).localeCompare(String(b)),
|
||||||
|
);
|
||||||
barThickness = fold ? valueAxis / foldValues.length : valueAxis / valueExtent;
|
barThickness = fold ? valueAxis / foldValues.length : valueAxis / valueExtent;
|
||||||
ctx.fillStyle = background;
|
ctx.fillStyle = background;
|
||||||
ctx.globalAlpha = 1; // reset!
|
ctx.globalAlpha = 1; // reset!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user