[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] wooh-kiki-woohwooh - Sequencing from text, using BufRd and Phasor
On Monday, December 29, 2003, at 01:34 AM, Andrew Robinson wrote:
Hi List,
I am wanting to sequence the playback of sections of sound files by associating them with sections of text.
I am using the 19 December 2003 binary snapshot on OSX.
Using a11wlk01.wav as an example, and given that I have manually determined the sample numbers involved eg.
beep(0 - 4800), Columbia(4800 - 8900), this(8900 - 11000) - etc etc
I want to be able to hear things like
" over beep this is beep this is Houston, Columbia"
just be typing that as textual input.
*********************************************************
My immediate problem is (see code below this email)
How do I stop the Synthdefs from looping?
Probably something to do with the Phasor object.
*********************************************************
Problems for later:
1. I need a generalised way of parsing text into discrete elements, some of which may appear to be part of another whole
eg. 'the' and 'at' are part of 'theatre'
foo = "over beep this is beep this is houston columbia".split($ ); // note the space after $
foo.do({ arg word; ... });
or you could write your own similar and more specialized method
2. I need something which can read through these elements at a constant pace, possibly interpreting some markup elements for timing and intonation. (full stop, comma, question, etc etc)
Task({
foo.do({ arg word;
... time = someVal ...
time.wait
})
}).play
3. I need a way of storing text elements and their associated sample numbers with the file name.
I suspect that 1,2 and 3 would all be best implemented in a regular programming language.
SCLang is a regular programming language :)
it would be real nice to have regex though
The 'reader' would just send OSC to SCServer.
I still need to deal with allocating, creating and destroying a lot of node id's though. I know there are SC3 objects that do this.
Is this the best way? Would there be any need for SCLang objects?
If anyone could supply me with an outline of an appropriate architecture, and the SC3 objects I should be using to achieve this, that would be much appreciated.
Thanks
Andrew
The problem with the code below is that the elements (beep, columbia, this) are looping:
(
s=Server.local; if(not(s.serverRunning), {s.boot});
s.sendMsg("/b_allocRead", 0, "sounds/a11wlk01.wav");
)
(
"beep",{
var retval;
retval = BufRd.ar(1, 0, Phasor.ar(0, BufRateScale.kr(0), 0, 4800,4800));
Out.ar(0, retval);
}).load(s);
"columbia",{
var retval;
retval = BufRd.ar(1, 0, Phasor.ar(0, BufRateScale.kr(0), 4800, 8900));
Out.ar(0, retval);
}).load(s);
"this",{
var retval;
retval = BufRd.ar(1, 0, Phasor.ar(0, BufRateScale.kr(0), 8900, 11000));
Out.ar(0, retval);
}).load(s);
you should probably be sending your buffer id, sample start, and end point values as
args on Synth instantiation. it would be much more flexible, and you would need
only one SynthDef. then you could look up all your relevant Synth args in a dict, something like:
SynthDef("playWord", { arg buf, start, end;
...
});
foo = "columbia this".split($ );
argDict = (
\columbia : [ \buf, 0, \start, 4800, \end, 8900 ]
\this ...
);
foo.do({ arg word;
Synth("playWord", argDict[word.asSymbol] );
})
in answer to question 3) above:
argDict.writeArchive( "foo.scar" );
unArchivedDict = Object.readArchive("foo.scar");
unArchivedDict[\columbia];
[ \buf, 0, \start, 4800, \end, 8900 ]
you could store the file name in the dict or archive an array ["filename", argDict].
also, your arguments to BufRd are wrong which is why it don't work.
hope that helps,
_c
)
//Load these synthdefs
(
s.sendMsg("synthdefs/beep.scsyndef");
s.sendMsg("synthdefs/columbia.scsyndef");
s.sendMsg("synthdefs/this.scsyndef");
)
//Start the synthdefs, and allocate to a node and group
s.sendMsg("/s_new", "beep", 1000, 1, 0);
s.sendMsg("/s_new", "columbia", 1001, 1, 0);
s.sendMsg("/s_new", "this", 1002, 1, 0);
//s.sendMsg("/s_new", "sine", 1001, 3, 1000, \freq, 450);
//deallocate the nodes
s.sendMsg("/n_free", 1000); //stop Node 1000
s.sendMsg("/n_free", 1001); //stop Node 1001
s.sendMsg("/n_free", 1002);
_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users