mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-12 22:28:37 +00:00
pull in midi logic
This commit is contained in:
parent
42922a0d75
commit
59e1664223
@ -70,8 +70,6 @@ const getSoundfontKey = (s) => {
|
||||
|
||||
const getSampleBufferSource = async (s, n, note) => {
|
||||
let transpose = 0;
|
||||
const midi = typeof note === 'string' ? toMidi(note) : note;
|
||||
transpose = midi - 36; // C3 is middle C
|
||||
const ac = getAudioContext();
|
||||
// is sample from loaded samples(..)
|
||||
const samples = getLoadedSamples();
|
||||
@ -92,6 +90,8 @@ const getSampleBufferSource = async (s, n, note) => {
|
||||
if (!note) {
|
||||
throw new Error('no note(...) set for sound', s);
|
||||
}
|
||||
const midi = typeof note === 'string' ? toMidi(note) : note;
|
||||
transpose = midi - 36; // C3 is middle C
|
||||
const midiDiff = (noteA) => toMidi(noteA) - midi;
|
||||
// object format will expect keys as notes
|
||||
const closest = Object.keys(bank)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user