2 classvar resetActions, shutdownActions;
5 resetActions = Array.new;
6 shutdownActions = Array.new; // braindead extensions may rely on these
9 *registerForReset {|aFunction|
10 this.deprecated(thisMethod, OnError.class.findMethod(\add));
11 OnError.add(aFunction)
13 *registerForShutdown {|aFunction|
14 this.deprecated(thisMethod, ShutDown.class.findMethod(\add));
15 ShutDown.add(aFunction)
19 Pflow : FilterPattern {
21 Error("Pflow was replaced. please use Pstep instead").throw;
29 this.deprecated(thisMethod, Object.class.findMethod(\new));
30 "NB Model's functionality is duplicated by Object".postln;
33 changed { arg what ... moreArgs;
34 dependants.do({ arg item;
35 item.update(this, what, *moreArgs);
38 addDependant { arg dependant;
39 if (dependants.isNil, {
40 dependants = IdentitySet.new(4);
42 dependants.add(dependant);
44 removeDependant { arg dependant;
45 if (dependants.notNil, {
46 dependants.remove(dependant);
54 Panner : MultiOutUGen {
56 this.deprecated(thisMethod);
60 this.deprecated(thisMethod);
67 this.deprecated(thisMethod);
71 this.deprecated(thisMethod);
79 // platform neutral (eventually)
80 this.deprecated(thisMethod, File.class.findMethod(\openDialog));
82 { arg path; function.value(true,path) },
83 { function.value(false) } );
84 //CocoaDialog.getPaths({arg paths; function.value(paths.first) },nil)
86 // warning: doesn't handle doAction (no instance)
93 *new { arg prompt,defaultString="",func;
95 this.deprecated(thisMethod);
97 b = TextField(l,Rect(0,0,150,30));
98 b.string = String.new ++ defaultString;
99 b.action = {arg field; func.value(true,field.value); l.close; };
108 this.deprecated(thisMethod, Mix.class.findMethod(\new));
111 *arFill { arg n,func;
112 this.deprecated(thisMethod, Mix.class.findMethod(\fill));
118 // rgb() still will not work in variable declarations in classes
119 // because rgb is no longer a literal
121 // move them to init methods
122 rgb { arg green,blue;
123 this.deprecated(thisMethod, Color.class.findMethod(\new255));
124 ^Color(this / 255.0,green / 255.0, blue / 255.0)
132 this.deprecated(thisMethod, Server.findMethod(\free));
133 RootNode.new.freeAll;
136 this.deprecated(thisMethod, Synth.class.findMethod(\new));
137 Server.default.doWhenBooted({
142 this.deprecated(thisMethod, Synth.class.findMethod(\new));
143 //if not already playing, play
146 this.deprecated(thisMethod, Server.findMethod(\sampleRate));
147 ^Server.default.sampleRate ? Server.default.options.sampleRate ? 44100.0
156 this.deprecated(thisMethod, File.findMethod(\write));
157 file = File.new(path, "wb");
160 if(file.length < this.size,{
161 Error("Write file failed !!!! " ++ path).throw;
171 this.deprecated(thisMethod)
174 this.deprecated(thisMethod)
179 this.deprecated(thisMethod, ServerOptions.findMethod(\zeroConf_))
183 this.deprecated(thisMethod, ServerOptions.findMethod(\zeroConf));
187 numAudioBusChannels_{|num|
188 this.numPrivateAudioBusChannels = num - (numInputBusChannels + numOutputBusChannels);
189 this.deprecated(thisMethod);
194 // Buffer objects are cached in an Array for easy
195 // auto buffer info updating
197 this.deprecated(thisMethod, Buffer.findRespondingMethodFor(\cache));
203 this.deprecated(thisMethod, Buffer.findRespondingMethodFor(\uncache));
204 if((buf = Buffer.cachedBufferAt(this, i)).notNil) { buf.free };
207 // /b_info on the way
208 // keeps a reference count of waiting Buffers so that only one responder is needed
210 this.deprecated(thisMethod, Buffer.findRespondingMethodFor(\cache));
213 resetBufferAutoInfo {
214 this.deprecated(thisMethod, Meta_Buffer.findRespondingMethodFor(\clearServerCaches));
215 Buffer.clearServerCaches(this);
220 // map to Bus objects
221 busMap { arg firstControl, aBus ... args;
223 this.deprecated(thisMethod, Node.findMethod(\map));
225 args.pairsDo({ arg control, bus; values.addAll([control, bus.index, bus.numChannels])});
226 server.sendMsg(48, nodeID, firstControl, aBus.index, aBus.numChannels, *values);
229 busMapMsg { arg firstControl, aBus ... args;
231 this.deprecated(thisMethod, Node.findMethod(\mapMsg));
233 args.pairsDo({ arg control, bus; values.addAll([control, bus.index, bus.numChannels])});
234 ^[48, nodeID, firstControl, aBus.index, aBus.numChannels] ++ values;
240 memStore { arg libname = \global, completionMsg, keepDef = true;
241 this.deprecated(thisMethod, this.class.findRespondingMethodFor(\add));
242 this.add(libname, completionMsg, keepDef);
247 shapeNumber { arg shapeName;
248 this.deprecated(thisMethod, this.class.class.findMethod(\shapeNumber));
249 ^this.class.shapeNumber(shapeName)
255 this.deprecated(thisMethod, Meta_Help.findRespondingMethodFor(\gui));
261 occurencesOf { | obj |
262 this.deprecated(thisMethod, Collection.findRespondingMethodFor(\occurrencesOf));
263 ^this.occurrencesOf(obj);
268 copy { arg buf, dstStartAt = 0, srcStartAt = 0, numSamples = -1;
270 this.deprecated(thisMethod, this.class.findRespondingMethodFor(\copyData));
271 this.copyData(buf, dstStartAt, srcStartAt, numSamples);
278 + ArrayedCollection {
279 plotOld { arg name, bounds, discrete=false, numChannels, minval, maxval, parent, labels=true;
280 var plotter, txt, chanArray, unlaced, val, window, thumbsize, zoom, width,
281 layout, write=false, msresize, gui;
283 this.deprecated(thisMethod, ArrayedCollection.findRespondingMethodFor(\plot));
289 if(parent.respondsTo(\view)) {
295 Rect(200 ,140, 705, 410);
299 width = bounds.width - 8;
301 name = name ? "plot";
303 numChannels = numChannels ? this.first.size.max(1);
304 flattened = if(numChannels > 1) { this.flat } { this };
305 unlaced = flattened.unlace(numChannels);
307 minval = if(minval.isArray) {
308 numChannels.collect {|index| minval.wrapAt(index) ?? { unlaced[index].minItem } }
310 { minval ?? { flattened.minItem } }.dup(numChannels);
312 maxval = if(maxval.isArray) {
313 numChannels.collect{|index| maxval.wrapAt(index) ?? { unlaced[index].maxItem } }
315 {maxval ?? { flattened.maxItem }}.dup(numChannels);
318 chanArray = Array.newClear(numChannels);
321 thumbsize = max(1.0, width / (flattened.size / numChannels));
322 unlaced.do { |chan, j|
323 chanArray[j] = chan.linlin( minval[j], maxval[j], 0.0, 1.0 );
326 zoom = (width / (flattened.size / numChannels));
328 unlaced.do { |chan, j|
329 val = Array.newClear(width);
332 x = chan.blendAt(i / zoom);
333 val[i] = x.linlin(minval[j], maxval[j], 0.0, 1.0);
338 window = parent ?? { gui.window.new( name, bounds ) };
340 layout = gui.vLayoutView.new(window,
342 Rect(bounds.left + 4, bounds.top + 4, bounds.width - 10, bounds.height - 10)
344 Rect(4, 4, bounds.width - 10, bounds.height - 10)
349 txt = gui.staticText.new(layout, Rect( 8, 0, width, 18))
350 .string_("index: 0, value: " ++ flattened[0].asString);
354 plotter = gui.multiSliderView.new(layout,
356 // compensate for the text
357 layout.bounds.width, layout.bounds.height - if(labels, {26}, {0})
360 .drawLines_(discrete.not)
361 .drawRects_(discrete)
362 .indexThumbSize_(thumbsize)
364 .background_(Color.white)
365 .colors_(Color.black, Color.blue(1.0,1.0))
368 curval = v.currentvalue.linlin(0.0, 1.0, minval[i], maxval[i]);
371 txt.string_("index: " ++ (v.index / zoom).roundUp(0.01).asString ++
372 ", value: " ++ curval);
374 if(write) { flattened[(v.index / zoom).asInteger * numChannels + i ] = curval };
376 .keyDownAction_({ |v, char|
377 if(char === $l) { write = write.not; v.readOnly = write.not; };
379 .value_(chanArray[i])
381 if(numChannels > 1) { plotter.resize_(5) };
384 ^window.tryPerform(\front) ?? { window }
387 plot2 {|name, bounds, discrete=false, numChannels, minval, maxval|
388 this.deprecated(thisMethod, ArrayedCollection.findRespondingMethodFor(\plot));
389 ^this.plot(name, bounds, discrete, numChannels, minval, maxval)
394 plotOld { arg duration = 0.01, server, bounds, minval = -1.0, maxval = 1.0, parent, labels=true;
396 this.deprecated(thisMethod, Function.findRespondingMethodFor(\plot));
398 this.loadToFloatArray(duration, server, { |array, buf|
400 numChan = buf.numChannels;
403 array.plotOld(bounds: bounds, numChannels: numChan, minval: minval, maxval: maxval,
404 parent: parent, labels: labels)
409 plot2 {|duration = 0.01, server, bounds, minval, maxval|
410 this.deprecated(thisMethod, Function.findRespondingMethodFor(\plot));
411 ^this.plot(duration, server, bounds, minval, maxval)
416 plotOld { arg name, bounds, minval, maxval, parent, labels=true;
417 this.deprecated(thisMethod, Wavetable.findRespondingMethodFor(\plot));
418 ^this.asSignal.plotOld(name, bounds, minval: minval, maxval: maxval, parent: parent, labels: labels);
421 plot2 { |name, bounds, minval, maxval|
422 this.deprecated(thisMethod, Wavetable.findRespondingMethodFor(\plot));
423 ^this.plot(name, bounds, minval, maxval)
428 plotOld { arg name, bounds, minval = -1.0, maxval = 1.0, parent, labels=true;
431 this.deprecated(thisMethod, Buffer.findRespondingMethodFor(\plot));
432 this.loadToFloatArray(action: { |array, buf|
435 array.plotOld(name, bounds, numChannels: buf.numChannels, minval: minval, maxval: maxval, parent: parent, labels: labels);
440 plot2 { |name, bounds, minval, maxval|
441 this.deprecated(thisMethod, Buffer.findRespondingMethodFor(\plot));
442 ^this.plot(name, bounds, minval, maxval)
447 plot2 { |size = 400, bounds, minval, maxval|
448 this.deprecated(thisMethod, Env.findRespondingMethodFor(\plot));
449 ^this.plot(size, bounds, minval, maxval)
452 plotOld { arg size = 400, bounds, minval, maxval, parent;
453 this.deprecated(thisMethod, Env.findRespondingMethodFor(\plot));
454 this.asSignal(size).plotOld(bounds: bounds, minval: minval, maxval: maxval, parent: parent);
459 plotGraphOld { arg n=500, from = 0.0, to = 1.0, name, bounds, discrete = false,
460 numChannels, minval, maxval, parent, labels = true;
462 this.deprecated(thisMethod, AbstractFunction.findRespondingMethodFor(\plotGraph));
463 array = Array.interpolation(n, from, to);
464 res = array.collect { |x| this.value(x) };
465 res.plotOld(name, bounds, discrete, numChannels, minval, maxval, parent, labels)
468 plotGraph2 { arg n=500, from = 0.0, to = 1.0, name, bounds, discrete = false,
469 numChannels, minval, maxval, parent, labels = true;
470 this.deprecated(thisMethod, AbstractFunction.findRespondingMethodFor(\plotGraph));
471 this.plotGraph(n, from, to, name, bounds, discrete, numChannels, minval, maxval, parent, labels)
477 recvOSCfunc { this.deprecated(thisMethod); ^recvOSCfunc; }
479 recvOSCfunc_ { |newFunc|
480 this.deprecated(thisMethod, Main.findMethod(\addOSCFunc));
481 recvOSCfunc = newFunc;
489 this.deprecated(thisMethod);