- feat: add freq support to gm soundfonts
- refactor: toMidi -> noteToMidi - refactor: fromMidi -> midiToFreq
This commit is contained in:
parent
13133583ca
commit
ba35a81e9b
10 changed files with 59 additions and 50 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { logger, toMidi, valueToMidi } from '@strudel.cycles/core';
|
||||
import { logger, noteToMidi, valueToMidi } from '@strudel.cycles/core';
|
||||
import { getAudioContext, registerSound } from './index.mjs';
|
||||
import { getEnvelope } from './helpers.mjs';
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ export const getSampleBufferSource = async (s, n, note, speed, freq, bank) => {
|
|||
if (Array.isArray(bank)) {
|
||||
sampleUrl = bank[n % bank.length];
|
||||
} else {
|
||||
const midiDiff = (noteA) => toMidi(noteA) - midi;
|
||||
const midiDiff = (noteA) => noteToMidi(noteA) - midi;
|
||||
// object format will expect keys as notes
|
||||
const closest = Object.keys(bank)
|
||||
.filter((k) => !k.startsWith('_'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue