| I think I have to reset, delete and recreate Csound to avoid segfaults
with my message thread. I have used this method in the past but it can
be quite slow. Removing the need to delete the object speeds things
up, but leads to the problems discussed here:
http://csound.1045644.n5.nabble.com/csoundReset-and-csoundDestroyMessageBuffer-td5741487.html#a5741496
On 14 July 2015 at 11:25, Victor Lazzarini wrote:
> CompileCSD() is built on top of Compile(), CompileOrc() and ReadScore().
>
> 1. In the first compilation, it’s just plain Compile().
> 2. In subsequent compilations it:
> (a) ignores everything but and
> (b) The contents of the former as a string are fed into CompileOrc()
> (c) The contents of CsScore are fed into ReadScore(). Since this is built on top of InputMessage(),
> with extra preprocessing, its contents are processed as realtime events. So no “f0” and other
> few things like tempo warping.
>
> So, yes, whenever you call this, the new instruments will be added to the engine,
> replacing existing ones if they are already there. Any instances that were already playing, will
> carry on. It does not affect stuff that is playing, only new instances.
>
> So, in your case, I think a Reset() followed by a new full Compile() will start afresh.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 14 Jul 2015, at 10:13, Rory Walsh wrote:
>>
>> I guess I've misunderstood compileCsd(). This dynamically adds
>> instrument nodes to the orch tree? (not sure if I'm using the correct
>> terminology here). Each subsequent call to csoundPerform() will run
>> each instrument found in the tree? I'm only looking to recompile the
>> entire orch each time a user restarts the csd file. So I need to clean
>> the entire tree and start from the start again. I've only been able to
>> do this in the past by deleting Csound and re-instantiating it. Is
>> there a more efficient way?
>>
>> On 14 July 2015 at 10:47, Rory Walsh wrote:
>>> Give me a minute to see if I can break it :)
>>>
>>> On 14 July 2015 at 10:42, Victor Lazzarini wrote:
>>>> I tested this with a simple program here and it works as expected.
>>>>
>>>> #include
>>>> #include "csound.hpp"
>>>>
>>>> int main(int argc, char *argv[])
>>>> {
>>>> Csound* csound = new Csound;
>>>> csound->CompileCsd("test1.csd");
>>>> int n =0 ;
>>>> while(++n < 4410)
>>>> csound->PerformKsmps();
>>>> n = 0;
>>>> csound->CompileCsd("test2.csd");
>>>> while(++n < 4410)
>>>> csound->PerformKsmps();
>>>> delete csound;
>>>> }
>>>>
>>>> test1.csd
>>>>
>>>>
>>>> -odac
>>>>
>>>>
>>>>
>>>> isize = 16384
>>>> ifn ftgen 1, 0, isize, 7,
>>>> 0, isize*0.1, 1,isize*0.8, 1, isize*0.1, 0
>>>> ifn ftgen 2,0,4,-2,1,1.25,1.5,2
>>>>
>>>> instr 1
>>>> a1,a2 ins
>>>> kenv oscili p4, 1/p3, 1
>>>> kpitch table phasor:k(p6), 2, 1
>>>> asig oscili kenv, p5*kpitch
>>>> out asig
>>>> endin
>>>> schedule(1,0,10,0dbfs/2,440,1)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> test2.csd:
>>>>
>>>>
>>>>
>>>> -odac
>>>>
>>>>
>>>>
>>>> instr 1
>>>> out rand(p4)
>>>> endin
>>>>
>>>>
>>>>
>>>> i1 0 10 16384
>>>>
>>>>
>>>>
>>>> ========================
>>>> Dr Victor Lazzarini
>>>> Dean of Arts, Celtic Studies and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 14 Jul 2015, at 09:23, Rory Walsh wrote:
>>>>>
>>>>> I'm having another issue with this method. Is it possible that
>>>>> instruments are only activated on the first call to this method? If I
>>>>> add a new instrument to my csd file and then call csoundCompileCsd()
>>>>> the new instrument is not activated. I thought it might be a score
>>>>> issue, but I get the same problem if I try scheduling the instrument
>>>>> in instr0? If on the other hand, I delete my instance of Csound and
>>>>> recreate it everything works as expected.
>>>>>
>>>>> On 8 July 2015 at 17:18, Victor Lazzarini wrote:
>>>>>> you're right, it's not a bug. This is because some things are only allowed in the first compilation, like setting the sr. Also scores sent after the first compilation get processed as RT events, and f0 is meaningless as such.
>>>>>>
>>>>>> Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>> On 8 Jul 2015, at 14:16, Rory Walsh wrote:
>>>>>>>
>>>>>>> Not quite a problem, but making successive calls to compile csd with a
>>>>>>> score that contains an f0 results in the following output:
>>>>>>>
>>>>>>> too few pfields
>>>>>>> illegal RT scoreline:
>>>>>>> f 0 356400.000000
>>>>>>>
>>>>>>> At first I thought it was an error, but it doesn't seem to affect the
>>>>>>> output of my instrument. I also get a lot these warnings:
>>>>>>>
>>>>>>> WARNING: system constants can only be set once
>>>>>>>
>>>>>>> Rory.
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Don't Limit Your Business. Reach for the Cloud.
>>>>>>> GigeNET's Cloud Solutions provide you with the tools and support that
>>>>>>> you need to offload your IT needs and focus on growing your business.
>>>>>>> Configured For All Businesses. Start Your Cloud Today.
>>>>>>> https://www.gigenetcloud.com/
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Don't Limit Your Business. Reach for the Cloud.
>>>>>> GigeNET's Cloud Solutions provide you with the tools and support that
>>>>>> you need to offload your IT needs and focus on growing your business.
>>>>>> Configured For All Businesses. Start Your Cloud Today.
>>>>>> https://www.gigenetcloud.com/
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Don't Limit Your Business. Reach for the Cloud.
>>>>> GigeNET's Cloud Solutions provide you with the tools and support that
>>>>> you need to offload your IT needs and focus on growing your business.
>>>>> Configured For All Businesses. Start Your Cloud Today.
>>>>> https://www.gigenetcloud.com/
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Don't Limit Your Business. Reach for the Cloud.
>>>> GigeNET's Cloud Solutions provide you with the tools and support that
>>>> you need to offload your IT needs and focus on growing your business.
>>>> Configured For All Businesses. Start Your Cloud Today.
>>>> https://www.gigenetcloud.com/
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>> https://www.gigenetcloud.com/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound |