James Harkins | 1 Dec 01:15 2011
Picon

Re: [commit?] new osc command n_setni

At Thu, 01 Dec 2011 00:06:51 +0100,
Julian Rohrhuber wrote:
> Here is a different solution, using bookkeeping on the sclang side. It adds a dictionary that maps from
name to index to the SynthDesc. This is reasonably fast as a solution that methods for Node and NodeProxy
could use.

Heh heh... only yesterday, I was mulling over exactly the same idea on the bus. It would eliminate the O(1)
search through the synthdesc's controlNames.

I like it :)
hjh

--
James Harkins /// dewdrop world
jamshark70@...
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman

blog: http://www.dewdrop-world.net/words
audio clips: http://www.dewdrop-world.net/audio
more audio: http://soundcloud.com/dewdrop_world/tracks

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
(Continue reading)

Charles Céleste Hutchins | 1 Dec 01:38 2011
Picon

Re: ServerOptions.devices: primitive broken?

I was just about to report this same problem.

There is a possibly related issue that when I set s.option.inDevice to a string for a device that does not actually exist, the server fails to start. In previous versions, this was instead treated as if I had set the device to nil.

On Wed, Nov 30, 2011 at 11:09 PM, Martin Marier <mariermartin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi devs,

When I do

ServerOptions.devices

I get a Primitive not bound error:

ERROR: A primitive was not bound. 0 643 code: "ServerOptions.devices"
ERROR: A primitive was not bound. 0 643
Instance of Method {    (0x2a847c0, gc=01, fmt=00, flg=11, set=04)
  instance variables [15]
    raw1 : Float 0.000000   00000000 0080000C
    raw2 : Float 0.000000   00000300 03020003
    code : instance of Int8Array (0x2a84ac0, size=4, set=2)
    selectors : nil
    constants : nil
    prototypeFrame : instance of Array (0x2a84a00, size=3, set=2)
    context : nil
    argNames : instance of SymbolArray (0x2a84940, size=3, set=2)
    varNames : nil
    sourceCode : nil
    ownerClass : class Meta_ServerOptions (0x2a7c280)
    name : Symbol 'prListDevices'
    primitiveName : Symbol '_ListAudioDevices'
    filenameSymbol : Symbol '/usr/local/share/SuperCollider/SCClassLibrary/Common/Control/Server.sc'
    charPos : Integer 3607
}
ERROR: Primitive 'none' failed.
Failed.

I am on latest git, ubuntu 11.04, scel.
Anyone else has similar results?

Thanks

Martin



--
cheers,
Les

--
Charles Céleste Hutchins

http://www.berkeleynoise.com/celesteh/podcast/
http://www.bilensemble.co.uk

James Harkins | 1 Dec 02:00 2011
Picon

Re: ServerOptions.devices: primitive broken?

At Wed, 30 Nov 2011 18:09:35 -0500,
Martin Marier wrote:
> Hi devs,
> 
> When I do
> 
> ServerOptions.devices
> 
> I get a Primitive not bound error:
> 
> ERROR: A primitive was not bound. 0 643 code: "ServerOptions.devices"

I don't remember exactly when or why this changed, but "devices" is not quite meaningful in Linux. There's
only one device: the Jack server. In OSX and Windows, scsynth uses the operating system's audio
abstraction layer and that's where "devices" is significant.

So, in osx/win, you would set the device(s) to use in ServerOptions, but in Linux, you have to configure the
Jack server (and set the environment variables if you want connections different from the default sc:out
-> system:playback and system:capture -> sc:in).

		// default jack port hookup
		"SC_JACK_DEFAULT_INPUTS".setenv("system");
		"SC_JACK_DEFAULT_OUTPUTS".setenv("system");

hjh

--
James Harkins /// dewdrop world
jamshark70@...
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman

blog: http://www.dewdrop-world.net/words
audio clips: http://www.dewdrop-world.net/audio
more audio: http://soundcloud.com/dewdrop_world/tracks

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Jakob Leben | 1 Dec 04:09 2011
Picon
Picon

SF.net Git: supercollider branch, topic/shmem_server, updated. b678ab533636eee8a70c9e9c64be1a8be263030b

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "supercollider".

The branch, topic/shmem_server has been updated
       via  b678ab533636eee8a70c9e9c64be1a8be263030b (commit)
       via  8f1b990d89a434688e546b209635052ae3785928 (commit)
       via  a458fa9c5b711c962134c3884edd7ec614596bd0 (commit)
       via  5e1ffdb593c319f394d6d03241099bb5023bdd8a (commit)
       via  7087de24272ca92686b4e5be4bc0101568eb1b43 (commit)
      from  359687e00628d9d263da78b7140ea91206cd64a1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b678ab533636eee8a70c9e9c64be1a8be263030b
Author: Jakob Leben <jakob.leben@...>
Date:   Thu Dec 1 02:16:27 2011 +0100

    class library: Server-scope: use ServerTree instead of CmdPeriod

diff --git a/SCClassLibrary/Common/Control/Server.sc b/SCClassLibrary/Common/Control/Server.sc
index 9f1b512..0d360f4 100644
--- a/SCClassLibrary/Common/Control/Server.sc
+++ b/SCClassLibrary/Common/Control/Server.sc
 <at>  <at>  -956,11 +956,10  <at>  <at>  Server {
 		if(recordBuf.notNil) { recordBuf.close {|buf| buf.free; }; recordBuf = nil; };
 		addr = addr.recover;
 		this.changed(\cmdPeriod);
-		if(scopeWindow.notNil) {
-			fork { 0.5.wait; scopeWindow.run } // wait until synth is freed
-		}{
-			CmdPeriod.remove(this)
-		};
+	}
+
+	doOnServerTree {
+		if(scopeWindow.notNil) { scopeWindow.run }
 	}

 	defaultGroup { ^Group.basicNew(this, 1) }
diff --git a/SCClassLibrary/Common/GUI/PlusGUI/Control/server-scope.sc b/SCClassLibrary/Common/GUI/PlusGUI/Control/server-scope.sc
index 4bd597e..dcb395d 100644
--- a/SCClassLibrary/Common/GUI/PlusGUI/Control/server-scope.sc
+++ b/SCClassLibrary/Common/GUI/PlusGUI/Control/server-scope.sc
 <at>  <at>  -12,7 +12,7  <at>  <at> 
 				// prevent buffer conflicts by using reserved bufnum
 			};
 			scopeWindow.window.onClose = scopeWindow.window.onClose.addFunc({ scopeWindow = nil });
-			CmdPeriod.add(this);
+			ServerTree.add(this, this);
 		} {
 			scopeWindow.setProperties(numChannels, index, bufsize, zoom, rate);
 			scopeWindow.run;
commit 8f1b990d89a434688e546b209635052ae3785928
Author: Jakob Leben <jakob.leben@...>
Date:   Thu Dec 1 03:32:39 2011 +0100

    class library: Server-scope: take care to unreference stethoscope

    Make Server take care of clearing its reference to the stethoscope
    it controls after the stethoscope window is closed.
    The stethoscope should know nothing about its clients.

diff --git a/SCClassLibrary/Common/GUI/PlusGUI/Control/server-scope.sc b/SCClassLibrary/Common/GUI/PlusGUI/Control/server-scope.sc
index bf4184b..4bd597e 100644
--- a/SCClassLibrary/Common/GUI/PlusGUI/Control/server-scope.sc
+++ b/SCClassLibrary/Common/GUI/PlusGUI/Control/server-scope.sc
 <at>  <at>  -11,6 +11,7  <at>  <at> 
 					this.options.numBuffers);
 				// prevent buffer conflicts by using reserved bufnum
 			};
+			scopeWindow.window.onClose = scopeWindow.window.onClose.addFunc({ scopeWindow = nil });
 			CmdPeriod.add(this);
 		} {
 			scopeWindow.setProperties(numChannels, index, bufsize, zoom, rate);
commit a458fa9c5b711c962134c3884edd7ec614596bd0
Author: Jakob Leben <jakob.leben@...>
Date:   Thu Dec 1 02:20:29 2011 +0100

    class library: QStethoscope2: use default server if none given

diff --git a/SCClassLibrary/QtCollider/QStethoscope2.sc b/SCClassLibrary/QtCollider/QStethoscope2.sc
index e9b858a..7a6c1e6 100644
--- a/SCClassLibrary/QtCollider/QStethoscope2.sc
+++ b/SCClassLibrary/QtCollider/QStethoscope2.sc
 <at>  <at>  -26,6 +26,7  <at>  <at>  QStethoscope2 {
         cycle = 1024, rate = \audio, view;

     var bus = Bus(rate, index, numChannels, server);
+    if(server.isNil) {server = Server.default};

     ^super.new.initQStethoscope( server, view, bus, bufsize, cycle );
   }
commit 5e1ffdb593c319f394d6d03241099bb5023bdd8a
Author: Jakob Leben <jakob.leben@...>
Date:   Thu Dec 1 03:35:14 2011 +0100

    class library: make QStethoscope2 more robust

    * Better synchronization with server, so as to minimize synth
      creation and ensure all created synths are freed.

    * Use unique synth def name for every stethoscope instance, due
      to potential race between synth def loading and synth creation.

    * Start and stop along with the server, and reallocate ScopeBuffer
      on server reboot.

    * Implement -setProperties.

diff --git a/SCClassLibrary/QtCollider/QStethoscope2.sc b/SCClassLibrary/QtCollider/QStethoscope2.sc
index 6e7c588..e9b858a 100644
--- a/SCClassLibrary/QtCollider/QStethoscope2.sc
+++ b/SCClassLibrary/QtCollider/QStethoscope2.sc
 <at>  <at>  -1,24 +1,25  <at>  <at> 
 QStethoscope2 {
   // internal functions
-  var makeGui, run, synthStatus, setCycle, setYZoom, setIndex, setNumChannels,
+  var playSynthDef, makeGui, setCycle, setYZoom, setIndex, setNumChannels,
       setRate, setStyle, updateColors;

   // gui objects
   var <window, <view, <scopeView, cycleSlider, yZoomSlider,
       idxNumBox, chNumBox, styleMenu, rateMenu;

-  var cycleSpec, yZoomSpec;
-
-  // other objects
+  // static (immutable runtime environment)
   var <server;
-  var scopeBuffer, <bufsize;
-  var <bus;
-  var aBusSpec, cBusSpec, busSpec;
+  var scopeBuffer, maxBufSize;
+  var aBusSpec, cBusSpec, cycleSpec, yZoomSpec;
+  var <>smallSize, <>largeSize;

-  // runtime
+  // runtime (mutable at runtime)
+  var <bus; // partly immutable; can't change numChannels at runtime
+  var busSpec; // either aBusSpec or cBusSpec, depending on bus rate
   var  <cycle, <yZoom;
-  var sizeToggle=false, <>smallSize, <>largeSize;
-  var synth;
+  var synth, synthWatcher, defName;
+  var sizeToggle=false;
+  var running = false;

   *new {
     arg server, numChannels = 2, index = 0, bufsize = 4096,
 <at>  <at>  -34,8 +35,7  <at>  <at>  QStethoscope2 {

     server = server_;

-    scopeBuffer = ScopeBuffer.alloc(server_, bus_.numChannels);
-    bufsize = max(bufsize_, 128);
+    maxBufSize = max(bufsize_, 128);

     bus = bus_;
     singleBus = bus.class === Bus;
 <at>  <at>  -46,18 +46,16  <at>  <at>  QStethoscope2 {
       busSpec = if(bus.rate===\audio){aBusSpec}{cBusSpec};
     };

+    cycleSpec = ControlSpec( 64, maxBufSize, \exponential );
+    yZoomSpec = ControlSpec( 0.125, 16, \exponential );
+    cycle = cycleSpec.constrain(cycle_);
+    yZoom = yZoomSpec.unmap(1.0);
+
     smallSize = Size(250,250);
     largeSize = Size(500,500);

     makeGui = { arg parent;
-      var view, gizmo;
-
-      // SETTINGS
-
-      cycleSpec = ControlSpec( 64, bufsize, \exponential );
-      yZoomSpec = ControlSpec( 0.125, 16, \exponential );
-      cycle = cycleSpec.constrain(cycle_);
-      yZoom = yZoomSpec.unmap(1.0);
+      var gizmo;

       // WINDOW, WRAPPER VIEW

 <at>  <at>  -75,7 +73,6  <at>  <at>  QStethoscope2 {
       // WIDGETS

       scopeView = QScope2();
-      scopeView.bufnum = scopeBuffer.index;
       scopeView.server = server;
       scopeView.canFocus = true;

 <at>  <at>  -129,22 +126,17  <at>  <at>  QStethoscope2 {
       rateMenu.action = { |me| setRate.value(me.value) };
       styleMenu.action = { |me| setStyle.value(me.value) };
       view.asView.keyDownAction = { |v, char| this.keyDown(char) };
-      view.onClose = { this.stop; scopeBuffer.free; };
+      view.onClose = { view = nil; this.quit; };

       // LAUNCH

-      updateColors.value;
       scopeView.focus;
       if( window.notNil ) { window.front };
     };

-    synthStatus = { synth.notNil and: {synth.isPlaying} };
-
     setCycle = { arg val;
       cycle = val;
-      if( synthStatus.value ) {
-        synth.set(\frames, val)
-      }
+      if( synth.notNil ) { synth.set(\frames, val) }
     };

     setYZoom = { arg val;
 <at>  <at>  -155,7 +147,7  <at>  <at>  QStethoscope2 {
     // NOTE: assuming a single Bus
     setIndex = { arg i;
       bus = Bus(bus.rate, i, bus.numChannels, bus.server);
-      if(synthStatus.value) { synth.set(\in, i) };
+      if(synth.notNil) { synth.set(\in, i) };
     };

     // NOTE: assuming a single Bus
 <at>  <at>  -164,7 +156,6  <at>  <at>  QStethoscope2 {
       this.stop;
       bus = Bus(bus.rate, bus.index, n, bus.server);
       this.run;
-      updateColors.value;
     };

     // NOTE: assuming a single Bus
 <at>  <at>  -173,12 +164,12  <at>  <at>  QStethoscope2 {
         0, {
           bus = Bus(\audio, bus.index, bus.numChannels, bus.server);
           busSpec = aBusSpec;
-          if(synthStatus.value) { synth.set(\switch, 0) };
+          if(synth.notNil) { synth.set(\switch, 0) };
         },
         1, {
           bus = Bus(\control, bus.index, bus.numChannels, bus.server);
           busSpec = cBusSpec;
-          if(synthStatus.value) { synth.set(\switch, 1) };
+          if(synth.notNil) { synth.set(\switch, 1) };
         }
       );
       idxNumBox.clipLo_(busSpec.minval).clipHi_(busSpec.maxval).value_(bus.index);
 <at>  <at>  -202,87 +193,175  <at>  <at>  QStethoscope2 {
       scopeView.waveColors = colors;
     };

+    playSynthDef = { arg def, args;
+      if( synthWatcher.notNil ) {synthWatcher.stop};
+      synthWatcher = fork {
+        def.send(server);
+        server.sync;
+        synth = Synth.tail(RootNode(server), def.name, args);
+        CmdPeriod.add(this);
+        {if(view.notNil){updateColors.value; scopeView.start}}.defer;
+      };
+    };
+
     makeGui.value(parent);
+
+    ServerBoot.add(this, server);
+    ServerQuit.add(this, server);
     this.run;
   }

-  run {
+  doOnServerBoot {
+      this.run;
+  }
+
+  doOnServerQuit {
+      this.stop;
+      scopeBuffer.free;
+      scopeBuffer = nil;
+  }
+
+  cmdPeriod {
+    synth = nil;
     this.stop;
+    CmdPeriod.remove(this);
+  }
+
+  run {
+    var n_chan, bus_i, rate_switch, n_frames;
+
+    if(running || server.serverRunning.not) {^this};

-    scopeView.start;
+    if(scopeBuffer.isNil){
+      scopeBuffer = ScopeBuffer.alloc(server);
+      scopeView.bufnum = scopeBuffer.index;
+      defName = "stethoscope" ++ scopeBuffer.index.asString;
+    };

     if( bus.class === Bus ) {
-      synth = SynthDef("stethoscope", { arg in, switch, frames, bufnum;
-        var z;
-        z = Select.ar(switch, [
-          In.ar(in, bus.numChannels.asInteger),
-          K2A.ar(In.kr(in, bus.numChannels.asInteger))]
-        );
-        ScopeOut2.ar(z, bufnum, frames );
-      })
-      .play(
-        RootNode(server),
-        [\bufnum, scopeBuffer.index, \in, bus.index, \frames, cycle,
-          \switch, if('audio' === bus.rate) { 0 } { 1 } ],
-        \addToTail
-      );
+      n_chan = this.numChannels.asInteger;
+      bus_i = bus.index;
+      rate_switch = if('audio' === bus.rate) { 0 } { 1 };
+      n_frames = cycle;
+      playSynthDef.value (
+        SynthDef(defName, { arg in, switch, frames;
+          var z;
+          z = Select.ar(switch, [
+            In.ar(in, n_chan),
+            K2A.ar(In.kr(in, n_chan))]
+          );
+          ScopeOut2.ar(z, scopeBuffer.index, frames );
+        }),
+        [\in, bus_i, \switch, rate_switch, \frames, n_frames]
+      )
     }{
-      synth = SynthDef("stethoscope", { arg frames;
-        var z = [];
-        bus.do { |b| z = z ++ b.ar };
-        z.postln;
-        ScopeOut2.ar(z, scopeBuffer.index, frames);
-      })
-      .play( RootNode(server), [\frames, cycle], \addToTail );
+      n_frames = cycle;
+      playSynthDef.value (
+        SynthDef(defName, { arg frames;
+          var z = Array(n_chan);
+          bus.do { |b| z = z ++ b.ar };
+          ScopeOut2.ar(z, scopeBuffer.index, frames);
+        }),
+        [\frames, n_frames]
+      );
     };
-    NodeWatcher.register(synth);
+
+    running = true;
   }

   stop {
-    scopeView.stop;
-    if( synthStatus.value ) { synth.free };
-    synth = nil;
+    if( view.notNil ) { scopeView.stop };
+
+    if( synthWatcher.notNil ) { synthWatcher.stop };
+
+    if( synth.notNil ) {
+      synth.free;
+      synth = nil;
+    };
+
+    running = false;
   }

   quit {
     this.stop;
-    if( view.notNil ) {view.close};
-    window = nil;
-    scopeBuffer.free;
+    ServerBoot.remove(this, server);
+    ServerQuit.remove(this, server);
+    CmdPeriod.remove(this);
+    if(scopeBuffer.notNil) {scopeBuffer.free; scopeBuffer=nil};
+    if(window.notNil) { window.close; window = nil };
   }

-  isRunning {
-    ^scopeView.getProperty(\running) == true;
+  setProperties { arg numChannels, index, bufsize=4096, zoom, rate;
+      var new_bus;
+      var isRunning = running;
+
+      if (isRunning) {this.stop};
+
+      // process args
+
+      if(index.notNil || numChannels.notNil || rate.notNil) {
+        bus = if(bus.class === Bus) {
+            Bus (
+              rate ? bus.rate,
+              index ? bus.index,
+              numChannels ? bus.numChannels,
+              server
+            )
+        }{
+            Bus (
+              rate ? \audio,
+              index ? 0,
+              numChannels ? 2,
+              server
+            )
+        };
+      };
+      if(bufsize.notNil) { maxBufSize = max(bufsize, 128) };
+      if(zoom.notNil) { yZoom = yZoomSpec.constrain(zoom) };
+
+      // set other vars related to args
+
+      busSpec = if(bus.rate === \audio) {aBusSpec} {cBusSpec};
+      cycleSpec = ControlSpec( 64, maxBufSize, \exponential );
+      cycle = cycleSpec.constrain(cycle);
+
+      // update GUI
+
+      yZoomSlider.value = yZoom;
+      cycleSlider.value = cycleSpec.unmap(cycle);
+      rateMenu.value_(if(bus.rate === \audio){0}{1}).enabled_(true);
+      idxNumBox.clipLo_(busSpec.minval).clipHi_(busSpec.maxval).value_(bus.index).enabled_(true);
+      chNumBox.value_(bus.numChannels).enabled_(true);
+      scopeView.yZoom = yZoomSpec.map(yZoom);
+
+      if (isRunning) {this.run};
   }

+  bufsize { ^maxBufSize }
+
   bus_ { arg b;
     var isSingle = b.class === Bus;
-    var isRunning = this.isRunning;
+    var isRunning = running;

     if (isRunning) {this.stop};

     bus = b;

     if( isSingle ) {
-      rateMenu.value = if(b.rate===\audio){0}{1};
-      idxNumBox.value = b.index;
-      chNumBox.value = b.numChannels;
       busSpec = if(bus.rate === \audio) {aBusSpec} {cBusSpec};
+      rateMenu.value = if(b.rate===\audio){0}{1};
       idxNumBox.clipLo_(busSpec.minval).clipHi_(busSpec.maxval).value_(bus.index);
+      chNumBox.value = b.numChannels;
     }{
+      busSpec = nil;
       rateMenu.value = nil;
       idxNumBox.string = "-";
       chNumBox.string = "-";
-      busSpec = nil;
     };
     rateMenu.enabled = isSingle;
     idxNumBox.enabled = isSingle;
     chNumBox.enabled = isSingle;

-    scopeView.setProperty(\channelCount, this.numChannels);
-
-    updateColors.value;
-
     if (isRunning) {this.run};
   }

commit 7087de24272ca92686b4e5be4bc0101568eb1b43
Author: Jakob Leben <jakob.leben@...>
Date:   Thu Dec 1 03:30:44 2011 +0100

    class library: ScopeBuffer: update interface

    * A ScopeBuffer always occupies a single index, regardless of
      the number of channels it operates on.

    * Rate of scoped buses is irrelevant for ScopeBuffer.

    * We keep numChannels variable as useful information.

diff --git a/SCClassLibrary/Common/Control/ScopeBuffer.sc b/SCClassLibrary/Common/Control/ScopeBuffer.sc
index e23a0d5..f0d07bf 100644
--- a/SCClassLibrary/Common/Control/ScopeBuffer.sc
+++ b/SCClassLibrary/Common/Control/ScopeBuffer.sc
 <at>  <at>  -13,7 +13,7  <at>  <at>  ScopeBuffer {
 		^this.new(alloc, numChannels, server)
 	}

-	*new { arg rate=\audio, index=0, numChannels=1, server;
+	*new { arg index=0, numChannels=1, server;
 		^super.newCopyArgs(index, numChannels, server ? Server.default)
 	}

diff --git a/SCClassLibrary/Common/Control/Server.sc b/SCClassLibrary/Common/Control/Server.sc
index ca35bf6..9f1b512 100644
--- a/SCClassLibrary/Common/Control/Server.sc
+++ b/SCClassLibrary/Common/Control/Server.sc
 <at>  <at>  -323,7 +323,7  <at>  <at>  Server {

 	newScopeBufferAllocators {
 		if (isLocal) {
-			scopeBufferAllocator = ContiguousBlockAllocator.new(128);
+			scopeBufferAllocator = StackNumberAllocator.new(0, 127);
 		}
 	}

-----------------------------------------------------------------------

Summary of changes:
 SCClassLibrary/Common/Control/ScopeBuffer.sc       |    2 +-
 SCClassLibrary/Common/Control/Server.sc            |   11 +-
 .../Common/GUI/PlusGUI/Control/server-scope.sc     |    3 +-
 SCClassLibrary/QtCollider/QStethoscope2.sc         |  226 +++++++++++++-------
 4 files changed, 161 insertions(+), 81 deletions(-)

hooks/post-receive
--

-- 
supercollider

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Jakob Leben | 1 Dec 04:11 2011
Picon

Re: freeing the resulting Synth right after SynthDef-play

Thanks, that helped!
J.

On Wed, Nov 30, 2011 at 2:53 PM, Sciss <contact@...> wrote:
> the problem is you create a new synth def which is asynchronous, while free is synchronous.
>
> if you must create a synth def here, i think the solution would be to send the free asynchronously. i
remember i was having the same problem long time ago. not sure i found a way to send it asynchronously
without gaga. i mean, you can use a dummy buffer command and put the freemsg as 'completion' :)
>
> as a quick workaround, you can probably instead of synth.free do a fork { s.sync; synth.free }
>
> it gets a bit complicated though. like
>
> if( ~synth.notNil, { var x = ~synth; fork { s.sync; x.free }});
> ~synth = SynthDef( ... ).play
>
>
> best, -sciss-
>
>
>
>
> On 30 Nov 2011, at 13:35, Jakob Leben wrote:
>
>> Hi,
>>
>> I have a problem that I don't know how to solve. Maybe someone who
>> knows more about lang-server messaging could help.
>>
>> Observe the following code:
>>
>> NumberBox().action_({
>>       if(~synth.notNil) {~synth.free};
>>       ~synth = SynthDef(\dummy, {}).play;
>> })
>>
>> It is possible to scroll the number box so fast that the synth created
>> by previous action has not been instantiated on the server yet by the
>> time the next action tries to free it, and will thus never be freed.
>>
>> I wonder if it is possible to "postpone/schedule" the freeing until it
>> make sense - i.e. until the synth is instantiated on the server; or
>> prevent instantiation at all?
>> Note that ideally, the view's action should still run asynchronously
>> in relation to communication with the server - I would like to avoid
>> blocking in the action until the synth actually starts playing.
>>
>> _______________________________________________
>> sc-dev mailing list
>>
>> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
>> archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
>> search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/
>
>
> _______________________________________________
> sc-dev mailing list
>
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
> search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Jakob Leben | 1 Dec 04:18 2011
Picon

Re: [PATCH] class library: QStethoscope2 - provide setProperties

On Tue, Nov 29, 2011 at 12:30 PM, Tim Blechmann <tim@...> wrote:
> it would be very cool, if the scope simply registers a ServerBoot action and
> starts automatically!

Behold, the coolness has landed into the topic/shmem_server branch!

Cheers,
J.

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Josh Parmenter | 1 Dec 04:42 2011
Picon

Re: [PATCH] class library: QStethoscope2 - provide setProperties

On Nov 30, 2011, at 7:18 PM, Jakob Leben wrote:

> On Tue, Nov 29, 2011 at 12:30 PM, Tim Blechmann <tim@...> wrote:
>> it would be very cool, if the scope simply registers a ServerBoot action and
>> starts automatically!
> 
> Behold, the coolness has landed into the topic/shmem_server branch!
> 
cool!

any ideas about the cycle / win bounds issue?

Josh

> Cheers,
> J.
> 
> _______________________________________________
> sc-dev mailing list
> 
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
> search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/

“Every composer – at all times and in all cases – gives his own interpretation of how modern society is
structured: whether actively or passively, consciously or unconsciously, he makes choices in this
regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a
revolutionary, historical or social palingenesis." - Luigi Nono
*/

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Jakob Leben | 1 Dec 05:03 2011
Picon

Re: [PATCH] class library: QStethoscope2 - provide setProperties

On Thu, Dec 1, 2011 at 4:42 AM, Josh Parmenter
<josh@...> wrote:
> any ideas about the cycle / win bounds issue?

I have a simple idea... i'll send a patch to see if it changes
anything. I'm on IRC, if you wish...

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Jakob Leben | 1 Dec 06:37 2011
Picon
Picon

SF.net Git: supercollider branch, topic/shmem_server, updated. 8424f2c7b39953b4680b8ed0cd5222ca8c238c9b

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "supercollider".

The branch, topic/shmem_server has been updated
       via  8424f2c7b39953b4680b8ed0cd5222ca8c238c9b (commit)
      from  b678ab533636eee8a70c9e9c64be1a8be263030b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8424f2c7b39953b4680b8ed0cd5222ca8c238c9b
Author: Jakob Leben <jakob.leben@...>
Date:   Thu Dec 1 06:34:19 2011 +0100

    qtcollider: QStethoscope2: improve performance on OS X

    On OS X it is much faster to draw one complex QPainterPath than
    call QPainter::drawLine for every line segment.

diff --git a/QtCollider/widgets/QcScopeShm.cpp b/QtCollider/widgets/QcScopeShm.cpp
index c9bbea3..bcff2cb 100644
--- a/QtCollider/widgets/QcScopeShm.cpp
+++ b/QtCollider/widgets/QcScopeShm.cpp
 <at>  <at>  -231,11 +231,12  <at>  <at>  void QcScopeShm::paint1D( bool overlapped, int chanCount, int maxFrames, int fra

       painter.save();
       painter.translate( area.x(), area.y() + yOrigin );
-      painter.scale( 1, yRatio );
       QPen pen(color);
-      pen.setWidth(0);
+      pen.setCapStyle( Qt::FlatCap );
       painter.setPen(pen);

+      QPainterPath path;
+
       int p=0, f=1; // pixel, frame
       float min, max;
       min = max = frameData[0];
 <at>  <at>  -252,15 +253,19  <at>  <at>  void QcScopeShm::paint1D( bool overlapped, int chanCount, int maxFrames, int fra
         }

         qreal x = p-1;
-        QLineF line( x, min, x, max );
-        painter.drawLine( line );
+        float y = max * yRatio;
+        path.moveTo( x, y );
+        y = qMax( min * yRatio, y+1 );
+        path.lineTo( x, y );

-        // flip min/max to ensure continuity (expand by one pixel worth of value)
+        // flip min/max to ensure continuity
         float val = min;
-        min = max + ypix;
-        max = val - ypix;
+        min = max;
+        max = val;
       }

+      painter.drawPath(path);
+
       painter.restore();
     }
   }
-----------------------------------------------------------------------

Summary of changes:
 QtCollider/widgets/QcScopeShm.cpp |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

hooks/post-receive
--

-- 
supercollider

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Julian Rohrhuber | 1 Dec 09:59 2011
Picon

Re: [commit?] new osc command n_setni


On 01.12.2011, at 01:15, James Harkins wrote:

> At Thu, 01 Dec 2011 00:06:51 +0100,
> Julian Rohrhuber wrote:
>> Here is a different solution, using bookkeeping on the sclang side. It adds a dictionary that maps from
name to index to the SynthDesc. This is reasonably fast as a solution that methods for Node and NodeProxy
could use.
> 
> Heh heh... only yesterday, I was mulling over exactly the same idea on the bus. It would eliminate the O(1)
search through the synthdesc's controlNames.
> 
> I like it :)
> hjh
> 

thinking about it, it may be better to keep a dictionary of ControlDescs, which carry more info. They could
also be in the metadata of the SynthDef.

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/


Gmane