Sevish Music

Mapping microtonal scales to a MIDI keyboard in Scala

I recently wrote a tutorial about how to change the root note of your microtonal scale, where I used Scala’s Edit Mapping dialog. There is so much more I want to say about keyboard mappings. This time I’m explaining how to map various microtonal tunings on to a standard MIDI keyboard in a sensible way.

Needless to say, this topic is important for musicians who want to use microtonal tunings on their standard MIDI keyboard controller. I’ll be using Scala for this tutorial.

First, an explainer on “scale degrees”

This is an incredibly simple but powerful idea. Scale degrees are numbers that describe the order of notes in a scale. The root note of a scale is always scale degree 0, and the degree numbers increase as you go up the scale. For a 7 note scale, the scale starts on degree 0, then passes through 1-6. When we reach 7, we’re an octave up from where we started. In this case, 7 would be called the octave degree.

The familiar 12-equal scale could also be described with scale degrees. Let’s take C to be our root note, so C = 0. The rest is as follows:

Name C C# D D# E F F# G G# A A# B C’
Scale degree 0 1 2 3 4 5 6 7 8 9 10 11 12

When we’re working with large scales, notating by scale degree becomes an efficient way of describing what notes we want to play. We will also use scale degrees to tell Scala how to map notes to a keyboard.

How to map a 7-note tuning to the white keys

Imagine we have an excellent microtonal 7-note scale, such as 7-EDO, mavila[7], or something else. By default, your synth maps these notes linearly and chromatically across your MIDI keyboard. Press the C key, and at the same time press the key which is 7 steps above it (that’s a G). You will hear an octave! That’s incredibly jarring, because we expect to hear an octave from C to C, not from C to G.

Linear mapping of a 7-note scale on to chromatic keys:

Linear keyboard mapping of a 7 note scale

The scale degrees in red are octaves. NOT fifths!

Custom mappings help to make a regular pattern that is much more familiar and easy to navigate:

Keyboard mapping with a 7-note scale on the white keys

The diagrams above should make it obvious that linear mapping is a problem. With linear mapping, fingering becomes irregular as you go up and down by aural octaves. For a 7 note scale, we can simply skip out the 5 black keys to get a regular, repeating pattern.

Start off by loading a 7 note scale into Scala. I simply typed ‘equal 7’ to get 7-EDO.

Then go to Edit > Edit Mapping (Alt+P).

The mapping should repeat every 12 notes on our keyboard, so set Size to 12. Remember that’s 7 notes from our scale, plus 5 black notes we’ll skip out, totalling 12.

Set a value for Formal octave degree, which is 7 in this case.

Fill out the remaining fields as shown below:

If you don’t see the fields at the bottom, make sure you enter a value for Size. Scala will then create the empty fields for you automatically, and you can type in the scale degrees that you want for your mapping.

Note that we’re skipping the sharps/blacks, so you can leave those fields blank. Or if you’re like me, you will see this as an opportunity to enter duplicate notes and create a sweet sounding pentatonic mode from the main scale.

Once you’re done, click Save As and save the resulting mapping file. Scala mappings are saved in .kbm format. The great thing about this, is that you can mix and match your .kbm mapping files with .scl tuning files that you have collected. So if you have several .scl tuning files with 7 notes, then you can use this same .kbm mapping file on all of them.

While you have a scale and a mapping loaded at the same time, now is a good time to export your tuning for softsynths, or relay it to hardware synths. It feels much easier to play with the new mapping.

How to map a 12-note subset of a larger tuning

Now imagine that we have a tuning much larger than 12 notes, and we want to select just the notes that we want to map on the keyboard. For example, let’s try the calm vibes of 31-EDO. Just for context here is some music written in 31-EDO. 31 is a very nice meantone temperament, very close to quarter-comma meantone.

Here is how 31-EDO would be linearly mapped to a keyboard:

Linear mapping of 31-EDO on to a keyboard

I don’t know about you, but my hands aren’t wide enough to hit that octave.

Seriously this is just ridiculous. 31 notes is too many for most musicians to keep track of, so let’s just pick 12 notes for our mapping:

Keyboard mapping for 31-EDO, quasi-12-equal

The 12 notes that I selected give a quasi-12-equal. But you should feel free to choose your own notes and experiment with what your ear likes.

Go to Edit > Clear Mapping to reset your mapping back to normal, then go to Edit > Edit Mapping to open the keyboard mapping dialog. Fill in the Size (12) and Formal octave degree (31) then enter the scale degree for each note of the mapping.

Scala keyboard mapping dialog for 12-note mode of 31 equal temperament

As before, now is a good time to save your .kbm mapping file, and load it up on a synth of your choice.

How to map a 12-note subset of a larger tuning (alternative method)

Instead of using Scala’s keyboard mapping functions, we could do it with the mode command instead. The mode command lets you choose a subset of notes from your currently loaded scale, and then it deletes the remaining notes.

The end result would be a single .scl file with the extra notes removed, instead of the usual .scl and .kbm pair (containing the full gamut of notes plus tuning information). You might use this method if your synth supports .scl files but not .kbm files.

Imagine that we want to recreate the above quasi-12-equal mode from 31-EDO. Just type these commands into Scala:

equal 31
mode 3 3 2 3 2 3 3 2 3 2 3 2
show

You’ll get the following output from Scala:

  0:          1/1               0.000000 unison, perfect prime
  1:        116.129 cents     116.129032
  2:        232.258 cents     232.258065
  3:        309.677 cents     309.677419
  4:        425.806 cents     425.806452
  5:        503.226 cents     503.225806
  6:        619.355 cents     619.354839
  7:        735.484 cents     735.483871
  8:        812.903 cents     812.903226
  9:        929.032 cents     929.032258
 10:       1006.452 cents    1006.451613
 11:       1122.581 cents    1122.580645
 12:          2/1            1200.000000 octave

Note that, when you use the mode command, you enter the difference (in scale degrees) between successive notes of the scale. The table below shows you how the difference between scale degrees relates to the scale degrees themselves.

Scale degrees 0 3 6 8 11 13 16 19 21 24 26 29 31
Difference 3 3 2 3 2 3 3 2 3 2 3 2

You should also notice that 3 + 3 + 2 + 3 + 2 + 3 + 3 + 2 + 3 + 2 + 3 + 2 = 31. The sum of these digits must be equal to the octave degree, which is 31 in this case. Otherwise, the mode command will give you an error: Scale and mode size are unequal.

Further exercises

  • Load up a random large EDO, such as 23-EDO or 50-EDO, then pick a really fruity sounding pentatonic scale to map to the black keys.
  • Combine this tutorial with the previous tutorial: Create a custom keyboard mapping that also sets a base frequency and base key.
  • Experiment with Moment of Symmetry scales (e.g. mode 2 2 2 1 2 2 in 11-EDO, or mode 1 2 1 2 1 2 1 2 1 2 in 15-EDO).

 


9 thoughts on “Mapping microtonal scales to a MIDI keyboard in Scala”

  1. paris

    Another fantastic post! Thank you so much. This was another topic I was struggling about when we last spoke. Really appreciate you sharing your knowledge with us.

    Reply

    1. Sevish Sevish Post author

      Hi Paris, I’m grateful for this feedback!

      It’s been a while since I wrote any Scala tutorials but I would like to continue writing more in the future. There is a lack of microtonal music tutorials online at the moment. If you have any suggestions you can always let me know.

      Cheers,
      Sevish

      Reply

      1. Patrick

        Hey Sevish,

        I was wondering how to properly map the the “equal 13 3/1” you mentioned in the lesson on creating your own scales?

        In Edit> Edit Mapping I’ve put the size as 13, so that it repeats after the C#, and I’ve put the formal octave as 13, which ended up with the all the notes in between being on the Db black key for some reason. I’ve tried listing the formal octave as 8 ( at 1170 cents, the closest octave in this scale) and that still didn’t seem to work. Any other combinations seem to end up with strange almost arbitrary jumps in octave from one key to the next, and a majority of the scale degrees being stacked on one or two black keys.

        I’ve only just dipped my toe into micro tonal stuff, so perhaps for now I will stick to all the strange scales you can make that repeat after the 12th key, haha.

        Your blog is an awesome resource though! You’ve opened up quite the (welcome) rabbit hole for me.

        Reply

  2. Arihant

    Really Amazing !! Can you please share how can we tune a synth with the new tuning and play using a MIDI keyboard.

    Reply

    1. Sevish Sevish Post author

      Hey Arihant, this really depends on which synth you’re using. Not all synths support microtonal tunings, and those that do use different methods. If your synth supports it then the instructions should be given in its instruction manual. Best of luck!

      Reply

  3. stefaan

    I’m confused about one aspect of the mapping. On one hand one can assign a reference frequency to a reference midi note, on the other hand one can remap scale degrees. So in theory I could remap the reference note to – say – scale degree 5. Should the reference frequency remain tied to the reference midinote (i.e. notes with scale degree 5), or should it be assigned to the notes where scale degree 0 is mapped ? I suspect it’s the former (i.e. it remains tied to the reference note, not to the reference degree), but I’m curious to hear your opinion on it.

    Reply

  4. DMA

    Hi Sevish,
    Your website is such a precious ressource !
    I just dived in microtonal music and your posts are really helpful.
    Iam about to map the cet126 scale which is a 15-tet and Iam wondering about the notation system in scala.
    I read the “set notation” in the scala help page but it is still not clear enough.
    Can you explain the following sentence, especially Blackwood’s for 15-tET, and how can I find it in the scala picklist ?
    “Rapoport’s notation system is used which is consistent with Fokker’s for 31-tET and Blackwood’s for 15-tET.”
    Cheers

    Reply

  5. Chris

    A lot of folk use the Ableton Push devices which give 64 pads and can be configured to chromatic mode. The use of a Push in chromatic mode, together with the TUN format (with variable reference pitch) in Scala…would make for an interesting article introducing a different demographic to microtuning.

    Push with apps like Scaler and Cthulhu for chords, together with .tun and VST’s like Diva makes for powerful stuff with easier fingerings.

    Reply

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*