[Csnd] CompileOrc instr 0

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] CompileOrc instr 0

zappfinger
Via the API it is possible to compile new instruments with CompileOrc.
Is that also possible with instrument 0?

Say I have a new instrument that also requires an UDO...

Richard

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] CompileOrc instr 0

Victor Lazzarini
yes. You can't change sr, kr, etc, but the rest is fair game.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 8 Apr 2017, at 16:50, Richard <[hidden email]> wrote:
>
> Via the API it is possible to compile new instruments with CompileOrc.
> Is that also possible with instrument 0?
>
> Say I have a new instrument that also requires an UDO...
>
> Richard
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] CompileOrc instr 0

zappfinger
Good to know!


On 08/04/17 17:59, Victor Lazzarini wrote:

> yes. You can't change sr, kr, etc, but the rest is fair game.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 8 Apr 2017, at 16:50, Richard <[hidden email]> wrote:
>>
>> Via the API it is possible to compile new instruments with CompileOrc.
>> Is that also possible with instrument 0?
>>
>> Say I have a new instrument that also requires an UDO...
>>
>> Richard
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] CompileOrc instr 0

zappfinger
In reply to this post by Victor Lazzarini
Coming back to this one: since in most cases csound is already started when I load new instr 0 contents, I guess I have to restart csound in order to make it effective?

Richard
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] CompileOrc instr 0

zappfinger
In reply to this post by zappfinger
I tried with csound.Reset() but that crashes Python. Should I stop csound first?

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] CompileOrc instr 0

zappfinger
In reply to this post by zappfinger
This looks like a deadlock situation.
I cannot use scoundReset while in the performance loop: i have to stop csound first (also stopping the performance thread first). Then starting csound again (with a csd file) initialises instr 0, but without the new changes i was trying to insert...
So I think there is no way to dynamically insert new content for instr 0?
Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] CompileOrc instr 0

jpff
Have you tried just sending the new instr 0 to a running csound via
compile?
  I thought that was supposed to work

On Sun, 16 Apr 2017, zappfinger wrote:

> This looks like a deadlock situation.
> I cannot use scoundReset while in the performance loop: i have to stop csound first (also stopping the performance thread first). Then starting csound again (with a csd file) initialises instr 0, but without the new changes i was trying to insert...
> So I think there is no way to dynamically insert new content for instr 0?
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] CompileOrc instr 0

zappfinger
Yes, but it has no effect as far as I can see/hear. But it makes sense
if instrument 0 is only executed on startup I guess...


On 16/04/17 14:29, jpff wrote:

> Have you tried just sending the new instr 0 to a running csound via
> compile?
>  I thought that was supposed to work
>
> On Sun, 16 Apr 2017, zappfinger wrote:
>
>> This looks like a deadlock situation.
>> I cannot use scoundReset while in the performance loop: i have to
>> stop csound first (also stopping the performance thread first). Then
>> starting csound again (with a csd file) initialises instr 0, but
>> without the new changes i was trying to insert...
>> So I think there is no way to dynamically insert new content for
>> instr 0?
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] CompileOrc instr 0

Victor Lazzarini
It should have an effect. You can compileOrc to run an instr 0 immediately. This example demonstrates it:

import ctcsound

cs = ctcsound.Csound()
cs.setOption("-odac")
cs.compileOrc('''
gi1 init 1
instr 1
a1 oscili 0dbfs, A4*gi1
out a1
endin
schedule(1,0,1)
''')
cs.start()
i = 0
while i < 4410:
  cs.performKsmps()
  i += 1
cs.compileOrc('''
gi1 = 2
schedule(1,0,2)
''')
i = 0
while i < 4410:
  cs.performKsmps()
  i += 1


========================
Prof. 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 16 Apr 2017, at 13:32, Richard <[hidden email]> wrote:
>
> Yes, but it has no effect as far as I can see/hear. But it makes sense if instrument 0 is only executed on startup I guess...
>
>
> On 16/04/17 14:29, jpff wrote:
>> Have you tried just sending the new instr 0 to a running csound via compile?
>> I thought that was supposed to work
>>
>> On Sun, 16 Apr 2017, zappfinger wrote:
>>
>>> This looks like a deadlock situation.
>>> I cannot use scoundReset while in the performance loop: i have to stop csound first (also stopping the performance thread first). Then starting csound again (with a csd file) initialises instr 0, but without the new changes i was trying to insert...
>>> So I think there is no way to dynamically insert new content for instr 0?
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>       https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] CompileOrc instr 0

zappfinger
Yes  it seems to work. Sorry for the fuss/fuzz..

Richard
On 16/04/17 14:57, Victor Lazzarini wrote:

> It should have an effect. You can compileOrc to run an instr 0 immediately. This example demonstrates it:
>
> import ctcsound
>
> cs = ctcsound.Csound()
> cs.setOption("-odac")
> cs.compileOrc('''
> gi1 init 1
> instr 1
> a1 oscili 0dbfs, A4*gi1
> out a1
> endin
> schedule(1,0,1)
> ''')
> cs.start()
> i = 0
> while i < 4410:
>    cs.performKsmps()
>    i += 1
> cs.compileOrc('''
> gi1 = 2
> schedule(1,0,2)
> ''')
> i = 0
> while i < 4410:
>    cs.performKsmps()
>    i += 1
>
>
> ========================
> Prof. 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 16 Apr 2017, at 13:32, Richard <[hidden email]> wrote:
>>
>> Yes, but it has no effect as far as I can see/hear. But it makes sense if instrument 0 is only executed on startup I guess...
>>
>>
>> On 16/04/17 14:29, jpff wrote:
>>> Have you tried just sending the new instr 0 to a running csound via compile?
>>> I thought that was supposed to work
>>>
>>> On Sun, 16 Apr 2017, zappfinger wrote:
>>>
>>>> This looks like a deadlock situation.
>>>> I cannot use scoundReset while in the performance loop: i have to stop csound first (also stopping the performance thread first). Then starting csound again (with a csd file) initialises instr 0, but without the new changes i was trying to insert...
>>>> So I think there is no way to dynamically insert new content for instr 0?
>>>> Csound mailing list
>>>> [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>        https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here