Skip to content

Commit

Permalink
Merge pull request #3797 from telephon/topic/fix/EnvGate-01
Browse files Browse the repository at this point in the history
Fix EnvGate issues
  • Loading branch information
Alberto de Campo committed Jul 22, 2018
2 parents 9cbabb8 + 45ef92e commit 96db62c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 2 additions & 3 deletions SCClassLibrary/Common/Control/GraphBuilder.sc
Expand Up @@ -40,10 +40,9 @@ EnvGate {
*new { arg i_level=1, gate, fadeTime, doneAction=2, curve='sin';
var synthGate = gate ?? { NamedControl.kr(\gate, 1.0) };
var synthFadeTime = fadeTime ?? { NamedControl.kr(\fadeTime, 0.02) };
var startVal = (synthFadeTime <= 0);
^EnvGen.kr(
Env.new([ startVal, 1.0, 0.0], #[1.0, 1.0], curve, 1),
synthGate, i_level, 0.0, synthFadeTime, doneAction
Env.new([ i_level, 1.0, 0.0], #[1.0, 1.0], curve, 1),
synthGate, 1.0, 0.0, synthFadeTime, doneAction
)
}

Expand Down
11 changes: 11 additions & 0 deletions testsuite/classlibrary/TestEnvGate.sc
@@ -0,0 +1,11 @@

TestEnvGate : UnitTest {

test_number_as_fadeTime {
this.assertNoException({
{ EnvGate(fadeTime:1) }.asSynthDef
}, "number should be a valid EnvGate fadeTime")
}

}

0 comments on commit 96db62c

Please sign in to comment.