/*************************************************************************************/ /* Ethan White and Beth Maletz, Assignment 3/ /*************************************************************************************/ /*"Wanker" is the result of the beginning efforts at learning SuperCollider. After stumbling upon the "COsc" UGen, we played around with it, threw in a "Spawn" and this is what we have. We chose the COsc UGen because it exhibited potential for expansion and a depth of manipulation. "Spawn" was a necessary addition to enable continuing production of sounds, controllable by sliders. */ /* "Wanker's" controllable frequency range is 20 - 400 Hz. The top slider controls this frequency range, chosen because of its easy detection by human ears and also because it is not an obnoxious high frequency. The second slider controls beats, which is the frequency of the occurrence of the frequency chosen with the first slider. These two sliders and their respective values are the key arguments for the COsc UGen. They produce the final chorused value in an addition of two signals, ie. [(freq + (beats/2)) + (freq - (beats/2))]. The third slider functions as a loudness control, varying the magnitude of "mul" in the COsc UGen. "Spawn" randomly reproduces different examples of the chosen unit generator, in this case COsc. In this patch, there is only one output channel. The time between subsequent events is one second, an interval that enables a listener to distinguish the changes. Signals are chorused indefinitely, eventually exceeding the threshold of human frequency detection (at which time the user should stop the program), due to the "nil" value of MaxRepeats.*/ /*************************************************************************************/ ( var w, s1, n1, s2, n2, s3, n3, b, amp = 0.01; //identifies variables w = GUIWindow.new("Wanker", Rect.newBy ( 540, 375, 300, 225 )); //GUI window controls frequency chorused, beats (frequency of the frequency), //and the multiplier, which functions as a loudness control here s1 = SliderView.new( w, Rect.newBy (25, 25, 250, 45 ), "SliderView", 200, 20, 400, 2, 'linear'); n1 = NumericalView.new( w, Rect.newBy (125, 75, 25, 10 ), "NumericalView", 200, 20, 400, 2, 'linear'); //frequency slider s1.action = { n1.value = s1.value }; n1.action = { s1.value = n1.value }; s2 = SliderView.new( w, Rect.newBy (25, 90, 250, 45 ), "SliderView", 0.01, 0.01, 5, 0.01, 'linear'); n2 = NumericalView.new( w, Rect.newBy (125, 140, 35, 10 ), "NumericalView", 0.01, 0.01, 5, 0.01, 'linear'); //beats slider s2.action = { n2.value = s2.value }; n2.action = { s2.value = n2.value }; s3 = SliderView.new( w, Rect.newBy (25, 155, 250, 45 ), "SliderView", 2, 0.01, 5.000, 0.01, 'linear'); n3 = NumericalView.new( w, Rect.newBy (125, 205, 45, 10 ), "NumericalView", 2, 0.01, 5.000, 0.01, 'linear'); //multiplier slider s3.action = { n3.value = s3.value }; n3.action = { s3.value = n3.value }; t = Signal.newClear(512).sineFill(1.0/[1,2,3,4,5,6]).normalize.asWavetable; //define table for COsc UGen { Spawn.ar({ COsc.ar(t, ControlIn.kr (n1), ControlIn.kr (n2), ControlIn.kr (n3), amp) }, 1, 1, nil ) }.scope; //adds two signals: [freq + beats/2] + [freq - beats/2] w.close; //closes GUI window when user closes program )