| Not sure how best to do the extrapolation, but if it’s linear, I guess you need to base it in the last
recorded slope.
With regards to kans, it is not an indicator of whether a message has arrived, but of whether there
are still messages in the buffer to be read at that k-period. I would suggest that the “changed” opcode
is probably what you want to see if there is a different value coming in. Since your parameter could
potentially be sent unchanged (for a straight line), maybe the best thing is to send in a message with
a tag that can be used to index it. So the tag will increase by 1 for every message you send in, and
you can then use changed on this.
Regards
========================
Dr Victor Lazzarini
Dean of Arts, Philosophy and Celtic Studies,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952
On 10 Sep 2014, at 08:54, zappfinger wrote:
> Yes, I probably should be using some loop.
> Below is some more code. What I am trying to do is lineair extrapolation:
> the OSC values come in at a much lower rate than k-rate. So I am calculating
> the slope to fill in every k value, until a new OSC value comes in...(I
> think there is no opcode for that?)
>
> kans1 OSClisten giosc1, "/freq1", "f", kvalin
> printk2 kvalin,0
> printk2 kans1,10
>
> ; start of extrapolation
>
> ;if (kvalin == kvalinold) then
> if (kans1 == 0) then
> kcount = kcount + 1
> kval = kval + kdelta
> else ; a change in input
> ;printk2 kcount,20
> kdelta = (kvalin - kvalinold)/kcount
> ;printk2 kdelta,30
> kvalinold = kvalin
> kcount = 1
> kval = kvalin
> endif
>
> Richard
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/kans-parameter-of-OSClisten-sometimes-does-not-change-data-does-change-tp5737393p5737401.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>
|