[ecasound] looping samples

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [ecasound] looping samples
From: OXullo Intersecans (xi_AT_reiko.tmh.it)
Date: Tue May 07 2002 - 13:20:52 EEST


I'm working on a system that will be used on a special event here in
Perugia (Italy), called Umbria Jazz '02.
I'm building a complete feedback interface with 15 inputs (infrared sensors)
which are routed to the main processing logic of a program that would use
these data as parameters for RT-FX over 5 audio stream (3 sensors per
Now I'm searching for a kind of effects processing substructure to help me
in the coding phase of my work.
I found ecasound very attractive on the robustness and manageability side.
All I have to do eventually with this core is:

no sensors interaction for the stream -> stream is stopped
one of the three sensors are catching interaction -> stream starts
first sensor interaction value=0..255 -> amplitude set to f(value) RT
second sensor interaction value=0..255 -> cop-1 copp-(x) set to f(value) RT
third sensor interaction value=0..255 -> cop-2 copp-(x) set to f(value) RT
no sensors interaction -> continue streaming for n seconds and stop it

In this first evaluation time I found a little problem:

My samples have not the same length and I have to loop them in a way that
is not directly compatible with the chain setup loop (which loops basing
on the longest sample)
However I would not use the -tl, because of the indipendent behaviour of
the streams.
But I tried this way (C++, ECI):


 e.command("cs-add prova");
 e.command("cs-set-param -b:128");

 e.command("c-add 1st");
 e.command("ai-add /war/02l/sim00.wav");

 e.command("c-add 2nd");
 e.command("ai-add /war/02l/sim01.wav");

 e.command("c-add 1st,2nd");
 e.command("ao-add /dev/dsp");


 e.command("ai-index-select 1");
 lengths[0] = e.last_float(); (int lengths[2])

 e.command("ai-index-select 2");
 lengths[1] = e.last_float();

Now I do a forever cycle with a 50us cycle delay in which is contained
this check:

 for (int i=0 ; i<2 ; i++)
   e.command("ai-index-select "+(i+1));

   double curpos = e.last_float();

   if (curpos==lengths[i]) e.command("ai-setpos 0");

This could be useful for me (even if it's awful), because in this way I
can control every single stream.
But sometimes the engine stops (in 'finished' status), because the
ai-setpos would not rewind in time the stream so it consider it terminated

Can you give me an hint?
I would appreciate very much!

Thanks in advance,
kind regards

Marco Fagiolini

To unsubscribe send message 'unsubscribe' in the body of the
message to <ecasound-list-request_AT_wakkanet.fi>.

New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue May 07 2002 - 13:10:25 EEST