Damn...! Jeanette got her answer in while I was playing!! (:-)) I was going to say just about the same, except I mocked up this little instrument that seems to work just fine: gkBend init 0 alwayson "Bend" instr Bend kstat, kchn, kd1, kd2 midiin /* printf "Value=%d %d %d\n", kd2, kstat, kd2, kd1 */ if kstat == 224 then gkBend = (kd2 - 64)*127 ; ignoring LSB printf "bend=%d\n", abs(gkBend)+1, gkBend endif endin ----------------------------------- The '+1' offset in printf ensures it prints even when bend goes to zero. HTH -- Pete -- On Fri, Aug 20, 2021 at 08:30:31AM +0200, Jeanette C. wrote: > Hi Mike, > try midiin . It has four outputs, one being kstatus, which marks the kind > of event being read, which includes pitchbend. > kstatus, kchannel, kdata1, kkdata2 midiin > if (kstatus == 224) then > ; do your pitchbend reading from data1 and data2 > endif > > HTH. > > Best wishes, > > Jeanette > > -- > * Website: http://juliencoder.de - for summer is a state of sound > * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g > * Audiobombs: https://www.audiobombs.com/users/jeanette_c > * GitHub: https://github.com/jeanette-c > > Cinderella's got to go <3 > (Britney Spears) > > 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 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