Skip to content

Instantly share code, notes, and snippets.

@charlieroberts
Created September 20, 2024 15:25
Show Gist options
  • Save charlieroberts/157e66bea85ac40d6c8733af0c99d94f to your computer and use it in GitHub Desktop.
Save charlieroberts/157e66bea85ac40d6c8733af0c99d94f to your computer and use it in GitHub Desktop.
ConductorM = {
add( ...agents ) {
ConductorM.agents.push( ...agents )
},
agents:[],
articulation( v ) {
},
brightness( v ) {
for( let a of ConductorM.agents ) {
switch( a.name ) {
case 'Kick': a.tone = v.map(a.tone.value); break;
case 'Snare': a.snappy = v.map(a.snappy.value); break;
case 'Clap': a.cutoff = v.map(a.cutoff.value); a.Q = v.map(a.cutoff.value); break;
case 'Clave': a.frequency = v.map(a.frequency.value,200); break;
default: a.cutoff = v.map(a.cutoff.value); break;
}
}
},
quantize( v ) {
if( ConductorM.quantize.fx === undefined ) {
ConductorM.quantize.fx = BitCrusher({ sampleRate: v, bitDepth:v })
Out.fx.add( ConductorM.quantize.fx )
}else{
ConductorM.quantize.fx.sampleRate = v
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment