[Cs-dev] Multiple Csound API performances running in parallel
Date | 2015-08-11 18:04 |
From | Peter Burgess |
Subject | [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
Hi there, I am trying to get two instances of Csound to perform at the same time, using the C++ API. So far, I am using two performance threads, one for each Csound instance, and "pressing play" on each of them. As I expected might happpen, the results are messy. Not totally out of whack, but a bit jumpy. I'm not convinced the performance threads are actually designed for this task anyway, but it's the only function I can find that sounds like it fits the bill. My code (minus the score gens) looks something like this: I have a few different options to explore to achieve what I want from this (ie, there are ways of doing what I want without performing multiple Csounds instances at once) but I want to explore all possibilities to decide which works best.//create multiple instances of Csound Csound* csound = new Csound(); Csound* csoundBass = new Csound(); //compile csd csound->Compile("CSD/test.csd"); csoundBass->Compile("CSD/bass.csd"); //set up CsoundPerfThread object CsoundPerformanceThread* perfThread = new CsoundPerformanceThread(csound); CsoundPerformanceThread* perfThreadBass = new CsoundPerformanceThread(csoundBass); //start Csound performance perfThread->Play(); perfThreadBass->Play(); csound->Perform(); csoundBass->Perform(); //free Csound and thread objects delete csound, perfThread; delete csoundBass, perfThreadBass; return 0; |
Date | 2015-08-11 18:36 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
Did I miss part of this? Why do you need two performance threads? Regards, On Aug 11, 2015 1:05 PM, "Peter Burgess" <pete.soundtechnician@gmail.com> wrote:
|
Date | 2015-08-11 18:43 |
From | Peter Burgess |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
It's possible I don't. I tried just playing 2 instances of csound without any performance threads and only 1 seemed to play, so I added in the performance threads and both played, but with slight jitter. I'm not sure I actually want performance threads to do this as I'm not trying to control any parameters, but I'm not sure what to use instead |
Date | 2015-08-11 18:48 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
Sorry wrong question. Why do you need two instances of csound running in the same process at the same time? Regards, On Aug 11, 2015 1:44 PM, "Peter Burgess" <pete.soundtechnician@gmail.com> wrote:
|
Date | 2015-08-11 18:54 |
From | Peter Burgess |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
I want access to a great many instruments, more than the allowed 99 per orchestra. I am therefore going to have multiple .csd files, possible containing different types of instruments or something, and I'm trying to work out the best way of utilizing this. One of my ideas to get around this is to play multiple instances of csound at once, though that's probably not ideal for tight syncronisity and might be heavier on the cpu than I would ideally like On Tue, Aug 11, 2015 at 6:48 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
|
Date | 2015-08-11 19:08 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
More than 99 all playing at the same time? Or just a bank of many that the user can select for performance? Regards, On Aug 11, 2015 1:55 PM, "Peter Burgess" <pete.soundtechnician@gmail.com> wrote:
|
Date | 2015-08-11 19:11 |
From | Peter Burgess |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
A bank of many. |
Date | 2015-08-11 19:11 |
From | Oeyvind Brandtsegg |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
Oh, is there a limit? No? 11. aug. 2015 19.55 skrev "Peter Burgess" <pete.soundtechnician@gmail.com>:
|
Date | 2015-08-11 19:20 |
From | Peter Burgess |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
Is there not? I thought I remembered reading that you could only go up to 99. On experimentation, its clear that it's not limited, or at least not to 99. I think I might of got that idea when reading through reverb examples a while back, cos instr 99 was used as the reverb channel I think, so I guess I jumped to conclusions. All the same, is there a correct way to play two csound performances together without jitter? |
Date | 2015-08-11 19:22 |
From | jpff |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
I thought the limit was memory based. Number or instruments expands as reqyired -- or at least it issupposed to. ==John ff On Tue, 11 Aug 2015, Oeyvind Brandtsegg wrote: > > Oh, is there a limit? No? > > 11. aug. 2015 19.55 skrev "Peter Burgess" |
Date | 2015-08-11 19:30 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
Yes, if you set up a barrier for each thread at the end of each buffer or kperiod. This is what Csound does internally when you run Csound with more than one thread (-j option). You can store your bank in std::map <std::string, std::string> keyed by instr name. Then you can look up the instr definition by name and pass it to csoundCompileOrc during performance. You could also key the map by number. Regards, On Aug 11, 2015 2:21 PM, "Peter Burgess" <pete.soundtechnician@gmail.com> wrote:
|
Date | 2015-08-11 19:33 |
From | jpff |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
if you have multiple processors then does not -j give you what you need? Otherwise it might be better to use kperf on each instance in a loop but I doubt it will give much. But what dio I know? Te insides of amodern processor are beyond me. ==John ff On Tue, 11 Aug 2015, Peter Burgess wrote: > > All the same, is there a correct way to play two csound performances together > without jitter? > > > ------------------------------------------------------------------------------ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2015-08-11 20:07 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Multiple Csound API performances running in parallel |
Attachments | None None |
There is no software limit. The hard limit might be memory-related, but I doubt it would be easy to reach it. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland
|