[Csnd] How does the port opcode work?

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

[Csnd] How does the port opcode work?

Arthur Hunkins
My friend Beppi has asked me to pose this general question about port:

In Android I use chnget to transmit to the .csd the values of the various 
controllers I have on my GUI. 
Unfortunately there are some "clicks" that are almost certainly caused by 
various k-parameters' sudden changes, so I implemented a portamento to any 
of these k-parameters. 
But I really don't understand how portamento should be used! 
The opcode port as I understood halves the distance between the current 
value and the destination value, at k-cycle. But how does it know what are 
the current and destination values, as soon as I pass just one of them as 
parameter? And how is it initialized at the very first run? Does it read the
value of the left opcode parameter before writing it?


In other words: 
Is this correct: 

kVibratoTemp chnget "vibrato" 
kVibrato port kVibratoTemp, 0.01 

or does this make sense instead? 

kVibrato chnget "vibrato" 
kVibrato port kVibrato, 0.01 


Thank you very much 
--------------------------------------------
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] How does the port opcode work?

jpff
> But I really don't understand how portamento should be used! 

> The opcode port as I understood halves the distance between the current 
> value and the destination value, at k-cycle. But how does it know what are 
> the current and destination values, as soon as I pass just one of them as 
> parameter? And how is it initialized at the very first run? Does it read the
> value of the left opcode parameter before writing it?
>
>
> In other words: 
> Is this correct: 
>
> kVibratoTemp chnget "vibrato" 
> kVibrato port kVibratoTemp, 0.01 
>
> or does this make sense instead? 
>
> kVibrato chnget "vibrato" 
> kVibrato port kVibrato, 0.01 
it has internal state so the two versions are really the same

What is the problem>

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] How does the port opcode work?

Beppim
kVibrato chnget "vibrato"
kVibrato port kVibrato, 0.01

it has internal state so the two versions are really the same

What is the problem>

Oh no problem, just trying to understand :)

Now I understood. So, that particular "port" opcode in that particular point of the code remembers its previous internal status, now it's all clear, thank you.
Beppi.



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