@@ -71,38 +71,3 @@ func ExampleNewSynthdef() {
71
71
// Output:
72
72
// {"name":"SineTone","constants":[440,0],"initialParamValues":[],"paramNames":[],"ugens":[{"name":"SinOsc","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":-1,"outputIndex":0},{"ugenIndex":-1,"outputIndex":1}],"outputs":[2]},{"name":"Out","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":-1,"outputIndex":1},{"ugenIndex":0,"outputIndex":0}],"outputs":[]}],"variants":[]}
73
73
}
74
-
75
- func ExampleNewSynthdefSineTone2 () {
76
- NewSynthdef ("SineTone2" , func (p Params ) Ugen {
77
- bus := C (0 )
78
- freq := C (440 )
79
- phase := SinOsc {Freq : C (0.1 )}.Rate (AR )
80
- out := SinOsc {freq , phase }.Rate (AR ).Mul (C (0.5 ))
81
- return Out {bus , out }.Rate (AR )
82
- }).WriteJSON (os .Stdout )
83
- // Output:
84
- // {"name":"SineTone2","constants":[0.1,0,440,0.5],"initialParamValues":[],"paramNames":[],"ugens":[{"name":"SinOsc","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":-1,"outputIndex":0},{"ugenIndex":-1,"outputIndex":1}],"outputs":[2]},{"name":"SinOsc","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":-1,"outputIndex":2},{"ugenIndex":0,"outputIndex":0}],"outputs":[2]},{"name":"BinaryOpUGen","rate":2,"specialIndex":2,"inputs":[{"ugenIndex":1,"outputIndex":0},{"ugenIndex":-1,"outputIndex":3}],"outputs":[2]},{"name":"Out","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":-1,"outputIndex":1},{"ugenIndex":2,"outputIndex":0}],"outputs":[]}],"variants":[]}
85
- }
86
-
87
- func ExampleNewSynthdefParams () {
88
- NewSynthdef ("SineTone4" , func (p Params ) Ugen {
89
- freq := p .Add ("freq" , 440 )
90
- bus , sine := C (0 ), SinOsc {freq , C (0 )}.Rate (AR )
91
- return Out {bus , sine }.Rate (AR )
92
- }).WriteJSON (os .Stdout )
93
- // Output:
94
- // {"name":"SineTone4","constants":[0],"initialParamValues":[440],"paramNames":[{"name":"freq","index":0}],"ugens":[{"name":"Control","rate":1,"specialIndex":0,"inputs":[],"outputs":[1]},{"name":"SinOsc","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":0,"outputIndex":0},{"ugenIndex":-1,"outputIndex":0}],"outputs":[2]},{"name":"Out","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":-1,"outputIndex":0},{"ugenIndex":1,"outputIndex":0}],"outputs":[]}],"variants":[]}
95
- }
96
-
97
- func ExampleSynthdefParams2 () {
98
- NewSynthdef ("SawTone1" , func (p Params ) Ugen {
99
- freq := p .Add ("freq" , 440 )
100
- cutoff , q := p .Add ("cutoff" , 1200 ), p .Add ("q" , 0.5 )
101
- bus := C (0 )
102
- saw := Saw {freq }.Rate (AR )
103
- out := RLPF {saw , cutoff , q }.Rate (AR )
104
- return Out {bus , out }.Rate (AR )
105
- }).WriteJSON (os .Stdout )
106
- // Output:
107
- // {"name":"SawTone1","constants":[0],"initialParamValues":[440,1200,0.5],"paramNames":[{"name":"freq","index":0},{"name":"cutoff","index":1},{"name":"q","index":2}],"ugens":[{"name":"Control","rate":1,"specialIndex":0,"inputs":[],"outputs":[1,1,1]},{"name":"Saw","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":0,"outputIndex":0}],"outputs":[2]},{"name":"RLPF","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":1,"outputIndex":0},{"ugenIndex":0,"outputIndex":1},{"ugenIndex":0,"outputIndex":2}],"outputs":[2]},{"name":"Out","rate":2,"specialIndex":0,"inputs":[{"ugenIndex":-1,"outputIndex":0},{"ugenIndex":2,"outputIndex":0}],"outputs":[]}],"variants":[]}
108
- }
0 commit comments