mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-22 19:18:31 +00:00
add aliasbank function
This commit is contained in:
parent
4f6e38f714
commit
e6604491a9
@ -20,6 +20,18 @@ export function registerSound(key, onTrigger, data = {}) {
|
|||||||
soundMap.setKey(key, { onTrigger, data });
|
soundMap.setKey(key, { onTrigger, data });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function aliasBank(alias, bank) {
|
||||||
|
const _soundMap = soundMap.get();
|
||||||
|
const soundsToAdd = {};
|
||||||
|
for (const soundName in _soundMap) {
|
||||||
|
const [soundPrefix, soundSuffix] = soundName.split('_');
|
||||||
|
if (soundPrefix == bank) {
|
||||||
|
soundsToAdd[`${alias}_${soundSuffix}`] = _soundMap[soundName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
soundMap.set(soundsToAdd);
|
||||||
|
}
|
||||||
|
|
||||||
export function getSound(s) {
|
export function getSound(s) {
|
||||||
return soundMap.get()[s];
|
return soundMap.get()[s];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user