Csound Csound-dev Csound-tekno Search About

How does the port opcode work?

Date2017-05-17 22:34
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectHow does the port opcode work?
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 Csound@listserv.heanet.ie 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

Date2017-05-18 11:19
Fromjpff
SubjectRe: How does the port opcode work?
> 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
Csound@listserv.heanet.ie
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

Date2017-05-19 00:10
FromGiuseppe Menozzi
SubjectRe: How does the port opcode work?
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.