Merge pull request #183 from tidalcycles/soundfont-file-support

Soundfont file support
This commit is contained in:
Felix Roos 2022-08-14 16:04:14 +02:00 committed by GitHub
commit f2b2f4f226
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 6 deletions

View file

@ -50,6 +50,9 @@ export const mod = (n, m) => ((n % m) + m) % m;
export const getPlayableNoteValue = (hap) => {
let { value: note, context } = hap;
if (typeof note === 'object' && !Array.isArray(note)) {
note = note.note || note.n || note.value;
}
// if value is number => interpret as midi number as long as its not marked as frequency
if (typeof note === 'number' && context.type !== 'frequency') {
note = fromMidi(hap.value);