On Fri, Aug 20, 2021 at 02:17:28AM -0500, Mike McGonagle wrote: > Thank you, Jeanette and Pete. Just seems so many opcodes do the same thing > that I didn't think about going about it with a different approach! midiin is worth remembering because it can be rather useful, as it takes 'raw MIDI'. I was afraid at one time that it would "absorb" the event, but it doesn't. Any instrument that's active when the event arrives will get a copy. BTW there was a minor brain fade in my test code. The line should of course be: gkBend = (kd2 - 64)*128 I was somehow thinking of the 7-bit value range rather than the multiplier. -- Pete -- > > On Fri, Aug 20, 2021 at 1:44 AM Pete Goodeve > wrote: > > > 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 > > > > 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