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

[sc-users] wooh-kiki-woohwooh - Sequencing from text, using BufRd and Phasor



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'

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)

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.

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);

)

//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);