[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] SF.net SVN: quarks:[1294] DataNetwork
Revision: 1294
http://quarks.svn.sourceforge.net/quarks/?rev=1294&view=rev
Author: nescivi
Date: 2009-12-18 03:41:50 +0000 (Fri, 18 Dec 2009)
Log Message:
-----------
more examples in documentation and gui fix for the client
Modified Paths:
--------------
DataNetwork/Help/SWDataNetwork.html
DataNetwork/Help/SWDataNetworkClient.html
DataNetwork/Help/SWDataNode.html
DataNetwork/Help/SWDataSlot.html
DataNetwork/Help/SenseWorldDataNetwork.html
DataNetwork/SWDataNetworkClientGui.sc
Modified: DataNetwork/Help/SWDataNetwork.html
===================================================================
--- DataNetwork/Help/SWDataNetwork.html 2009-12-17 20:04:11 UTC (rev 1293)
+++ DataNetwork/Help/SWDataNetwork.html 2009-12-18 03:41:50 UTC (rev 1294)
@@ -75,6 +75,43 @@
SWDataNetwork</A></H2>
<H3>Base class for the Sense World Data Network.</H3>
+
+<h4>Some nomenclature:</h4>
+<p>
+A <strong>DataNode</strong>, or a node, is a collection of data streams which somehow belong together.<br>
+For example, this can be representing:<br>
+
+<UL>
+ <LI>A SenseStage MiniBee hardware sensor node with sensors attached</LI>
+ <LI>All the parameters of a sound process (amplitude, frequency, etc)</LI>
+ <LI>A group of (DMX) light channels</LI>
+ <LI>Showtime information (hours, minutes, seconds, frame)</LI>
+ <LI>All the light sensors in a space, collected in a logical order</LI>
+ <LI>All the parameters of a graphical object (dimensions, color)</LI>
+ <LI>All the data from a gaming device, such as a joystick</LI>
+</UL>
+
+<p>An <strong>expected Node</strong> is a DataNode that is prepared to be added to the network, but may not be present yet.</p>
+
+<p>A <strong>DataSlot</strong>, or a slot, is one datastream. So corresponding to the examples of nodes above a slot would represent:<br>
+
+<UL>
+ <LI>A light sensor attached to a MiniBee</LI>
+ <LI>One axis of an acclerometer attached to a MiniBee</LI>
+ <LI>The amplitude of a sound process</LI>
+ <LI>One DMX light channel</LI>
+ <LI>The seconds of the showtime</LI>
+ <LI>The x-dimension of a graphical object</LI>
+ <LI>The y-axis of a joystick</LI>
+</UL>
+
+<p><strong>A client:</strong> the programming environment of one collaborator hooked up to the network. E.g. Joe, using PureData, or Marije, using SuperCollider, or Vincent, using Processing, or Brett, using Max/MSP.</p>
+
+<p><strong>Subscription:</strong> a client can subscribe to a node to receive its data, or subscribe to a single slot of a node. These are called the client's subscriptions.</p>
+
+<p><strong>Setter:</strong> a client can provide data to the network by creating a DataNode. The client then becomes the "setter" of the node. Other clients can not set data to the same node.</p>
+
+
<h4>- Example - </h4>
<pre>
Modified: DataNetwork/Help/SWDataNetworkClient.html
===================================================================
--- DataNetwork/Help/SWDataNetworkClient.html 2009-12-17 20:04:11 UTC (rev 1293)
+++ DataNetwork/Help/SWDataNetworkClient.html 2009-12-18 03:41:50 UTC (rev 1294)
@@ -37,6 +37,252 @@
This class is a subclass of SWDataNetwork, so the methods used in that class can be used in this class as well. In some cases methods have an additional argument, which only need to be set, when called internally, so the user interface is the same as when using SWDataNetwork. Access to nodes, slots and their data is just the same as for a local network.
</p>
<p>There are some additional methods to send out OSC messages, or for internal use.</p>
+
+
+<h4>Some nomenclature:</h4>
+<p>
+A <strong>DataNode</strong>, or a node, is a collection of data streams which somehow belong together.<br>
+For example, this can be representing:<br>
+
+<UL>
+ <LI>A SenseStage MiniBee hardware sensor node with sensors attached</LI>
+ <LI>All the parameters of a sound process (amplitude, frequency, etc)</LI>
+ <LI>A group of (DMX) light channels</LI>
+ <LI>Showtime information (hours, minutes, seconds, frame)</LI>
+ <LI>All the light sensors in a space, collected in a logical order</LI>
+ <LI>All the parameters of a graphical object (dimensions, color)</LI>
+ <LI>All the data from a gaming device, such as a joystick</LI>
+</UL>
+
+<p>An <strong>expected Node</strong> is a DataNode that is prepared to be added to the network, but may not be present yet.</p>
+
+<p>A <strong>DataSlot</strong>, or a slot, is one datastream. So corresponding to the examples of nodes above a slot would represent:<br>
+
+<UL>
+ <LI>A light sensor attached to a MiniBee</LI>
+ <LI>One axis of an acclerometer attached to a MiniBee</LI>
+ <LI>The amplitude of a sound process</LI>
+ <LI>One DMX light channel</LI>
+ <LI>The seconds of the showtime</LI>
+ <LI>The x-dimension of a graphical object</LI>
+ <LI>The y-axis of a joystick</LI>
+</UL>
+
+<p><strong>A client:</strong> the programming environment of one collaborator hooked up to the network. E.g. Joe, using PureData, or Marije, using SuperCollider, or Vincent, using Processing, or Brett, using Max/MSP.</p>
+
+<p><strong>Subscription:</strong> a client can subscribe to a node to receive its data, or subscribe to a single slot of a node. These are called the client's subscriptions.</p>
+
+<p><strong>Setter:</strong> a client can provide data to the network by creating a DataNode. The client then becomes the "setter" of the node. Other clients can not set data to the same node.</p>
+
+
+<h4>- Example - </h4>
+
+<pre>
+
+// create a network client:
+y = SWDataNetworkClient.new( "192.168.0.104", "myname" );
+
+/*
+The first argument is the IP address of the datanetwork host,
+this address is shown in the basic GUI on the host in the lower right corner.
+
+The second argument "myname" is the name by which you (as a client)
+will be identified in the network, and should be unique among all
+clients (all collaborators in the project). It is used to remember
+your subscriptions and "setters" when you reconnect to the host,
+e.g. when you restart supercollider (recompile the library) and
+re-execute the code.
+
+The client will find the port of the host automatically, and register.
+If the host goes down, the client will search for the host, and react
+to an announce message from the host to reconnect.
+
+The client will automatically unregister, if you recompile the language,
+or quit SuperCollider.
+*/
+
+
+//------------ Querying:
+
+/*
+You can make queries about which nodes and which slots are present in
+the network.
+
+After you are registered, you will automatically receive info messages
+on any new nodes and slots
+*/
+
+// query which nodes are present; this sends a message to the host:
+y.queryNodes; // the result will print out a lot of informational messages.
+
+// to see which nodes are present (local check,
+// not sending a message to the host):
+y.nodes;
+
+// query which nodes are expected, this sends a message to the host:
+y.queryExpected;
+
+// to see which nodes are expected (local check, not sending
+// a message to the host:
+y.expectedNodes;
+
+// query which slots are present, this sends a message to the host:
+y.querySlots;
+
+
+// query which other clients are present (sending message to host):
+y.queryClients;
+
+// query to which nodes you are subscribed (sending message to host):
+y.querySubscriptions;
+
+// query of which nodes you are the setter (sending message to host):
+y.querySetters;
+
+// perform all of the queries (sending message to host):
+y.queryAll;
+
+
+//------------ Subscribing to a node:
+
+// subscribe to node 101, by number:
+y.subscribeNode( 101 );
+
+// subscribe to node 102 by passing in an instance of SWDataNode as an argument:
+y.subscribeNode( y.nodes[102] );
+
+
+// a lot of the interaction with the DataNetwork can also be
+// done through a graphical user interface:
+y.makeGui;
+
+// -------- working with the data node:
+
+// get a reference to a DataNode in a variable:
+a = y.nodes[102];
+
+// if the node has a label, you acces it by its label:
+a = y[\minibee102];
+
+// access the values of all slots of the node:
+a.value;
+
+(
+SynthDef(\swexample,{ |out=0,amp=0.1,freq=400|
+ Out.ar( out, SinOsc.ar( freq, 0, amp ) );
+}).send(s)
+)
+
+// use it at synth instantiation:
+b = Synth.new( \swexample, [\amp,a.value ] );
+
+// set it again:
+b.set( \amp, a.value );
+
+// free the synth
+b.free;
+
+// instead of setting it manually each time, you can assign
+// an action to the data node to do this automatically:
+
+b = Synth.new( \swexample, [\amp,a.value ] );
+
+a.action= { |data| b.set( \amp, data )};
+
+// another method is to put the data automatically on a bus,
+// and grab the data from there:
+
+// reset the action:
+a.action = {};
+
+// create a bus:
+a.createBus(s);
+
+// map the amplitude of b to the bus:
+b.map( \amp, a.bus );
+
+b.free;
+
+// alternatively, you can use In.kr in your synthdef to read
+// from the bus:
+(
+SynthDef(\swexampleBus,{ |out=0,ampbus=0,freq=400|
+ Out.ar( out, SinOsc.ar( freq, 0, In.kr( ampbus, 1 ) ) );
+}).send(s)
+)
+
+b = Synth.new( \swexampleBus, [\ampbus,a.bus ] );
+
+b.free;
+
+
+// -------- working with a single slot of a data node:
+
+// DataNodes can have multiple channels of data, so the above
+// approach is mostly useful for multichannel control of data.
+// You can also work with a single slot of a node, and control a synth:
+
+// get a reference to a DataSlot in a variable:
+a = y.nodes[102].slots[0];
+
+// if the slot has a label, you acces it by its label:
+a = y[\minibee102_slot0];
+
+// access the value of the slot:
+a.value;
+
+(
+SynthDef(\swexample,{ |out=0,amp=0.1,freq=400|
+ Out.ar( out, SinOsc.ar( freq, 0, amp ) );
+}).send(s)
+)
+
+// use it at synth instantiation:
+b = Synth.new( \swexample, [\amp,a.value ] );
+
+// set it again:
+b.set( \amp, a.value );
+
+// free the synth
+b.free;
+
+// instead of setting it manually each time, you can assign
+// an action to the data node to do this automatically:
+
+b = Synth.new( \swexample, [\amp,a.value ] );
+
+a.action= { |data| b.set( \amp, data )};
+
+// another method is to put the data automatically on a bus,
+// and grab the data from there:
+
+// reset the action:
+a.action = {};
+
+// create a bus:
+a.createBus(s);
+
+// map the amplitude of b to the bus:
+b.map( \amp, a.bus );
+
+b.free;
+
+// alternatively, you can use In.kr in your synthdef:
+(
+SynthDef(\swexampleBus,{ |out=0,ampbus=0,freq=400|
+ Out.ar( out, SinOsc.ar( freq, 0, In.kr( ampbus, 1 ) ) );
+}).send(s)
+)
+
+b = Synth.new( \swexampleBus, [\ampbus,a.bus ] );
+
+b.free;
+
+</pre>
+
+
+
+
<DL>
<h3> - Methods - </h3>
Modified: DataNetwork/Help/SWDataNode.html
===================================================================
--- DataNetwork/Help/SWDataNode.html 2009-12-17 20:04:11 UTC (rev 1293)
+++ DataNetwork/Help/SWDataNode.html 2009-12-18 03:41:50 UTC (rev 1294)
@@ -32,7 +32,77 @@
</H2>
Base class for a data node
+<h3>- Example - </h3>
+<pre>
+// create a network client:
+y = SWDataNetworkClient.new( "192.168.0.104", "myname" );
+
+// subscribe to node 102
+y.subscribeNode( 102 );
+
+
+// -------- working with the data node:
+
+// get a reference to a DataNode in a variable:
+a = y.nodes[102];
+
+// if the node has a label, you acces it by its label:
+a = y[\minibee102];
+
+// access the values of all slots of the node:
+a.value;
+
+(
+SynthDef(\swexample,{ |out=0,amp=0.1,freq=400|
+ Out.ar( out, SinOsc.ar( freq, 0, amp ) );
+}).send(s)
+)
+
+// use it at synth instantiation:
+b = Synth.new( \swexample, [\amp,a.value ] );
+
+// set it again:
+b.set( \amp, a.value );
+
+// free the synth
+b.free;
+
+// instead of setting it manually each time, you can assign
+// an action to the data node to do this automatically:
+
+b = Synth.new( \swexample, [\amp,a.value ] );
+
+a.action= { |data| b.set( \amp, data )};
+
+// another method is to put the data automatically on a bus,
+// and grab the data from there:
+
+// reset the action:
+a.action = {};
+
+// create a bus:
+a.createBus(s);
+
+// map the amplitude of b to the bus:
+b.map( \amp, a.bus );
+
+b.free;
+
+// alternatively, you can use In.kr in your synthdef to read
+// from the bus:
+(
+SynthDef(\swexampleBus,{ |out=0,ampbus=0,freq=400|
+ Out.ar( out, SinOsc.ar( freq, 0, In.kr( ampbus, 1 ) ) );
+}).send(s)
+)
+
+b = Synth.new( \swexampleBus, [\ampbus,a.bus ] );
+
+b.free;
+
+</pre>
+
<h3>- Methods - </h3>
<P>
Modified: DataNetwork/Help/SWDataSlot.html
===================================================================
--- DataNetwork/Help/SWDataSlot.html 2009-12-17 20:04:11 UTC (rev 1293)
+++ DataNetwork/Help/SWDataSlot.html 2009-12-18 03:41:50 UTC (rev 1294)
@@ -32,6 +32,83 @@
</H2>
Base class for a data slot.
+
+<h3>- Example - </h3>
+
+<pre>
+
+// create a network client:
+y = SWDataNetworkClient.new( "192.168.0.104", "myname" );
+
+// subscribe to node 102
+y.subscribeNode( 102 );
+
+
+// -------- working with a single slot of a data node:
+
+// DataNodes can have multiple channels of data, so the above
+// approach is mostly useful for multichannel control of data.
+// You can also work with a single slot of a node, and control a synth:
+
+// get a reference to a DataSlot in a variable:
+a = y.nodes[102].slots[0];
+
+// if the slot has a label, you acces it by its label:
+a = y[\minibee102_slot0];
+
+// access the value of the slot:
+a.value;
+
+(
+SynthDef(\swexample,{ |out=0,amp=0.1,freq=400|
+ Out.ar( out, SinOsc.ar( freq, 0, amp ) );
+}).send(s)
+)
+
+// use it at synth instantiation:
+b = Synth.new( \swexample, [\amp,a.value ] );
+
+// set it again:
+b.set( \amp, a.value );
+
+// free the synth
+b.free;
+
+// instead of setting it manually each time, you can assign
+// an action to the data node to do this automatically:
+
+b = Synth.new( \swexample, [\amp,a.value ] );
+
+a.action= { |data| b.set( \amp, data )};
+
+// another method is to put the data automatically on a bus,
+// and grab the data from there:
+
+// reset the action:
+a.action = {};
+
+// create a bus:
+a.createBus(s);
+
+// map the amplitude of b to the bus:
+b.map( \amp, a.bus );
+
+b.free;
+
+// alternatively, you can use In.kr in your synthdef:
+(
+SynthDef(\swexampleBus,{ |out=0,ampbus=0,freq=400|
+ Out.ar( out, SinOsc.ar( freq, 0, In.kr( ampbus, 1 ) ) );
+}).send(s)
+)
+
+b = Synth.new( \swexampleBus, [\ampbus,a.bus ] );
+
+b.free;
+
+</pre>
+
+
<h3>- Methods - </h3>
<P>
<DL>
Modified: DataNetwork/Help/SenseWorldDataNetwork.html
===================================================================
--- DataNetwork/Help/SenseWorldDataNetwork.html 2009-12-17 20:04:11 UTC (rev 1293)
+++ DataNetwork/Help/SenseWorldDataNetwork.html 2009-12-18 03:41:50 UTC (rev 1294)
@@ -40,6 +40,9 @@
</p>
+
+
+
<H3><A NAME="SECTION00010000000000000000">
Data Network Elements</A>
</H3>
@@ -71,6 +74,93 @@
Each <em>DataNode</em> and each <em>DataSlot</em> can be given a label, so that their functionality becomes more human understandable.
</P>
+
+<h4>Some nomenclature:</h4>
+<p>
+A <strong>DataNode</strong>, or a node, is a collection of data streams which somehow belong together.<br>
+For example, this can be representing:<br>
+
+<UL>
+ <LI>A SenseStage MiniBee hardware sensor node with sensors attached</LI>
+ <LI>All the parameters of a sound process (amplitude, frequency, etc)</LI>
+ <LI>A group of (DMX) light channels</LI>
+ <LI>Showtime information (hours, minutes, seconds, frame)</LI>
+ <LI>All the light sensors in a space, collected in a logical order</LI>
+ <LI>All the parameters of a graphical object (dimensions, color)</LI>
+ <LI>All the data from a gaming device, such as a joystick</LI>
+</UL>
+
+<p>An <strong>expected Node</strong> is a DataNode that is prepared to be added to the network, but may not be present yet.</p>
+
+<p>A <strong>DataSlot</strong>, or a slot, is one datastream. So corresponding to the examples of nodes above a slot would represent:<br>
+
+<UL>
+ <LI>A light sensor attached to a MiniBee</LI>
+ <LI>One axis of an acclerometer attached to a MiniBee</LI>
+ <LI>The amplitude of a sound process</LI>
+ <LI>One DMX light channel</LI>
+ <LI>The seconds of the showtime</LI>
+ <LI>The x-dimension of a graphical object</LI>
+ <LI>The y-axis of a joystick</LI>
+</UL>
+
+<p><strong>A client:</strong> the programming environment of one collaborator hooked up to the network. E.g. Joe, using PureData, or Marije, using SuperCollider, or Vincent, using Processing, or Brett, using Max/MSP.</p>
+
+<p><strong>Subscription:</strong> a client can subscribe to a node to receive its data, or subscribe to a single slot of a node. These are called the client's subscriptions.</p>
+
+<p><strong>Setter:</strong> a client can provide data to the network by creating a DataNode. The client then becomes the "setter" of the node. Other clients can not set data to the same node.</p>
+
+
+<H3>SuperCollider implementation</H3>
+
+Within SuperCollider the implementation is done in a number of classes.
+
+
+<p>
+<A HREF="SWDataNetwork.html">SWDataNetwork</A> is the basic implementation of the DataNetwork. You can use it in a local project to manage your datastreams within SC (not communicating with other programs), or become the host of the DataNetwork by calling the method, <em>addOSCInterface</em>. It is also the base class of <A HREF="SWDataNetworkClient.html">SWDataNetworkClient</A>, so the common usage interface between the host and the client is the same. The client has some extra methods for registering, subscribing and querying.
+</p>
+
+<p>You can easily create a <A HREF="SWDataNetworkGui.html">graphical user interface</A> for the DataNetwork with the methods <em>makeGui</em> and <em>makeBasicGui</em>.
+</p>
+
+
+<p><A
+ HREF="SWDataNode.html">SWDataNode</A> - <A
+ HREF="SWDataStringNode.html">SWDataStringNode</A> are the implementations of the DataNode. You usually access them by number or by name from the DataNetwork instance.
+</p>
+<p><A
+ HREF="SWDataSlot.html">SWDataSlot</A> - <A
+ HREF="SWDataStringSlot.html">SWDataStringSlot</A> are the implementations of the DataSlots. You usually access them by number or by name from the DataNetwork instance.
+</p>
+
+<p><A
+ HREF="SWDataNetworkLog.html">SWDataNetworkLog</A> can be used to read a logfile of the DataNetwork and play the data back into a DataNetwork.
+</p>
+
+
+<p><A
+ HREF="SWDataNetworkSpec.html">SWDataNetworkSpec</A>, <A
+ HREF="SWDataNetworkOSC.html">SWDataNetworkOSC</A>, and <A
+ HREF="SWDataNetworkOSCClient.html">SWDataNetworkOSCClient</A> are used internally to handle labeling of DataNodes and DataSlots, and the OSC communication of the host.
+</p>
+
+
+<p>There are methods for easily adding <A
+ HREF="SWGeneralHID.html">GeneralHID devices</A> and <A
+ HREF="SWWiiMote.html">WiiMotes</A> to the network. There are also extensions to use data from the DataNetwork in <A
+ HREF="SWDataPattern.html">Patterns</A>.</p>
+
+
+<p><A
+ HREF="SWBusNode.html">SWBusNode</A>, <A
+ HREF="SWWatcherNode.html">SWWatcherNode</A>, <A
+ HREF="SWBusWatcherNode.html">SWBusWatcherNode</A>, <A
+ HREF="SWCombineNode.html">SWCombineNode</A> and <A
+ HREF="SWDataAction.html">SWDataAction</A> are classes to use to process data from the datanetwork and create derived or conditioned data.
+</p>
+
+
+
<H3><A NAME="SECTION00020000000000000000">
OSC interface</A>
</H3>
@@ -103,7 +193,7 @@
<P>
Clients for other software environments are available in the Help/Clients directory.
<BR>
-Currently there are Max patches for Max4.6 and Max5 (created by Harry Smoak, Joseph Malloch and Brett Bergmann)
+Currently there are Max patches for Max4.6 and Max5 (created by Harry Smoak, Joseph Malloch and Brett Bergmann), PureData (Pd) patches (created by Joseph Thibodeau), a Processing and Java library (Vincent de Belleval), and a C++ library (created by Marije Baalman).
</P>
<H3><A NAME="SECTION00040000000000000000">
Futher documentation</A>
Modified: DataNetwork/SWDataNetworkClientGui.sc
===================================================================
--- DataNetwork/SWDataNetworkClientGui.sc 2009-12-17 20:04:11 UTC (rev 1293)
+++ DataNetwork/SWDataNetworkClientGui.sc 2009-12-18 03:41:50 UTC (rev 1294)
@@ -1,7 +1,7 @@
SWDataSlotClientGui : SWDataSlotGui {
var <sub,<get;
- var <xsize = 180;
+ var <xsize = 185;
addSubButton{
sub = GUI.button.new( cw, Rect( 0, 0, 25, 16 )).states_(
@@ -27,8 +27,8 @@
}
SWDataNodeClientGui : SWDataNodeGui {
- classvar <>xsize = 305;
- classvar <>xsizeBig = 258;
+ classvar <>xsize = 310;
+ classvar <>xsizeBig = 263;
classvar <slottype;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/