-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #550 from tidalcycles/fix-soundfont-loading
fix: load soundfonts in prebake
- Loading branch information
Showing
4 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,5 +153,3 @@ export function registerSoundfonts() { | |
); | ||
}); | ||
} | ||
|
||
registerSoundfonts(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Pattern, noteToMidi, valueToMidi } from '@strudel.cycles/core'; | ||
|
||
const maxPan = noteToMidi('C8'); | ||
const panwidth = (pan, width) => pan * width + (1 - width) / 2; | ||
|
||
Pattern.prototype.piano = function () { | ||
return this.clip(1) | ||
.s('piano') | ||
.release(0.1) | ||
.fmap((value) => { | ||
const midi = valueToMidi(value); | ||
// pan by pitch | ||
const pan = panwidth(Math.min(Math.round(midi) / maxPan, 1), 0.5); | ||
return { ...value, pan: (value.pan || 1) * pan }; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters