Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Score rewinding

Date2005-05-09 22:19
FromVictor Lazzarini
SubjectRe: [Cs-dev] Score rewinding
This is becoming a bit boring to everyone, but I can't
get rewinding to work, after updating from CVS. I"ll leave
it
at that, having implemented an equivalent version by
reseting and compiling again.

Anyway a couple of things I discovered:

1. sending 'e' to scoreEvent() (and eventually to
sensevents())
causes the engine to crash. That doesn't happen in 4.23.

2.Although much more clean and having trouble-free
running, inclunding destroying-recreating *csound objects,
the engine still has trouble with more than one concurrent
instance. It doesn't crash, which is an achievement, but
it doesn't work properly.

Compared to 4.23, it is much much better, as with that one
resetting and other things sometimes lead to crashes. I
suppose
we are close to re-entrancy, but not there yet.

Victor
>
> I'll try that tonight, thanks.
>
> At 17:53 09/05/2005, you wrote:
> >Victor Lazzarini wrote:
> >
> >>I have to check my code, but at the moment, even when
> it's >>playing if I rewind, it goes back to the beginning,
> but csoundPerformKsmps() >>stops playing.
> >
> >Does it work after updating from developer CVS ? I have
> just committed >a fix that prevents rdscor() from closing
> the file at EOF. >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by: NEC IT Guy Games.
> >Get your fingers limbered up and give it your best shot.
> 4 great events, 4 >opportunities to win big! Highest score
> wins.NEC IT Guy Games. Play to >win an NEC 61 plasma
> display. Visit http://www.necitguy.com/?r=20
> >_______________________________________________
> >Csound-devel mailing list
> >Csound-devel@lists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> Victor Lazzarini
> Music Technology Laboratory
> Music Department
> National University of Ireland, Maynooth
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.
> Get your fingers limbered up and give it your best shot. 4
> great events, 4 opportunities to win big! Highest score
> wins.NEC IT Guy Games. Play to win an NEC 61 plasma
> display. Visit http://www.necitguy.com/?r=20
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-09 22:41
FromIstvan Varga
SubjectRe: [Cs-dev] Score rewinding
Victor Lazzarini wrote:

> 1. sending 'e' to scoreEvent() (and eventually to
> sensevents())
> causes the engine to crash. That doesn't happen in 4.23.

I have fixed this now, and committed the changes to CVS.


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-09 22:45
FromIstvan Varga
SubjectRe: [Cs-dev] Score rewinding
Victor Lazzarini wrote:

> This is becoming a bit boring to everyone, but I can't
> get rewinding to work, after updating from CVS.

Could you post an example of code that tries to rewind
the score but does not work ?

> 2.Although much more clean and having trouble-free
> running, inclunding destroying-recreating *csound objects,
> the engine still has trouble with more than one concurrent
> instance. It doesn't crash, which is an achievement, but
> it doesn't work properly.

I am very interested in details about areas that do not work.


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-10 12:39
FromIstvan Varga
SubjectRe: [Cs-dev] Score rewinding
Victor Lazzarini wrote:
> 2.Although much more clean and having trouble-free
> running, inclunding destroying-recreating *csound objects,
> the engine still has trouble with more than one concurrent
> instance. It doesn't crash, which is an achievement, but
> it doesn't work properly.

Can you provide more details about what did not work ? It would
be much easier to fix then. It is known that a number of opcodes
and features (e.g. cscore, graphs, spectral/analysis related
opcodes etc.) have problems, but the following example worked for
me on Linux, rendering two instances of "Trapped" in real time.

/* Console Csound using the Csound API. */

#include "csoundCore.h"
#include "csound.h"
#include "csmodule.h"
#include 
#include 
#include 

static const int argc1 = 4;
static const int argc2 = 4;

static const char *argv1[] = {
     "csound", "examples/trapped.csd", "-o", "dac:front", NULL
};

static const char *argv2[] = {
     "csound", "examples/trapped.csd", "-o", "dac:rear", NULL
};

typedef struct {
     int   argc;
     const char  **argv;
} ARGS;

static const ARGS args1 = { argc1, &argv1[0] };
static const ARGS args2 = { argc2, &argv2[0] };

static void *foobar(void *args)
{
     int argc = ((ARGS*) args)->argc;
     char **argv = (char**) ((ARGS*) args)->argv;
     void  *csound;
     int   result;
     /*  Create Csound. */
     csound = csoundCreate(NULL);
     /*  One complete performance cycle. */
     result = csoundCompile(csound, argc, argv);
     if (!result) {
       /* do not need csoundYield(), kperf() will call it */
       while (csoundPerformKsmps(csound) == 0);
     }
     /* delete Csound instance */
     csoundDestroy(csound);
     return NULL;
}

int main(int argc, char **argv)
{
     pthread_t th1, th2;

     pthread_create(&th1, NULL, foobar, (void*) &args1);
     usleep(2000000);
     pthread_create(&th2, NULL, foobar, (void*) &args2);
     while(1);
     return 0;
}


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-10 13:30
FromVictor Lazzarini
SubjectRe: [Cs-dev] Score rewinding
With the PD object, I only seem be able to run one csoundapi instance at a 
time.
If I close one of the instances, the other one (that was muted) starts to play.

The difference between the way a PD object works and your example is
that the two instances would have to run in the same thread.

But this should work: PD will put the calls to csoundPerformKsmps of
the different instances in a certain order and collect the output.

Victor

At 12:39 10/05/2005, you wrote:
>Victor Lazzarini wrote:
>>2.Although much more clean and having trouble-free
>>running, inclunding destroying-recreating *csound objects,
>>the engine still has trouble with more than one concurrent
>>instance. It doesn't crash, which is an achievement, but
>>it doesn't work properly.
>
>Can you provide more details about what did not work ? It would
>be much easier to fix then. It is known that a number of opcodes
>and features (e.g. cscore, graphs, spectral/analysis related
>opcodes etc.) have problems, but the following example worked for
>me on Linux, rendering two instances of "Trapped" in real time.
>
>/* Console Csound using the Csound API. */
>
>#include "csoundCore.h"
>#include "csound.h"
>#include "csmodule.h"
>#include 
>#include 
>#include 
>
>static const int argc1 = 4;
>static const int argc2 = 4;
>
>static const char *argv1[] = {
>     "csound", "examples/trapped.csd", "-o", "dac:front", NULL
>};
>
>static const char *argv2[] = {
>     "csound", "examples/trapped.csd", "-o", "dac:rear", NULL
>};
>
>typedef struct {
>     int   argc;
>     const char  **argv;
>} ARGS;
>
>static const ARGS args1 = { argc1, &argv1[0] };
>static const ARGS args2 = { argc2, &argv2[0] };
>
>static void *foobar(void *args)
>{
>     int argc = ((ARGS*) args)->argc;
>     char **argv = (char**) ((ARGS*) args)->argv;
>     void  *csound;
>     int   result;
>     /*  Create Csound. */
>     csound = csoundCreate(NULL);
>     /*  One complete performance cycle. */
>     result = csoundCompile(csound, argc, argv);
>     if (!result) {
>       /* do not need csoundYield(), kperf() will call it */
>       while (csoundPerformKsmps(csound) == 0);
>     }
>     /* delete Csound instance */
>     csoundDestroy(csound);
>     return NULL;
>}
>
>int main(int argc, char **argv)
>{
>     pthread_t th1, th2;
>
>     pthread_create(&th1, NULL, foobar, (void*) &args1);
>     usleep(2000000);
>     pthread_create(&th2, NULL, foobar, (void*) &args2);
>     while(1);
>     return 0;
>}
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by Oracle Space Sweepstakes
>Want to be the first software developer in space?
>Enter now for the Oracle Space Sweepstakes!
>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-10 13:54
From"istvan_v@mailbox.hu"
SubjectRe: [Cs-dev] Score rewinding
Victor Lazzarini wrote:

> With the PD object, I only seem be able to run one csoundapi instance at a
> time.
> If I close one of the instances, the other one (that was muted) starts 
> to play.

Is the muting implemented in libcsound, or the PD object ?


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-10 14:45
FromVictor Lazzarini
SubjectRe: [Cs-dev] Score rewinding
The muting is the problem; the second instance is not supposed to be muted, 
but to
play at the same time.

The code is now in CVS (frontends/csoundapi_tilde), you can look at it.

Victor
At 13:54 10/05/2005, you wrote:
>Victor Lazzarini wrote:
>
>>With the PD object, I only seem be able to run one csoundapi instance at a
>>time.
>>If I close one of the instances, the other one (that was muted) starts to 
>>play.
>
>Is the muting implemented in libcsound, or the PD object ?
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by Oracle Space Sweepstakes
>Want to be the first software developer in space?
>Enter now for the Oracle Space Sweepstakes!
>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-10 18:13
FromIstvan Varga
SubjectRe: [Cs-dev] Score rewinding
Victor Lazzarini wrote:

> The muting is the problem; the second instance is not supposed to be 
> muted, but to
> play at the same time.

This is odd, but sounds more like a PD related issue. Code in libcsound
that does not work with multiple instances is more likely to result in
(possibly random) crashes.

> The code is now in CVS (frontends/csoundapi_tilde), you can look at it.

Not really useful. I do not use PD, and could not find out how to test
the object (other than compiling it and loading with PD).


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-11 12:54
FromVictor Lazzarini
SubjectRe: [Cs-dev] Score rewinding
It could be PD,  but I can't see that it would. What seems to happen is that
csoundPerformKsmps() of one instance waits until the other instance has
finished performing the score and then it starts producing audio.

I have to do more tests.

Victor

At 18:13 10/05/2005, you wrote:
>Victor Lazzarini wrote:
>
>>The muting is the problem; the second instance is not supposed to be 
>>muted, but to
>>play at the same time.
>
>This is odd, but sounds more like a PD related issue. Code in libcsound
>that does not work with multiple instances is more likely to result in
>(possibly random) crashes.
>
>>The code is now in CVS (frontends/csoundapi_tilde), you can look at it.
>
>Not really useful. I do not use PD, and could not find out how to test
>the object (other than compiling it and loading with PD).
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by Oracle Space Sweepstakes
>Want to be the first software developer in space?
>Enter now for the Oracle Space Sweepstakes!
>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-12 11:17
FromIstvan Varga
SubjectRe: [Cs-dev] Score rewinding
Victor Lazzarini wrote:

> This is becoming a bit boring to everyone, but I can't
> get rewinding to work, after updating from CVS.

Are you using csoundCleanup() before rewinding ? If yes, then that is
the reason why csoundRewind() does not seem to work. After calling
csoundCleanup() (which will close the score file, by the way), you can
no longer expect csoundPerformKsmps() to work corretly.


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-12 11:24
FromVictor Lazzarini
SubjectRe: [Cs-dev] Score rewinding
A-ha!

I'll try that.

Victor

At 11:17 12/05/2005, you wrote:
>Victor Lazzarini wrote:
>
>>This is becoming a bit boring to everyone, but I can't
>>get rewinding to work, after updating from CVS.
>
>Are you using csoundCleanup() before rewinding ? If yes, then that is
>the reason why csoundRewind() does not seem to work. After calling
>csoundCleanup() (which will close the score file, by the way), you can
>no longer expect csoundPerformKsmps() to work corretly.
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by Oracle Space Sweepstakes
>Want to be the first software developer in space?
>Enter now for the Oracle Space Sweepstakes!
>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-15 15:21
From"gerard van dongen"
Subject[Cs-dev] csoundapi~
On Tue, 10 May 2005 14:30:01 +0200, Victor Lazzarini  
 wrote:

> With the PD object, I only seem be able to run one csoundapi instance at  
> a time.
> If I close one of the instances, the other one (that was muted) starts  
> to play.
>

Hi victor,

I finally had a change to play around with the cousndapi~ object.
(and many thanks for coding it!)
I can run 2 instances fine, as long as they use different orcs/sco.
I tried it with the examples you included, and then added a csoundapi~  
that just played back trapped.csd.
I can play notes on the example at the same time as trapped in convert was  
playing.
Trying to play 2 instances that both played back trapped.csd failed. The  
second one would not play back at all.
I will examine it a bit further and see if I can find out what is going  
wrong.

cheers

gerard


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-15 16:28
From"Richard Boulanger"
SubjectRe: [Cs-dev] csoundapi~
Gerard,

Since most of my teaching at Berklee and NYU involves Max/MSP/Jitter and
csound~, I haven't don't much work with PD.  I've checked it out of course,
but haven't produced any compositions or teaching materials with PD.  I plan
to do that now - of course and would be most grateful to anyone who would be
willing to share PD examples - especially those that involve csoundapi~.

Gerera, would you share some of your examples with the list and with me?

Hope so.  Can't wait to see all that you come up with.

Dr. B.

on 5/15/05 10:21 AM, gerard van dongen at gml@xs4all.nl wrote:

> On Tue, 10 May 2005 14:30:01 +0200, Victor Lazzarini
>  wrote:
> 
>> With the PD object, I only seem be able to run one csoundapi instance at
>> a time.
>> If I close one of the instances, the other one (that was muted) starts
>> to play.
>> 
> 
> Hi victor,
> 
> I finally had a change to play around with the cousndapi~ object.
> (and many thanks for coding it!)
> I can run 2 instances fine, as long as they use different orcs/sco.
> I tried it with the examples you included, and then added a csoundapi~
> that just played back trapped.csd.
> I can play notes on the example at the same time as trapped in convert was
> playing.
> Trying to play 2 instances that both played back trapped.csd failed. The
> second one would not play back at all.
> I will examine it a bit further and see if I can find out what is going
> wrong.
> 
> cheers
> 
> gerard
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

_______________________________________________________________________
 +  Dr. Richard Boulanger, Professor
 +  Music Synthesis Department, Berklee College of Music
 +  1140 Boylston Street  - Boston, MA  02215-3693
 +  Office Phone: (617) 747-2485   Office Fax: (617) 747-2564
 +  eMail: rboulanger@berklee.edu
 +  WebPage: http://csounds.com/boulanger/
________________________________________________________________________
 +  Almost Everything Csound @ http://csounds.com/
 +  The Csound Instrument Catalog @ http://csounds.com/catalog/
 +  The Csound Book @ http://csounds.com/book/
 +  The Csound Magazine @ http://csounds.com/ezine/
________________________________________________________________________



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-05-15 17:10
FromIstvan Varga
SubjectRe: [Cs-dev] csoundapi~
Attachmentstest.c  
gerard van dongen wrote:

> Trying to play 2 instances that both played back trapped.csd failed. 
> The  second one would not play back at all.

Is this only in PD ? I was able to play two instances of "Trapped" with
this simple C program.


Date2005-05-16 14:53
FromIstvan Varga
SubjectRe: [Cs-dev] csoundapi~
Attachmentstrapped.pd  
I tried to run two instances of trapped.csd using the csoundapi~ object,
and did not notice problems so far with the current Csound5 CVS.

Date2005-05-16 15:16
From"gerard van dongen"
SubjectRe: [Cs-dev] csoundapi~
On Mon, 16 May 2005 15:53:58 +0200, Istvan Varga   
wrote:

> I tried to run two instances of trapped.csd using the csoundapi~ object,
> and did not notice problems so far with the current Csound5 CVS.


And I am not seeing the problem anymore either. It seems to have disolved.
Probably a user error from me then.

G


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net