tonedef Posted August 24, 2014 Report Posted August 24, 2014 Okay so I'm having a bit of trouble figuring out how to take the current keyboard range and on each successive press of a button, shift it down by one octave. It has to be relative, because I also want an increment button as well. I'm assuming it'd be something like: event_button id=1 kb_transpose= current_value + 12 event_button id=2 kb_transpose= current_value - 12 Sorry if this has been covered before, (I looked but maybe I didn't search for the right terms?). Thanks for any help! Quote
robinfawell Posted October 16, 2014 Report Posted October 16, 2014 Tonedef I happened to read your August post. I can let you know how I achieved this if you need some ideas. I use two membrane momentary switches. Transpose+ and Transpose-. If you want to see the code let me know. Robin Quote
tonedef Posted November 9, 2014 Author Report Posted November 9, 2014 Sorry I've not been on the forums in awhile, but yes! If you've got some code to share, I'd love to take a look. I've been trying to accomplish this via the NGC file, but haven't had much luck. I'm currently using the NG app which does everything else I need, just not the keyboard octave shifting... Thanks Robin! Quote
robinfawell Posted November 25, 2014 Report Posted November 25, 2014 Here are a couple of ideas. Most of my work concerns digital piano. In addition to scanning the keys for switch changes . I scan 16 extra switches for changes. You could use J5 to to the same. I use a membrane momentary action switch.made by MEC with low bounce characteristics. Here is some code for a 2 switch solution. This enables the user to to decrement and increment the value. You will need to declare the transpose variable as a global variable. //transpose buttons if(pin == 95 && pin_value == 0){//pin 95 is RH Transpose Button ie + Transpose (Higher Note) transpose = transpose +1;} if(pin == 94 && pin_value == 0){//pin 94 is LH Transpose Button ie + Transpose (Lower Note) transpose = transpose -1;} if(transpose > 9){ transpose = 9;} if(transpose < -9){transpose = -9;} You need only one switch, but you can only advance if(pin == 95 && pin_value == 0){//pin 95 is Transpose Button transpose = transpose +1;} if(transpose > 9){ transpose = 0;} In the latter case pressing the button after 9 is reached, returns the variable to 0 Later in the program you will add the transpose value to the note number.. For octave shifts you will use multiples of 12 notes Robin Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.