Created
June 13, 2019 19:13
-
-
Save scztt/bf1796eebe015640df7bf6c1425d4906 to your computer and use it in GitHub Desktop.
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
+SynthDef { | |
// buildForProxy {} | |
numChannels { | |
^(desc !? (_.numChannels)) | |
} | |
rate { | |
^(desc !? (_.rate)); | |
} | |
} | |
+SynthDesc { | |
prFindProxyOutputs { | |
^outputs.select { | |
|o| | |
o.startingChannel == \out | |
} | |
} | |
numChannels { | |
var channels = nil; | |
this.prFindProxyOutputs.do { | |
|out| | |
channels = max(out.numberOfChannels, channels ?? 1); | |
}; | |
^channels | |
} | |
rate { | |
this.prFindProxyOutputs.do { | |
|out| | |
^out.rate; | |
}; | |
^nil | |
} | |
} | |
+SynthControl { | |
build { | proxy, orderIndex | | |
var rate, desc, numChannels; | |
desc = this.synthDesc; | |
if(desc.notNil) { | |
canFreeSynth = desc.canFreeSynth; | |
canReleaseSynth = desc.hasGate && canFreeSynth; | |
}; | |
if(proxy.isNeutral) { | |
rate = desc.rate; | |
}; | |
numChannels = desc.numChannels; | |
^proxy.initBus(rate, numChannels) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment