[Csnd] Outvalue timing issue

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

[Csnd] Outvalue timing issue

Johann Philippe-2
Hi all,

I'm having a weird issue using the "outvalue" opcode to refresh my host gui.
The opcode seems to have a bug at the first i-pass, and then it works well.
I'm getting the outvalue in my host with the csoundGetChannelCallback. and
i'm also printing it in the instrument to debug.

The instrument is like this

instr 1
ival = p4
print p4
kgoto thekpass
outvalue "T_sync",ival
thekpass:
endin

and the score :
i 1 0 1 1
i 1 1 1 2
i 1 2 1 3
i 1 3 1 4
i 1 4 1 5
i 1 5 1 6
i 1 6 1 7
i 1 7 1 8



The print inside the instrument prints the right value, while, at the same
time, the first i-pass always send 0 to the outvalue (i get 0 in the host -
and as you see, there is no 0 in my i statements). And then, all the values
in the host are delayed (the second statement sends 1, then 2 etc... while
the print displays 2,3 ..)

new alloc for instr 1:
instr 1:  p4 = 1.000
in lua  3       0

instr 1:  p4 = 2.000
in lua  3       1

and so on...


I saw a similar topic, but i don't see a real answer to this. The outvalue
is quite useful to trigger the callback in the host.
Do someone knows where it comes from ?
And do anyone has an alternative to trigger this kind of callback ?

Thanks in advance

Johann





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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] Outvalue timing issue

Mauro Giubileo

Hi, I tried the 'outval' opcode in CsoundQT and it works correctly. It prints and sends the right values to the widgets. This is the code:


<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
;run this example in CsoundQt, a Csound editor that provides widgets
;make the Widgets-panel visible, by clicking the Widgets symbol in the menu or pressing (Alt+1) and create a widget (for example a "Display" widget) named "T_sync". After that run this program and see the widget content change.

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1
    ival    =         p4
            print     p4
            kgoto     thekpass
            outvalue  "T_sync", ival
    thekpass:
endin
</CsInstruments>
<CsScore>
i 1 0 1 1
i 1 1 1 2
i 1 2 1 3
i 1 3 1 4
i 1 4 1 5
i 1 5 1 6
i 1 6 1 7
i 1 7 1 8
</CsScore>
</CsoundSynthesizer>


Best Regards,
Mauro


Il 2018-10-08 20:36 Johann Philippe ha scritto:

Hi all,

I'm having a weird issue using the "outvalue" opcode to refresh my host gui.
The opcode seems to have a bug at the first i-pass, and then it works well.
I'm getting the outvalue in my host with the csoundGetChannelCallback. and
i'm also printing it in the instrument to debug.

The instrument is like this

instr 1
ival = p4
print p4
kgoto thekpass
outvalue "T_sync",ival
thekpass:
endin

and the score :
i 1 0 1 1
i 1 1 1 2
i 1 2 1 3
i 1 3 1 4
i 1 4 1 5
i 1 5 1 6
i 1 6 1 7
i 1 7 1 8



The print inside the instrument prints the right value, while, at the same
time, the first i-pass always send 0 to the outvalue (i get 0 in the host -
and as you see, there is no 0 in my i statements). And then, all the values
in the host are delayed (the second statement sends 1, then 2 etc... while
the print displays 2,3 ..)

new alloc for instr 1:
instr 1:  p4 = 1.000
in lua  3       0

instr 1:  p4 = 2.000
in lua  3       1

and so on...


I saw a similar topic, but i don't see a real answer to this. The outvalue
is quite useful to trigger the callback in the host.
Do someone knows where it comes from ?
And do anyone has an alternative to trigger this kind of callback ?

Thanks in advance

Johann





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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] Outvalue timing issue

Johann Philippe-2
Thank for the answer.

In my case, the problem was that i used the csoundSetOutputChannelCallback to trigger the callback, but the value i used was coming from csoundGetChannelPtr. Now i use the third input argument in my callback function (opaque pointer), and cast it to a double. Then i get the right values.



Le mardi 9 octobre 2018 à 15:24:00 UTC+2, Mauro Giubileo <[hidden email]> a écrit :


Hi, I tried the 'outval' opcode in CsoundQT and it works correctly. It prints and sends the right values to the widgets. This is the code:


<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
;run this example in CsoundQt, a Csound editor that provides widgets
;make the Widgets-panel visible, by clicking the Widgets symbol in the menu or pressing (Alt+1) and create a widget (for example a "Display" widget) named "T_sync". After that run this program and see the widget content change.

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1
    ival    =         p4
            print     p4
            kgoto     thekpass
            outvalue  "T_sync", ival
    thekpass:
endin
</CsInstruments>
<CsScore>
i 1 0 1 1
i 1 1 1 2
i 1 2 1 3
i 1 3 1 4
i 1 4 1 5
i 1 5 1 6
i 1 6 1 7
i 1 7 1 8
</CsScore>
</CsoundSynthesizer>


Best Regards,
Mauro


Il 2018-10-08 20:36 Johann Philippe ha scritto:

Hi all,

I'm having a weird issue using the "outvalue" opcode to refresh my host gui.
The opcode seems to have a bug at the first i-pass, and then it works well.
I'm getting the outvalue in my host with the csoundGetChannelCallback. and
i'm also printing it in the instrument to debug.

The instrument is like this

instr 1
ival = p4
print p4
kgoto thekpass
outvalue "T_sync",ival
thekpass:
endin

and the score :
i 1 0 1 1
i 1 1 1 2
i 1 2 1 3
i 1 3 1 4
i 1 4 1 5
i 1 5 1 6
i 1 6 1 7
i 1 7 1 8



The print inside the instrument prints the right value, while, at the same
time, the first i-pass always send 0 to the outvalue (i get 0 in the host -
and as you see, there is no 0 in my i statements). And then, all the values
in the host are delayed (the second statement sends 1, then 2 etc... while
the print displays 2,3 ..)

new alloc for instr 1:
instr 1:  p4 = 1.000
in lua  3       0

instr 1:  p4 = 2.000
in lua  3       1

and so on...


I saw a similar topic, but i don't see a real answer to this. The outvalue
is quite useful to trigger the callback in the host.
Do someone knows where it comes from ?
And do anyone has an alternative to trigger this kind of callback ?

Thanks in advance

Johann





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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] Outvalue timing issue

Mauro Giubileo

I'm glad now it works. :-)

Regards,
Mauro

 


Il 2018-10-09 15:50 Johann Philippe ha scritto:

 
Thank for the answer.
 
In my case, the problem was that i used the csoundSetOutputChannelCallback to trigger the callback, but the value i used was coming from csoundGetChannelPtr. Now i use the third input argument in my callback function (opaque pointer), and cast it to a double. Then i get the right values.
 
 
 
Le mardi 9 octobre 2018 à 15:24:00 UTC+2, Mauro Giubileo <[hidden email]> a écrit :
 
 

Hi, I tried the 'outval' opcode in CsoundQT and it works correctly. It prints and sends the right values to the widgets. This is the code:


<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
;run this example in CsoundQt, a Csound editor that provides widgets
;make the Widgets-panel visible, by clicking the Widgets symbol in the menu or pressing (Alt+1) and create a widget (for example a "Display" widget) named "T_sync". After that run this program and see the widget content change.

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1
    ival    =         p4
            print     p4
            kgoto     thekpass
            outvalue  "T_sync", ival
    thekpass:
endin
</CsInstruments>
<CsScore>
i 1 0 1 1
i 1 1 1 2
i 1 2 1 3
i 1 3 1 4
i 1 4 1 5
i 1 5 1 6
i 1 6 1 7
i 1 7 1 8
</CsScore>
</CsoundSynthesizer>


Best Regards,
Mauro


Il 2018-10-08 20:36 Johann Philippe ha scritto:

Hi all,

I'm having a weird issue using the "outvalue" opcode to refresh my host gui.
The opcode seems to have a bug at the first i-pass, and then it works well.
I'm getting the outvalue in my host with the csoundGetChannelCallback. and
i'm also printing it in the instrument to debug.

The instrument is like this

instr 1
ival = p4
print p4
kgoto thekpass
outvalue "T_sync",ival
thekpass:
endin

and the score :
i 1 0 1 1
i 1 1 1 2
i 1 2 1 3
i 1 3 1 4
i 1 4 1 5
i 1 5 1 6
i 1 6 1 7
i 1 7 1 8



The print inside the instrument prints the right value, while, at the same
time, the first i-pass always send 0 to the outvalue (i get 0 in the host -
and as you see, there is no 0 in my i statements). And then, all the values
in the host are delayed (the second statement sends 1, then 2 etc... while
the print displays 2,3 ..)

new alloc for instr 1:
instr 1:  p4 = 1.000
in lua  3       0

instr 1:  p4 = 2.000
in lua  3       1

and so on...


I saw a similar topic, but i don't see a real answer to this. The outvalue
is quite useful to trigger the callback in the host.
Do someone knows where it comes from ?
And do anyone has an alternative to trigger this kind of callback ?

Thanks in advance

Johann





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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