mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-21 02:28:34 +00:00
fix some tests
This commit is contained in:
parent
caa207e868
commit
719dcbcd4d
@ -8,9 +8,10 @@ import { stack, register } from '@strudel.cycles/core';
|
|||||||
import _voicings from 'chord-voicings';
|
import _voicings from 'chord-voicings';
|
||||||
const { dictionaryVoicing, minTopNoteDiff, lefthand } = _voicings.default || _voicings; // parcel module resolution fuckup
|
const { dictionaryVoicing, minTopNoteDiff, lefthand } = _voicings.default || _voicings; // parcel module resolution fuckup
|
||||||
|
|
||||||
export const voicingDictionaries = {
|
export const voicingRegistry = {
|
||||||
lefthand: { dictionary: lefthand, range: ['F3', 'A4'] },
|
lefthand: { dictionary: lefthand, range: ['F3', 'A4'] },
|
||||||
};
|
};
|
||||||
|
export const setVoicingRange = (name, range) => addVoicings(name, voicingRegistry[name].dictionary, range);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a new custom voicing dictionary.
|
* Adds a new custom voicing dictionary.
|
||||||
@ -34,11 +35,11 @@ export const voicingDictionaries = {
|
|||||||
* "<C^7 A7 Dm7 G7>".voicings('cookie').note()
|
* "<C^7 A7 Dm7 G7>".voicings('cookie').note()
|
||||||
*/
|
*/
|
||||||
export const addVoicings = (name, dictionary, range = ['F3', 'A4']) => {
|
export const addVoicings = (name, dictionary, range = ['F3', 'A4']) => {
|
||||||
Object.assign(voicingDictionaries, { [name]: { dictionary, range } });
|
Object.assign(voicingRegistry, { [name]: { dictionary, range } });
|
||||||
};
|
};
|
||||||
|
|
||||||
const getVoicing = (chord, dictionaryName, lastVoicing) => {
|
const getVoicing = (chord, dictionaryName, lastVoicing) => {
|
||||||
const { dictionary, range } = voicingDictionaries[dictionaryName];
|
const { dictionary, range } = voicingRegistry[dictionaryName];
|
||||||
return dictionaryVoicing({
|
return dictionaryVoicing({
|
||||||
chord,
|
chord,
|
||||||
dictionary,
|
dictionary,
|
||||||
|
|||||||
@ -153,6 +153,9 @@ const audioCtx = {
|
|||||||
const getDrawContext = () => canvasCtx;
|
const getDrawContext = () => canvasCtx;
|
||||||
const getAudioContext = () => audioCtx;
|
const getAudioContext = () => audioCtx;
|
||||||
const loadSoundfont = () => {};
|
const loadSoundfont = () => {};
|
||||||
|
const loadCsound = () => {};
|
||||||
|
const loadCSound = () => {};
|
||||||
|
const loadcsound = () => {};
|
||||||
|
|
||||||
// TODO: refactor to evalScope
|
// TODO: refactor to evalScope
|
||||||
evalScope(
|
evalScope(
|
||||||
@ -178,6 +181,9 @@ evalScope(
|
|||||||
getDrawContext,
|
getDrawContext,
|
||||||
getAudioContext,
|
getAudioContext,
|
||||||
loadSoundfont,
|
loadSoundfont,
|
||||||
|
loadCSound,
|
||||||
|
loadCsound,
|
||||||
|
loadcsound,
|
||||||
Clock: {}, // whatever
|
Clock: {}, // whatever
|
||||||
// Tone,
|
// Tone,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -67,6 +67,8 @@ stack(
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const giantSteps = `// John Coltrane - Giant Steps
|
export const giantSteps = `// John Coltrane - Giant Steps
|
||||||
|
setVoicingRange('lefthand', ['E3', 'G4']);
|
||||||
|
|
||||||
stack(
|
stack(
|
||||||
// melody
|
// melody
|
||||||
seq(
|
seq(
|
||||||
@ -90,7 +92,6 @@ stack(
|
|||||||
"[B2 F#2] [F2 Bb2] [Eb2 Bb3] [C#2 F#2]"
|
"[B2 F#2] [F2 Bb2] [Eb2 Bb3] [C#2 F#2]"
|
||||||
)
|
)
|
||||||
).slow(20).note()`;
|
).slow(20).note()`;
|
||||||
// range: ['E3', 'G4']
|
|
||||||
|
|
||||||
export const zeldasRescue = `// Koji Kondo - Princess Zelda's Rescue
|
export const zeldasRescue = `// Koji Kondo - Princess Zelda's Rescue
|
||||||
stack(
|
stack(
|
||||||
@ -651,6 +652,7 @@ export const dinofunk = `// licensed with CC BY-NC-SA 4.0 https://creativecommon
|
|||||||
// by Felix Roos
|
// by Felix Roos
|
||||||
samples({bass:'https://cdn.freesound.org/previews/614/614637_2434927-hq.mp3',
|
samples({bass:'https://cdn.freesound.org/previews/614/614637_2434927-hq.mp3',
|
||||||
dino:{b4:'https://cdn.freesound.org/previews/316/316403_5123851-hq.mp3'}})
|
dino:{b4:'https://cdn.freesound.org/previews/316/316403_5123851-hq.mp3'}})
|
||||||
|
setVoicingRange('lefthand', ['c3','a4'])
|
||||||
|
|
||||||
stack(
|
stack(
|
||||||
s('bass').loopAt(8).clip(1),
|
s('bass').loopAt(8).clip(1),
|
||||||
@ -666,7 +668,6 @@ note("Abm7".voicings('lefthand').struct("x(3,8,1)".slow(2))),
|
|||||||
.degradeBy(.4).room(1),
|
.degradeBy(.4).room(1),
|
||||||
note("<b4 eb4>").s('dino').delay(.8).slow(8).room(.5)
|
note("<b4 eb4>").s('dino').delay(.8).slow(8).room(.5)
|
||||||
)`;
|
)`;
|
||||||
// ['c3','a4']
|
|
||||||
|
|
||||||
export const sampleDemo = `// licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
|
export const sampleDemo = `// licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
// by Felix Roos
|
// by Felix Roos
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user