Pages: [1]   Go Down
Author Topic: MIDI numeric Keypad note sender?  (Read 582 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
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

Sydney, Australia
Online Online
Edison Member
Karma: 33
Posts: 1271
Big things come in large packages
View Profile
 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.

Arduino libraries
Parola hardware & library

Pages: [1]   Go Up
Jump to: