Skip to content

Commit

Permalink
dirt-synths: alwaysRun flag for global effects
Browse files Browse the repository at this point in the history
  • Loading branch information
telephon committed Mar 7, 2018
1 parent fd10d7a commit 7b5d700
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions classes/DirtOrbit.sc
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ DirtOrbit {

initDefaultGlobalEffects {
this.globalEffects = [
// all global effects sleep when the input is quiet for long enough and no parameters are set.
GlobalDirtEffect(\dirt_delay, [\delaytime, \delayfeedback, \delaySend, \delayAmp, \lock, \cps]),
GlobalDirtEffect(\dirt_reverb, [\size, \room, \dry]),
GlobalDirtEffect(\dirt_leslie, [\leslie, \lrate, \lsize]),
GlobalDirtEffect(\dirt_rms, [\dirtOut, \rmsReplyRate, \rmsPeakLag]),
GlobalDirtEffect(\dirt_monitor, [\dirtOut]),
GlobalDirtEffect(\dirt_rms, [\rmsReplyRate, \rmsPeakLag]).alwaysRun_(true),
GlobalDirtEffect(\dirt_monitor).alwaysRun_(true),

]
}

Expand All @@ -82,7 +84,9 @@ DirtOrbit {
initNodeTree {
server.makeBundle(nil, { // make sure they are in order
server.sendMsg("/g_new", group, 0, 1); // make sure group exists
globalEffects.reverseDo { |x| x.play(group, outBus, dryBus, globalEffectBus, orbitIndex) };
globalEffects.reverseDo { |x|
x.play(group, outBus, dryBus, globalEffectBus, orbitIndex)
}
})
}

Expand Down
3 changes: 2 additions & 1 deletion classes/GlobalDirtEffect.sc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sends only OSC when an update is necessary
GlobalDirtEffect {

var <>name, <>paramNames, <>numChannels, <state;
var <>alwaysRun = false;
var synth, defName;

*new { |name, paramNames, numChannels|
Expand All @@ -39,7 +40,7 @@ GlobalDirtEffect {
}

set { |event|
var argsChanged, someArgsNotNil = false;
var argsChanged, someArgsNotNil = alwaysRun;
paramNames.do { |key|
var value = event[key];
value !? { someArgsNotNil = true };
Expand Down

0 comments on commit 7b5d700

Please sign in to comment.