Last active
November 13, 2015 04:22
-
-
Save colinbdclark/b9a50fdabd04ba0f888e to your computer and use it in GitHub Desktop.
Early sketch of electric piano synth for FLOE Chart Authoring sonification tool
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
fluid.defaults("floe.chartAuthoring.electricPianoBand", { | |
gradeNames: ["flock.band"], | |
components: { | |
midiNoteSynth: { | |
type: "floe.chartAuthoring.midiNoteSynth" | |
}, | |
pianoEnvelopeSynth: { | |
type: "floe.chartAuthoring.pianoEnvelopeSynth" | |
}, | |
carrierSynth: { | |
type: "floe.chartAuthoring.carrierSynth" | |
} | |
} | |
}); | |
fluid.defaults("flock.interconnectOutputSynth", { | |
gradeNames: ["flock.modelSynth"], | |
outputBus: "@expand:{flock.enviro}.busManager.acquireNextBus(interconnect)", | |
synthDef: { | |
ugen: "flock.ugen.out", | |
bus: "{that}.options.outputBus", | |
expand: 1, | |
sources: "{that}.options.ugenDef" | |
} | |
}); | |
fluid.defaults("floe.chartAuthoring.midiNoteSynth", { | |
gradeNames: ["flock.interconnectOutputSynth"], | |
ugenDef: { | |
id: "freq", | |
ugen: "flock.ugen.midiFreq", | |
rate: "control", | |
note: { | |
id: "noteSequencer", | |
ugen: "flock.ugen.sequencer" | |
} | |
}, | |
model: { | |
inputs: { | |
noteSequencer: { | |
durations: [3/8, 3/8, 1/8, 1/8], | |
values: [91, 91, 89, 89] | |
} | |
} | |
}, | |
addToEnvironment: "head" | |
}); | |
fluid.defaults("floe.chartAuthoring.carrierSynth", { | |
gradeNames: ["flock.modelSynth"], | |
ugenDef: { | |
ugen: "flock.ugen.sinOsc", | |
phase: 0.0, | |
freq: { | |
ugen: "flock.ugen.in", | |
bus: "{midiNoteSynth}.options.outputBus" | |
}, | |
mul: { | |
ugen: "flock.ugen.in", | |
bus: "{pianoEnvelopeSynth}.options.outputBus" | |
} | |
}, | |
phases: [0.0, 0.5, 0.25], | |
synthDef: { | |
ugen: "flock.ugen.sum", | |
sources: { | |
expander: { | |
funcName: "floe.chartAuthoring.carrierSynth.additiveExpander", | |
args: ["{that}.options.phases", "{that}.options.ugenDef"] | |
} | |
} | |
} | |
}); | |
floe.chartAuthoring.carrierSynth.additiveExpander = function (phases, ugenDef) { | |
return fluid.transform(phases, function (phaseValue, i) { | |
var voiceDef = fluid.copy(ugenDef); | |
voiceDef.phase = phaseValue; | |
return voiceDef; | |
}); | |
}; | |
fluid.defaults("floe.chartAuthoring.pianoEnvelopeSynth", { | |
gradeNames: ["flock.interconnectOutputSynth"], | |
ugenDef: { | |
ugen: "flock.ugen.envGen", | |
envelope: { | |
levels: [0, 1, 0], | |
times: [0.01, 0.05], | |
curves: ["linear", -5], | |
sustainPoint: 1 | |
}, | |
gate: { | |
id: "envelopeSequencer", | |
ugen: "flock.ugen.sequencer" | |
}, | |
mul: 0.05 | |
}, | |
model: { | |
inputs: { | |
envelopeSequencer: { | |
durations: [1/8, 1/4, 1/8, 1/4, 1/24, 1/12, 1/24, 1/12], | |
values: [1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0] | |
} | |
} | |
}, | |
addToEnviroment: "head" | |
}); | |
floe.chartAuthoring.electricPianoBand(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment