[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] retrieve samples from a buffer in the server?



You actually need an OSCresponder to grab data from the Server:

(
s = Server.local;
// allocate and fill tables 0 to 7
8.do({ arg i;
  var n, a;
  // allocate table
  s.sendMsg(\b_alloc, i, 1024);
  // generate array of harmonic amplitudes
  n = (i+1)**2;
  a = Array.fill(n, { arg j; ((n-j)/n).squared.round(0.001) });
  // fill table
  s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
});
)

o = OSCresponderNode(s.addr, '/b_setn', {arg time, resp, msgs;
	d = msgs[4..515].postln;
	});
	
o.add;

s.sendMsg(\b_getn, 1, 0, 512);

// the data is in 'd'

d;

// you can plot it

d.plot;

// clean up the responder
o.remove;

Hope that helps

Best,

Josh

On May 5, 2009, at 8:55 PM, padovani wrote:

(
s = Server.local;
// allocate and fill tables 0 to 7
8.do({ arg i;
  var n, a;
  // allocate table
  s.sendMsg(\b_alloc, i, 1024);
  // generate array of harmonic amplitudes
  n = (i+1)**2;
  a = Array.fill(n, { arg j; ((n-j)/n).squared.round(0.001) });
  // fill table
  s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
});
)

and here is what I am trying to get the samples...

s.sendMsg(\b_get, 0, [0, 512]);

******************************************
/* 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-users mailing list

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