aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-06-30 12:59:39 +0200
committerDavid Runge <dave@sleepmap.de>2016-06-30 12:59:39 +0200
commit63955c90f2c16dffb3e59d9d3e37b58387154cbf (patch)
tree5a5436b7e7c27529f6f4332223aa4681647a2ccc
parent891612475a0e10a82f2cd0007852577c97f38e90 (diff)
downloadbowelyzer-63955c90f2c16dffb3e59d9d3e37b58387154cbf.tar.gz
bowelyzer-63955c90f2c16dffb3e59d9d3e37b58387154cbf.tar.bz2
bowelyzer-63955c90f2c16dffb3e59d9d3e37b58387154cbf.tar.xz
bowelyzer-63955c90f2c16dffb3e59d9d3e37b58387154cbf.zip
BowelyzerAnalyzer.sc: Extending startSynthWithNameAndControls by conditional on \active state of the input and thus whether to start it normally or paused.
-rw-r--r--BowelyzerAnalyzer.sc75
1 files changed, 52 insertions, 23 deletions
diff --git a/BowelyzerAnalyzer.sc b/BowelyzerAnalyzer.sc
index f6ad54e..39728bd 100644
--- a/BowelyzerAnalyzer.sc
+++ b/BowelyzerAnalyzer.sc
@@ -118,32 +118,61 @@ BowelyzerAnalyzer{
});
}
+ // add and start the Synth with name, controls and input channel
startSynthWithNameAndControls{
arg name, controls, input;
- synths.add(name -> Synth(
- name,
- [
- inputChannel: input,
- sendReplyFreq: controls.at(\sendReplyFreq),
- amplitudeAttackTime: controls.at(\amplitudeAttackTime),
- amplitudeReleaseTime: controls.at(\amplitudeReleaseTime),
- hfHainsworth: controls.at(\hfhainsworth),
- hfFoote: controls.at(\hfFoote),
- hfThreshold: controls.at(\hfThreshold),
- hfWaitTime: controls.at(\hfWaitTime),
- pitchInitFreq: controls.at(\pitchInitFreq),
- pitchMinFreq: controls.at(\pitchMinFreq),
- pitchMaxFreq: controls.at(\pitchMaxFreq),
- pitchExecFreq: controls.at(\pitchExecFreq),
- pitchMaxBinsPerOctave: controls.at(\pitchMaxBinsPerOctave),
- pitchMedian: controls.at(\pitchMedian),
- pitchAmpThreshold: controls.at(\pitchAmpThreshold),
- pitchPeakThreshold: controls.at(\pitchPeakThreshold),
- pitchDownSample: controls.at(\pitchDownSample)
- ],
- analyzerGroup
+ // if the input is set to active, start right away, else pause
+ if(controls.at(\active),{
+ synths.add(name -> Synth.new(
+ name,
+ [
+ inputChannel: input,
+ sendReplyFreq: controls.at(\sendReplyFreq),
+ amplitudeAttackTime: controls.at(\amplitudeAttackTime),
+ amplitudeReleaseTime: controls.at(\amplitudeReleaseTime),
+ hfHainsworth: controls.at(\hfhainsworth),
+ hfFoote: controls.at(\hfFoote),
+ hfThreshold: controls.at(\hfThreshold),
+ hfWaitTime: controls.at(\hfWaitTime),
+ pitchInitFreq: controls.at(\pitchInitFreq),
+ pitchMinFreq: controls.at(\pitchMinFreq),
+ pitchMaxFreq: controls.at(\pitchMaxFreq),
+ pitchExecFreq: controls.at(\pitchExecFreq),
+ pitchMaxBinsPerOctave: controls.at(\pitchMaxBinsPerOctave),
+ pitchMedian: controls.at(\pitchMedian),
+ pitchAmpThreshold: controls.at(\pitchAmpThreshold),
+ pitchPeakThreshold: controls.at(\pitchPeakThreshold),
+ pitchDownSample: controls.at(\pitchDownSample)
+ ],
+ analyzerGroup
+ ).register;
+ );
+ },{
+ synths.add(name -> Synth.newPaused(
+ name,
+ [
+ inputChannel: input,
+ sendReplyFreq: controls.at(\sendReplyFreq),
+ amplitudeAttackTime: controls.at(\amplitudeAttackTime),
+ amplitudeReleaseTime: controls.at(\amplitudeReleaseTime),
+ hfHainsworth: controls.at(\hfhainsworth),
+ hfFoote: controls.at(\hfFoote),
+ hfThreshold: controls.at(\hfThreshold),
+ hfWaitTime: controls.at(\hfWaitTime),
+ pitchInitFreq: controls.at(\pitchInitFreq),
+ pitchMinFreq: controls.at(\pitchMinFreq),
+ pitchMaxFreq: controls.at(\pitchMaxFreq),
+ pitchExecFreq: controls.at(\pitchExecFreq),
+ pitchMaxBinsPerOctave: controls.at(\pitchMaxBinsPerOctave),
+ pitchMedian: controls.at(\pitchMedian),
+ pitchAmpThreshold: controls.at(\pitchAmpThreshold),
+ pitchPeakThreshold: controls.at(\pitchPeakThreshold),
+ pitchDownSample: controls.at(\pitchDownSample)
+ ],
+ analyzerGroup
+ ).register;
);
- );
+ });
}
// set a synth control by provoding its name, its control name and control value