Permalink
Browse files

Directly error on init if the SynthDef doesn't exist or has no 'gate'…

… arg

Signed-off-by: Stefan Nussbaumer <st9fan@gmail.com>
  • Loading branch information...
nuss committed Aug 8, 2018
1 parent c40cac9 commit b6cdd088d0afabc88541ac63c0cdbae8d78ffc35
Showing with 12 additions and 13 deletions.
  1. +12 −13 CVCenter/CVCenterKeyboard.sc
@@ -11,6 +11,18 @@ CVCenterKeyboard {
init {
synthDefName = synthDefName.asSymbol;
SynthDescLib.at(synthDefName) ?? {
Error(
"The SynthDef '%' does not exist".format(synthDefName)
).throw;
};
if (SynthDescLib.at(synthDefName).hasGate.not) {
Error(
"The given SynthDef does not provide a 'gate' argument and can not be used."
).throw;
};
all ?? {
all = ();
};
@@ -44,19 +56,6 @@ CVCenterKeyboard {
tab ?? { tab = synthDefName };
server ?? { server = Server.default };
SynthDescLib.at(synthDefName) ?? {
Error(
"The synthDefName '%' does not exist".format(synthDefName)
).throw;
};
if (SynthDescLib.at(synthDefName).hasGate.not) {
Error(
"The given SynthDef does not provide a 'gate' argument and can not be used."
).throw;
};
server.waitForBoot {
// SynthDef *should* have an \amp arg, otherwise it will sound for moment
testSynth = Synth(synthDefName);

0 comments on commit b6cdd08

Please sign in to comment.