chore: format

This commit is contained in:
sup39 2024-01-11 02:41:58 +09:00
parent 165fb6134c
commit 94646d36fc
Signed by: sup39
GPG key ID: 111C00916C1641E5
2 changed files with 82 additions and 96 deletions

View file

@ -99,7 +99,7 @@ function noteOn(pitch, velocity) {
}
}
function noteOff(pitch, velocity) {
function noteOff(pitch, _velocity) {
isKeyOn[pitch] = 0;
}
@ -125,7 +125,6 @@ function controllerChange(number, value) {
if (number == 67) {
cc67now = value;
}
}

View file

@ -6,7 +6,6 @@ function setup() {
smooth(2);
frameRate(60);
initKeys();
}
function draw() {
@ -14,9 +13,6 @@ function draw() {
pushHistories();
drawWhiteKeys();
drawBlackKeys();
// drawPedalLines();
// drawNotes();
drawTexts();
}
@ -93,12 +89,6 @@ function drawBlackKeys() {
if (isBlack[i % 12] > 0) {
// it's a black key
if (velocityMode) {
// let m = max(isKeyOn[i], isPedaled[i]) * .9 + .1;
// if ((isKeyOn[i] || isPedaled[i]) && !rainbowMode) {
// let darkenedColor = keyOnColor.levels.map(x => floor(x * m));
// fill(`rgb(${darkenedColor[0]}, ${darkenedColor[1]}, ${darkenedColor[2]})`); // keypressed
// } else if ((isKeyOn[i] || isPedaled[i]) && rainbowMode) {
// fill(map(i, 21, 108, 0, 1080) % 360, 100, 100 * m, 100); // rainbowMode
let m = max(isKeyOn[i], isPedaled[i]) * .9 + .1;
if ((isKeyOn[i] || isPedaled[i]) && !rainbowMode) {
let whitenedColor = keyOnColor.levels.map(x => floor(x * m + 255 * (1 - m)));
@ -179,8 +169,6 @@ function pushHistories() {
notesThisFrame = 0;
legatoHistory.push(isKeyOn.reduce((accumulator, currentValue) => accumulator + !!currentValue, 0));
legatoHistory.shift();
}
function convertNumberToBars(number) {
@ -236,7 +224,6 @@ function getPressedKeys(returnString = true) {
} else {
return pressedKeys;
}
}
function truncateString(str, maxLength = 40) {