The MIDI Forum

  1. Vu
  2. Getting Started with MIDI
  3. Monday, 01 June 2020
  4.  Subscribe via email
Hello,

I have been struggling.... I was wondering, is there a function/method or away, to figure out how many keys of Piano Input device?

For instance, once midi Piano connected successful, in the method "onMIDISuccess(midiAccess)", I need to display my "virtual piano key board" size base on number of Piano keys (48, 61 ...88 keys).

Any help, advise would be greatly appreciated.

Thank you.
Vu.
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
As far as midi (midi spec 1) is concerned, I don't think that this is anything to do with midi, and there is nothing general about this. It is not impossible that a specific device might accept a SysEx message and answer, but this is highly unlikely.

There may however be some provision for something like this in midi 2.0, which has been announced, but as yet there may not be any midi 2 devices available. You might check this again in a year or two?

Geoff
Comment
There are no comments made yet.
  1. more than a month ago
  2. Getting Started with MIDI
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
While this might not work for all keyboards, the large majority have a number in their device name that corresponds to the number of keys.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Getting Started with MIDI
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
I'm pretty sure MIDI 2.0 devices will have this functionality.
For older models you can try to detect the model name using https://github.com/jazz-soft/JZZ-midi-Gear
Comment
There are no comments made yet.
  1. more than a month ago
  2. Getting Started with MIDI
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
Thank you all for responded. I will try to detect the model name using source Sema mentioned. And maybe handle it manually ...something like "..get lowest key and highest key input.." and then calculate how many keys between....
Thank you.
Vu.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Getting Started with MIDI
  3. # 4
Accepted Answer Pending Moderation
0
Votes
Undo
As I understand it, OP was hoping there was a way to get the No of keys as a direct/immediate answer, that his system could make use of. REgarding this, I think my answer above is correct.

There IS a general SYSEX command that will request the device ID, and this will usually get an answer back, but the information provided would not immed help OP, as there would be a Mfg code, and a device code, and the codes are numbers. Sema's system linked above has created a list of devices (with names) and the numbers returned by the device ID request, so that there can be a look-up to translate the code obtained to a more useful designation that might be in the box or the keyboard body, i.e. GRX-88. Such a look-up will always be problematic, not every older device will be on it, and newer devices will need adding pretty much all the time.

I have a fairly old Casio keyboard which is midi capable and quite useful, however if has ZERO SysEx capability so you will get no reply from any Device ID enquiry! No doubt there are many other similar keyboards?

Geoff
Comment
There are no comments made yet.
  1. more than a month ago
  2. Getting Started with MIDI
  3. # 5
Accepted Answer Pending Moderation
0
Votes
Undo
Thank you Geoff,
...my current virtual keyboards ...manually handle "48 keys input" looks like:
https://ibb.co/qD81k0k
Comment
There are no comments made yet.
  1. more than a month ago
  2. Getting Started with MIDI
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!