//_____________________elevator music editor ( var w, prompt, set, sendknopf,info, min, max; var hostname; var trig, scale, test, scalefill; // initialize the sending machine hostname = "134.100.176.31"; //hostname = "127.0.0.1"; // set this to the address of the receiving machine z = OSCOutPort(57123, hostname); scalefill = { scale = Array.fill(5, { arg i; w.at(i).value }) }; min = 0; max = 11; w = GUIWindow.new("panel", Rect.newBy(387, 223, 332, 305)); NumericalView.new( w, Rect.newBy(88, 176, 25, 24), "NumericalView",rrand(min, max), min, max, 1, 'linear'); NumericalView.new( w, Rect.newBy(121, 176, 25, 24), "NumericalView", rrand(min, max), min, max, 1, 'linear'); NumericalView.new( w, Rect.newBy(151, 176, 25, 24), "NumericalView", rrand(min, max), min, max, 1, 'linear'); NumericalView.new( w, Rect.newBy(180, 176, 25, 24), "NumericalView", rrand(min, max), min, max, 1, 'linear'); NumericalView.new( w, Rect.newBy(209, 176, 25, 24), "NumericalView", rrand(min, max), min, max, 1, 'linear'); SliderView.new( w, Rect.newBy(89, 35, 19, 133), "SliderView", w.at(0).value, min, max, 1, 'linear'); SliderView.new( w, Rect.newBy(121, 35, 19, 133), "SliderView", w.at(1).value, min, max, 1, 'linear'); SliderView.new( w, Rect.newBy(150, 35, 19, 133), "SliderView", w.at(2).value, min, max, 1, 'linear'); SliderView.new( w, Rect.newBy(180, 35, 19, 133), "SliderView",w.at(3).value, min, max, 1, 'linear'); SliderView.new( w, Rect.newBy(213, 35, 19, 133), "SliderView",w.at(4).value, min, max, 1, 'linear'); test = ButtonView.new( w, Rect.newBy(47, 176, 36, 24), "test", 0, 0, 1, 0, 'linear'); test.action = { trig.gate(1, 1) }; set = { 5.do({ arg i; w.at(i+5).action = { w.at(i).value = w.at(i+5).value; scalefill.value } }) }; set.value; sendknopf = ButtonView.new( w, Rect.newBy(241, 225, 41, 38), "send", 0, 0, 1, 0, 'linear'); info = ButtonView.new( w, Rect.newBy(13, 275, 55, 18), "info", 0, 0, 1, 0, 'linear'); info.action = { ("\n \n \n with this elevatorclient you can edit a scale within a 12-tone system and \n send it to the elevator in the artschool hamburg, \n influencing the atmosphere considerably \n" ++ " \n the result you might hear at \n http://telenautik.pop.de/elevator_e.html \n \n \n we wish you enjoy your stay ").post; }; sendknopf.action = { var col; col = Color.new(255.rand, 255.rand, 255.rand); scalefill.value; z.send("/ska", scale); prompt.label = "ok, scale is sent away"; prompt.labelColor_(col); sendknopf.backColor_(col); Task.new({ 3.wait; prompt.label = ""; sendknopf.backColor_(Color.new(176,176,176)) }) }; prompt = StringView.new( w, Rect.newBy(12, 9, 303, 21), ""); scalefill.value; { trig = Plug.kr(0); TSpawn.ar({ Spawn.ar({ arg spawn, i; var env; env = Env.perc(0.02, 0.6); Pan2.ar(FSinOsc.ar((i.degreeToKey(scale, 12) + 60).midicps, 0.2), 0.4.rand2,EnvGen.kr(env)) }, 1, { #[0.5, 0.25, 0.33].choose}, scale.size) }, 1, nil, trig>0) }.play; w.close; )