comment
This commit is contained in:
parent
70d6f3000a
commit
9438c69bed
1 changed files with 1 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ export const note2midi = (note) => {
|
||||||
return pc2chroma(pc) + oct * 12 + 12;
|
return pc2chroma(pc) + oct * 12 + 12;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// duplicate: util.mjs (does not support sharp flag)
|
||||||
export const midi2note = (midi, sharp = false) => {
|
export const midi2note = (midi, sharp = false) => {
|
||||||
const oct = Math.floor(midi / 12) - 1;
|
const oct = Math.floor(midi / 12) - 1;
|
||||||
const pc = (sharp ? sharps : flats)[midi % 12];
|
const pc = (sharp ? sharps : flats)[midi % 12];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue