mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-14 15:18:30 +00:00
hotfix: regression of #196
- samples loaded as arrays would not be repitched
This commit is contained in:
parent
88e1211762
commit
a5f05b4715
@ -70,6 +70,13 @@ const getSoundfontKey = (s) => {
|
||||
|
||||
const getSampleBufferSource = async (s, n, note) => {
|
||||
let transpose = 0;
|
||||
let midi;
|
||||
|
||||
if (note !== undefined) {
|
||||
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();
|
||||
@ -90,8 +97,6 @@ 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