doc: midisounds

This commit is contained in:
Felix Roos 2025-02-03 22:56:51 +01:00
parent 88fb0b3b75
commit 848edb1f69
No known key found for this signature in database
3 changed files with 16 additions and 1 deletions

View File

@ -164,7 +164,17 @@ export async function midimaps(map) {
// registry for midi sounds, converting sound names to controls
export const midisoundMap = new Map();
// adds multiple midimaps to the registry
/**
* Maps a sound name to a set of controls:
* @example
* midisounds({ bd: { note: 'c2' } })
* $: s("bd").midi()
* @example
* // notes can be set directly to simplify typical midi drum kit mappings
* midisounds({ bd: 'c2', rim: 'c#2' })
* $: s("bd rim").midi()
**/
export async function midisounds(map) {
if (typeof map === 'object') {
Object.entries(map).forEach(([name, mapping]) => midisoundMap.set(name, mapping));

View File

@ -20,6 +20,7 @@ const skippedExamples = [
'accelerationX',
'defaultmidimap',
'midimaps',
'midisounds',
];
describe('runs examples', () => {

View File

@ -56,6 +56,10 @@ Instead of setting `ccn` and `ccv` directly, you can also create mappings with `
<JsDoc client:idle name="defaultmidimap" h={0} />
## midisounds
<JsDoc client:idle name="midisounds" h={0} />
# OSC/SuperDirt/StrudelDirt
In TidalCycles, sound is usually generated using [SuperDirt](https://github.com/musikinformatik/SuperDirt/), which runs inside SuperCollider. Strudel also supports using SuperDirt, although it requires installing some additional software.