/****************************************** /* Ryota Ogura Assignment 3 */ /****************************************** /*The idea for this patch is derived from several different ethnic musics including Nordic, Hindu, and Buddhist musics where one base not is played or sung while another person either sings or plays a harmonious melody above it. At the beginning I wanted to designate the frequencies on the Improv Frequency Changer so that it only played certain tones and pitches that sounded ethnic and cool, like the gamelan example you have on the web, but soon proved to be too difficult and I don't think we are allowed to use or learned for that matter the material necessary for that. Therefore I have made it into one simple slider which is supposed to be the main play thingy but the pitch is more wild and excentric than i really wanted. So voila "Air above Dirt." Other than the fact that I really did not reach my goal in this project, there seems to be a problem within the gui window. Although the patch works fine, whenever I stop running it, an error sign comes up and I cannot find the origin of this. Anyway In this patch, I use 3 main variables; w=the gui window variable freqslider=the slider in the gui that I use as the improvisational tool. ampslider=the slider that adjusts the volume of the melody. */ ( var w, freqslider, number, ampslider; //the different variables w = GUIWindow.new("panel", Rect.newBy( 202, 105, 183, 210 )); //the absolute numbers on where the window will show up on the screen StringView.new( w, Rect.newBy( 21, 12, 153, 20 ), "Improv Frequency Changer"); //the actual words which show up above the first slider freqslider = SliderView.new( w, Rect.newBy( 27, 73, 139, 38 ), "SliderView", 440, 60, 1000, 20, 'linear'); //the frequency slider number = NumericalView.new( w, Rect.newBy( 38, 35, 112, 22 ), "NumericalView", 440, 60, 1000, 20, 'linear'); //the numerical value of the frequency shows up on the gui window StringView.new( w, Rect.newBy( 32, 125, 128, 20 ), "Melody Volume"); //the actual words which show up above the second slider ampslider = SliderView.new( w, Rect.newBy( 38, 159, 113, 19 ), "SliderView", 1.0, 0.2, 5, 0.1, 'linear'); //the volume slider freqslider.action = {number.value = freqslider.value}; number.action = {freqslider.value = number.action}; //I have the frequncy slider and the numerical value set up so they are //1 to 1 linear functions; if the frequency is raised, the corresponding number is raised //If the number is raised, the frequency is raised. //the play function { var n = 0.5; var amp = 1.0; s = SinOsc.ar(440, 0, amp); //this is the sine oscillator funtion used to 'make' the base note p = Pan2.ar( //this is the 2 channel panning function. SinOsc.ar( //this is the sine oscillator that creates the sound ControlIn.kr(freqslider), //this is the function used so that one can control the frequency with the gui 0, // phase of the sign oscillator ControlIn.kr(ampslider)), // this is the function used so that one can control the amplitude/volume with the gui 0, // position of the pan. Right now it is in balanced equilibrium LFNoise2.kr(0.4 + 0.8.rand, 0.4, 0.5)) ; //this is part of the panning function which controls rate level input //so the patch isn't too harsh, here we are halving the output signal of the clipped funtion s + p }.scope; w.close; //this is the command used to show the graph )