Topic: Keyboard mapping KBM format

Hi,

I've been looking at ways to easily map the 61 keys I have for some pieces, and I gather there's some sort of key mapping supported in Standard using Scala files.  However I can't find any documentation on the key mapping itself.

There are docs on the tuning aspect, but not the simple task I am trying to do ( e.g. map my lowest C key to a different note number ).

Transposing is not what I'm trying to do, BTW.

Does anyone have any info on using KBM files for this kind of task ?

Thanks in advance.

StephenG

Re: Keyboard mapping KBM format

Hi sjgcit,

Of potential interest, is that over the past many years I've written a series of articles, Microtuning Virtual Instruments, that specifically deals with this sort of question, which you may access here:

http://xen-arts.net/xen-articles/

For example in, Microtuning Virtual Instruments – Part 8 | Verifying Intonation Accuracy, there's a Definition of Scala Linear Keyboard Mapping Files (KBM), which I will paste here for your consideration:

“Keyboard mappings determine the allocation of scale degrees to keys on a MIDI keyboard, or MIDI note numbers in general”

As has been extensively discussed in this series, any software implementations of the the full Scala format will include both the SCL file: the actual scale degrees of a given microtuning or intonation system, and the KBM file, which specifies how the pitches of the intonation system are directly mapped to the MIDI Notes of MIDI keyboard controllers. Both of these are human-readable text format files.

While there are a wide variety of different uses for the Scala KBM files, perhaps the most essential of them is the so called, Linear Keyboard Mapping, which specifies:

Key For 1/1

The MIDI Note on the controller where the scale will start: the degree 0 of the microtuning. For example, this could be MIDI Note C.60, A.69, or potentially any MIDI Note unique to the musical scenario at hand.

Reference Frequency

The frequency (Hz, CPS) that will be mapped to the Reference Key, which could be, for example, set to the standard A.69 at 440 Hz, or C.60 at 261.625565 Hz.

Reference Key

The MIDI Note on which the Reference Frequency will be mapped, which, as above, might typically be C.60 or A.69. It is the combination of the Reference Key and the Reference Frequency assigned to it, that will determine the common base pitch and relative mapping of frequencies to MIDI Notes across the musical range for any given intonation system being mapped to a MIDI controller.

So, as we can see, a Linear Keyboard Mapping is ‘linear’ in the sense that pitches of an intonation system are mapped sequentially across the musical range of MIDI Notes relative to settings of the three parameters: Key For 1/1, Reference Frequency and Reference Key.

An intimate understanding of how this works, and why it is important to practically all musical instrument tuning, is fundamental to working with alternative intonation systems, as well as microtonal and xenharmonic music composition, where high-precision intonation is a frequent feature and requirement of the music.

Below is an example Linear Keyboard Mapping, which maps the Key For 1/1 to MIDI Note C.60, with the Reference Frequency at 440 Hz, and the Reference Key on MIDI Note 69:

!
! Size of map:
0
! First MIDI note number to retune:
0
! Last MIDI note number to retune:
127
! Middle note where the first entry in the mapping is mapped to:
60
! Reference note for which frequency is given:
69
! Frequency to tune the above note to (floating point e.g. 440.0):
440.000000
! Scale degree to consider as formal octave:
0
! Mapping.


This series of articles details how to achieve the results you require, but if you need any one-on-one private help with configuring your KBM files for Pianoteq, I would be delighted to help you, as I have countless others through the years. Feel free to write through the contact form if any part of this series is unclear about how to create your own custom KBM files.

If I may inquire, what specifically is your end goal, and to which MIDI Note Number and Reference Frequency, would you like to map your Scala SCL microtunings? I may be able to give you a quick answer that would prevent having to read through the series of articles. If I understand your requirements, I may also be able to create the KBM file for you as well.