mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 05:38:34 +00:00
note default to 36
This commit is contained in:
parent
7ef3d33d0e
commit
4d60a582fe
@ -100,12 +100,8 @@ const getSoundfontKey = (s) => {
|
||||
|
||||
const getSampleBufferSource = async (s, n, note, speed) => {
|
||||
let transpose = 0;
|
||||
let midi;
|
||||
|
||||
if (note !== undefined) {
|
||||
midi = typeof note === 'string' ? toMidi(note) : note;
|
||||
transpose = midi - 36; // C3 is middle C
|
||||
}
|
||||
let midi = typeof note === 'string' ? toMidi(note) : note || 36;
|
||||
transpose = midi - 36; // C3 is middle C
|
||||
|
||||
const ac = getAudioContext();
|
||||
// is sample from loaded samples(..)
|
||||
@ -128,9 +124,6 @@ const getSampleBufferSource = async (s, n, note, speed) => {
|
||||
if (Array.isArray(bank)) {
|
||||
sampleUrl = bank[n % bank.length];
|
||||
} else {
|
||||
if (!note) {
|
||||
throw new Error('no note(...) set for sound', s);
|
||||
}
|
||||
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