hunk ./sclang/gui/CtlView.sc 2 - var ctl, parent, basicColor, updateProc, + var ctl, parent, <>basicColor, updateProc, hunk ./sclang/Controller.sc 77 - hunk ./sclang/Ctl.sc 8 - doSend; + doSend, + <>view; hunk ./sclang/gui/makeInterface.sc 2 - makeInterface { - arg rows = 4, columns = 8, offset = 0, - windowName = "c.Interface", colorChooser = nil; - var n, width, height, rect, window, flow; - n = rows * columns; - width = columns * CtlView.width; - height = rows * CtlView.height; - rect = Rect(128, 128, width, height); - window = GUI.window.new(windowName, rect, resizable:false); - flow = FlowLayout.new(window.view.bounds, - Point.new(0,0), - Point.new(0,0);); - window.view.decorator = flow; - rows.do({ - arg i; - columns.do({ - arg j; - var index; - index = (i * columns) + j + offset; - CtlView.new(ctl.at(index), - window, - if(colorChooser.isNil, - {Color.white;}, - {colorChooser.value(index);});); - }); - flow.nextLine; - }); - window.front; - ^window; - } + makeInterface { + arg rows = 4, columns = 8, offset = 0, + windowName = "c.Interface", colorChooser = nil; + var n, width, height, rect, window, flow; + n = rows * columns; + width = columns * CtlView.width; + height = rows * CtlView.height; + rect = Rect(128, 128, width, height); + window = GUI.window.new(windowName, rect, resizable:false); + flow = FlowLayout.new(window.view.bounds, + Point.new(0,0), + Point.new(0,0);); + window.view.decorator = flow; + rows.do({ + arg i; + columns.do({ + arg j; + var ix, vw; + ix = (i * columns) + j + offset; + vw = CtlView.new(ctl.at(ix), + window, + if(colorChooser.isNil, + {Color.white;}, + {colorChooser.value(ix);});); + ctl.at(ix).view = vw; + vw; + }); + flow.nextLine; + }); + window.front; + ^window; + } hunk ./help/Controller.help.scd 26 - arg index, spec, value, state; - [index, spec, value, state].postln;}); + arg index, spec, value, state; + [index, spec, value, state].postln}); hunk ./help/Controller.help.scd 67 - arg index; - [Color.yellow, Color.white].wrapAt(index);}); + arg index; + [Color.yellow, Color.white].wrapAt(index)}); hunk ./help/Controller.help.scd 80 - arg source, channel, number, value; - var index ; - index = [(0..7),(8..15)].lace(16).at(number); - c[index].internal = value / 127.0; + arg source, channel, number, value; + var index ; + index = [(0..7),(8..15)].lace(16).at(number); + c[index].internal = value / 127.0; hunk ./help/Controller.help.scd 99 - arg out = 0, freq = 440, pan = 0, gain = 1; - Out.ar(out, Pan2.ar( - SinOsc.ar(freq, 0, - EnvGen.kr(envelope: (Env.perc), doneAction: 2)), - pan, gain));}).send(s); + arg out = 0, freq = 440, pan = 0, gain = 1; + Out.ar(out, Pan2.ar( + SinOsc.ar(freq, 0, + EnvGen.kr(envelope: (Env.perc), doneAction: 2)), + pan, gain))}).send(s); hunk ./help/Controller.help.scd 114 - var d; - d = [[0, 2, 4, 5, 7, 9, 11], - [0, 2, 3, 5, 6, 8, 9, 11], - [0, 2, 4, 6, 8, 10]]; - inf.do({ - arg n; - var f; - f = (d[c[4].state].choose + 48 + [-12,0,12].choose).midicps; - [n,f].postln; - s.sendMsg("/s_new", "ping", -1, 0, 0, - "freq", f * c[1].value, - "pan", c[2].value, - "gain", c[3].value + 0.25.rand); - c[0].value.yield; - c[0].value.postln; - }); + var d; + d = [[0, 2, 4, 5, 7, 9, 11], + [0, 2, 3, 5, 6, 8, 9, 11], + [0, 2, 4, 6, 8, 10]]; + inf.do({ + arg n; + var f; + f = (d[c[4].state].choose + 48 + [-12,0,12].choose).midicps; + [n,f].postln; + s.sendMsg("/s_new", "ping", -1, 0, 0, + "freq", f * c[1].value, + "pan", c[2].value, + "gain", c[3].value + 0.25.rand); + c[0].value.yield; + c[0].value.postln; + }); hunk ./help/Controller.help.scd 137 -Routine.new({inf.do({c[2].value = 2.0.rand - 1.0; c[0].value.yield;})}).play; +Routine.new({inf.do({c[2].value = 2.0.rand - 1.0; c[0].value.yield})}).play; hunk ./help/Controller.help.scd 144 - arg src, chan, num, vel; - var step; - if(num==60, {step = -1}, {step = 1}); - c[0].increment(step); + arg src, chan, num, vel; + var step; + if(num==60, {step = -1}, {step = 1}); + c[0].increment(step); hunk ./help/Controller.help.scd 157 - arg src, chan, num, vel; - c[16].internal = num/127.0; - c[17].internal = vel/127.0; + arg src, chan, num, vel; + c[16].internal = num/127.0; + c[17].internal = vel/127.0; hunk ./help/Controller.help.scd 162 - arg src, chan, num, vel; - c[17].internal = 0.0; + arg src, chan, num, vel; + c[17].internal = 0.0; hunk ./help/Controller.help.scd 183 -];}.play; +]}.play; hunk ./help/Controller.help.scd 193 - arg i; - c[i].setup("Ctl:" ++ i.asString); + arg i; + c[i].setup("Ctl:" ++ i.asString); hunk ./help/Controller.help.scd 219 -s.action = {arg e; c[e.index].value = e.currentvalue;}; +s.action = {arg e; c[e.index].value = e.currentvalue}; hunk ./sclang/Controller.sc 2 + var 1, { state = (internal * (depth - 1)).round;}); - this.onEdit; - } + onValueModified { + if(depth>1, {state = (internal * (depth - 1)).round}); + this.onEdit; + } hunk ./sclang/Ctl.sc 35 - internal_ { - arg n = 0; - internal = n.clip(0.0,1.0); - this.onValueModified; - } + internal_ { + arg n = 0; + internal = n.clip(0.0,1.0); + this.onValueModified; + } hunk ./sclang/Ctl.sc 41 - value { - ^spec.map(internal); - } + value { + ^spec.map(internal); + } hunk ./sclang/Ctl.sc 45 - value_ { - arg n; - internal = spec.unmap(n); - this.onValueModified; - } + value_ { + arg n; + internal = spec.unmap(n); + this.onValueModified; + } hunk ./sclang/Ctl.sc 51 - update { - if(doSend, { - s.sendMsg("/c_get", index); - }); - } + update { + if(doSend, { + s.sendMsg("/c_get", index); + }); + } hunk ./sclang/Ctl.sc 57 - spec_ { - arg n; - spec = n.asSpec; - this.onEdit; - } + spec_ { + arg n; + spec = n.asSpec; + this.onEdit; + } hunk ./sclang/Ctl.sc 63 - depth_ { - arg n; - n = n.asInteger; - if(state >= n, {state = 0;}); - depth = n; - if(depth < 1, {depth = 1;}); - this.onEdit; - } + depth_ { + arg n; + n = n.asInteger; + if(state >= n, {state = 0}); + depth = n; + if(depth < 1, {depth = 1}); + this.onEdit; + } hunk ./sclang/Ctl.sc 72 - onStateModified { - if(depth == 1, - {internal = 0;}, - {internal = stateMap.blendAt((state/(depth-1))*(stateMap.size-1));}); - this.onEdit; - } + onStateModified { + if(depth == 1, + {internal = 0}, + {internal = stateMap.blendAt((state/(depth-1))*(stateMap.size-1))}); + this.onEdit; + } hunk ./sclang/Ctl.sc 79 - state_ { - arg n = 0; - state = n.mod(depth); - this.onStateModified; - } + state_ { + arg n = 0; + state = n.mod(depth); + this.onStateModified; + } hunk ./sclang/Ctl.sc 85 - stateMap_ { - arg map; - if(map.isNil, - {stateMap = [0.0, 1.0];}, - {stateMap = map.collect({arg e; spec.unmap(e);});}); - this.onStateModified; - } + stateMap_ { + arg map; + if(map.isNil, + {stateMap = [0.0, 1.0]}, + {stateMap = map.collect({arg e; spec.unmap(e)})}); + this.onStateModified; + } hunk ./sclang/Ctl.sc 93 - increment { - arg n = 1; - state = (state+n).mod(depth); - this.onStateModified; - } + increment { + arg n = 1; + state = (state+n).mod(depth); + this.onStateModified; + } hunk ./sclang/Ctl.sc 99 - addRecv { - arg proc; - recv.add(proc); - } + addRecv { + arg proc; + recv.add(proc); + } hunk ./sclang/Ctl.sc 104 - removeRecv { - arg proc; - recv.remove(proc); - } + removeRecv { + arg proc; + recv.remove(proc); + } hunk ./sclang/Ctl.sc 109 - clearRecv { - recv.clear; - } + clearRecv { + recv.clear; + } hunk ./sclang/Ctl.sc 113 - dispatchRecv { - recv.do({ - arg proc; - proc.value(index, spec, this.value, state); - }); - } + dispatchRecv { + recv.do({ + arg proc; + proc.value(index, spec, this.value, state); + }); + } hunk ./sclang/Ctl.sc 120 - send { - s.sendMsg("/c_set", index, this.value); - } + send { + s.sendMsg("/c_set", index, this.value); + } hunk ./sclang/Ctl.sc 124 - onEdit { - this.dispatchRecv; - this.send; - } + onEdit { + this.dispatchRecv; + this.send; + } hunk ./sclang/Ctl.sc 129 - asUGenInput { - ^this.index - } + asUGenInput { + ^this.index + } hunk ./sclang/Ctl.sc 133 - setup { - arg newName = "", newSpec = nil, newValue = nil, newDepth = 1, newStateMap = nil; - name = newName; - internal = 0; - depth = newDepth; - state = 0; - if(newStateMap.isNil, - { stateMap = [0.0, 1.0]; }, - { stateMap = newStateMap }); - if(newSpec.isNil, - { spec = ControlSpec(0, 1, LinearWarp); }, - { spec = newSpec; }); - if(newValue.isNil, - { this.onEdit; }, - { this.value = newValue; }); - } + setup { + arg newName = "", newSpec = nil, newValue = nil, newDepth = 1, newStateMap = nil; + name = newName; + internal = 0; + depth = newDepth; + state = 0; + if(newStateMap.isNil, + {stateMap = [0.0, 1.0]}, + {stateMap = newStateMap}); + if(newSpec.isNil, + {spec = ControlSpec(0, 1, LinearWarp)}, + {spec = newSpec}); + if(newValue.isNil, + {this.onEdit}, + {this.value = newValue}); + } hunk ./sclang/Ctl.sc 150 - displayName { - if(depth == 1, - {^name}, - {^name++":"++state.asString}); - } + displayName { + if(depth == 1, + {^name}, + {^name++":"++state.asString}); + } hunk ./sclang/Ctl.sc 157 - ("Name : "++(name)).postln; - ("DisplayName : "++(this.displayName)).postln; - ("Index : "++(index)).postln; - ("Depth : "++(depth.asString)).postln; - ("State : "++(state.asString)).postln; - ("Value : "++(this.value.asString)).postln; - ("Internal : "++(internal.asString)).postln; - ("Recv's : "++(recv.size.asString)).postln; - } + ("Name : "++(name)).postln; + ("DisplayName : "++(this.displayName)).postln; + ("Index : "++(index)).postln; + ("Depth : "++(depth.asString)).postln; + ("State : "++(state.asString)).postln; + ("Value : "++(this.value.asString)).postln; + ("Internal : "++(internal.asString)).postln; + ("Recv's : "++(recv.size.asString)).postln; + } hunk ./sclang/gui/CtlView.sc 2 - var ctl, parent, <>basicColor, updateProc, - layoutView, nameView, dialView, valueView; + var ctl, parent, <>basicColor, updateProc, + layoutView, nameView, dialView, valueView; hunk ./sclang/gui/CtlView.sc 5 - *new { - arg ctl, parent, basicColor; - ^super.new.init(ctl, parent, basicColor); - } + *new { + arg ctl, parent, basicColor; + ^super.new.init(ctl, parent, basicColor); + } hunk ./sclang/gui/CtlView.sc 10 - *height { - var n = 3; - ^(n*16)+(n*4); - } + *height { + var n = 3; + ^(n*16)+(n*4); + } hunk ./sclang/gui/CtlView.sc 15 - *width { - ^(80+4); - } + *width { + ^(80+4); + } hunk ./sclang/gui/CtlView.sc 19 - *font { - ^GUI.font.new(\Helvetica, 10); - } + *font { + ^GUI.font.new(\Helvetica, 10); + } hunk ./sclang/gui/CtlView.sc 23 - setupNameView { - nameView = GUI.button.new(layoutView, Rect(0, 0, 80, 16)); - nameView.font = CtlView.font; - nameView.states = [[ctl.displayName, Color.black, basicColor]]; - nameView.action = { - arg button, modifiers=0; /* QT does not set modifiers? */ - var shiftMask, direction; - direction = if(modifiers.isShift, {-1}, {1}); - ctl.increment(direction); - }; - } + setupNameView { + nameView = GUI.button.new(layoutView, Rect(0, 0, 80, 16)); + nameView.font = CtlView.font; + nameView.states = [[ctl.displayName, Color.black, basicColor]]; + nameView.action = { + arg button, modifiers=0; /* QT does not set modifiers? */ + var shiftMask, direction; + direction = if(modifiers.isShift, {-1}, {1}); + ctl.increment(direction); + }; + } hunk ./sclang/gui/CtlView.sc 35 - updateNameView { - nameView.states = [[ctl.displayName, Color.black, basicColor]]; - nameView.value = 0; - } + updateNameView { + nameView.states = [[ctl.displayName, Color.black, basicColor]]; + nameView.value = 0; + } hunk ./sclang/gui/CtlView.sc 40 - setupDialView { - dialView = GUI.slider.new(layoutView, Rect(0, 0, 80, 16)); - dialView.knobColor_(basicColor); - dialView.background_(basicColor.copy.alpha_(0.3)); - dialView.thumbSize = 4; - dialView.resize = 2; - dialView.action = { - ctl.internal = dialView.value; - }; - dialView.action.value; - } + setupDialView { + dialView = GUI.slider.new(layoutView, Rect(0, 0, 80, 16)); + dialView.knobColor_(basicColor); + dialView.background_(basicColor.copy.alpha_(0.3)); + dialView.thumbSize = 4; + dialView.resize = 2; + dialView.action = {ctl.internal = dialView.value}; + dialView.action.value; + } hunk ./sclang/gui/CtlView.sc 50 - updateDialView { - dialView.value = ctl.internal; - } + updateDialView { + dialView.value = ctl.internal; + } hunk ./sclang/gui/CtlView.sc 54 - setupValueView { - valueView = GUI.button.new(layoutView, Rect(0, 0, 80, 16)); - valueView.font = CtlView.font; - valueView.states = [[ctl.value.round(0.01).asString, - Color.black, basicColor]]; - valueView.action = { - arg button; - ctl.update; - }; - } + setupValueView { + var v = ctl.value.round(0.01).asString; + valueView = GUI.button.new(layoutView, Rect(0, 0, 80, 16)); + valueView.font = CtlView.font; + valueView.states = [[v, Color.black, basicColor]]; + valueView.action = {|button| ctl.update}; + } hunk ./sclang/gui/CtlView.sc 62 - updateValueView { - valueView.states = [[ctl.value.round(0.01).asString, - Color.black, basicColor]]; - valueView.value = 0; - } + updateValueView { + var v = ctl.value.round(0.01).asString; + valueView.states = [[v, Color.black, basicColor]]; + valueView.value = 0; + } hunk ./sclang/gui/CtlView.sc 68 - update { - this.updateNameView; - this.updateDialView; - this.updateValueView; - } + update { + this.updateNameView; + this.updateDialView; + this.updateValueView; + } hunk ./sclang/gui/CtlView.sc 74 - init { - arg argCtl, argParent, argBasicColor; - parent = argParent; - ctl = argCtl; - basicColor = argBasicColor; - updateProc = { - arg index, spec, value, state; - { this.update; }.defer; - }; - layoutView = GUI.vLayoutView.new(parent, - Rect(0, 0, CtlView.width, CtlView.height)); - layoutView.onClose = { - ctl.removeRecv(updateProc); - }; - /*layoutView.spacing = 0; (QT) */ - this.setupNameView; - this.setupDialView; - this.setupValueView; - ctl.addRecv(updateProc); - } + init { + arg argCtl, argParent, argBasicColor; + parent = argParent; + ctl = argCtl; + basicColor = argBasicColor; + updateProc = { + arg index, spec, value, state; + {this.update}.defer; + }; + layoutView = GUI.vLayoutView.new(parent, + Rect(0, 0, CtlView.width, CtlView.height)); + layoutView.onClose = { + ctl.removeRecv(updateProc); + }; + /*layoutView.spacing = 0; (QT) */ + this.setupNameView; + this.setupDialView; + this.setupValueView; + ctl.addRecv(updateProc); + } hunk ./sclang/gui/makeInterface.sc 5 - var n, width, height, rect, window, flow; + var o, n, width, height, rect, window, flow; hunk ./sclang/gui/makeInterface.sc 11 - flow = FlowLayout.new(window.view.bounds, - Point.new(0,0), - Point.new(0,0);); + o = Point.new(0,0); + flow = FlowLayout.new(window.view.bounds,o,o); hunk ./sclang/gui/makeInterface.sc 23 - {Color.white;}, - {colorChooser.value(ix);});); - ctl.at(ix).view = vw; - vw; + {Color.white}, + {colorChooser.value(ix)})); + ctl.at(ix).view = vw; + vw;