Pages: [1]   Go Down
Author Topic: MIDI numeric Keypad note sender?  (Read 610 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I'm quite a noobe(!) and want to create a device to test individual notes on my sampler and other hardware.
So to do this I want to press 1,2,3 and it plays midi note '123', or 3,6 and it plays midi note number '36' , etc, etc.
I've seen code that addresses a single key and then sends that out, but how to log a string of 2 or 3 digits on the keypad (e.g. 113) and then send that to midi??
Cheers  smiley
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1287
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to know when you have finished the string of 2 (or is that 3) digits. The challenge is usually solved by either sending an end of input character, like return, or by using a timeout, like tv remotes do for the channel number.

Once you have the end of number defined, the rest is easy. Initialize the number to zero. Then for each digit multiply the number by 10 and add the new number in. So the sequence could be 0, 1, 1x10+2=12, 12x10+3=123, etc.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Pages: [1]   Go Up
Jump to: