Feb 212015
Microtuning Virtual Instruments – Part 5 | Scala Workflow

In late 2011, Xen-Arts began a series of articles for computer musicians called Microtuning Virtual Instruments, which also happened to accord with the Scala application undergoing a major update. Long established shortcuts and the UI itself were being changed, so it made sense to discontinue the series until the new features were completed. Other projects and priorities have since prevented resumption of the series until now.

In this short article we’ll offer some suggestions for possible workflow enhancements when using Scala; dealing specifically with methods for quickly exporting the microtuning files required for changing the underlying intonation systems of virtual instruments that support full-controller MIDI pitch microtuning. Here we’ll discuss concepts related to file-management, naming-conventions and creating custom batch command files that can be used in Scala.

Let’s give the topic of Scala workflow some context, by operating with an imaginary microtuning scenario, in which our final goal is to – as quickly as possible – export the following microtuning files:

  • Scala SCL and KBM for use with instruments such as Pianoteq and ZynAddSubFX.
  • MTS: MIDI Tuning Standard. The ultimate real-time microtuning format (used in all Xen-Arts VSTi).
  • TUN: Popular format used by many countless virtual instruments.
  • KSP: Native Instruments Kontakt script.

For further context, we’ll need a microtuning to use as an example. Lets use this lovely trivalent heptatonic mode of ED2-41:


Now that we know what we wish to achieve, and have a microtuning to use, lets get started.

Scala Workflow – Part A | Creating and Saving SCL and KBM Files

As a first step in establishing a faster workflow in Scala, we’ll create both our Scala SCL and KBM files, which can later be quickly applied to the generation of our other microtuning formats.

Copy the above microtuning to the clipboard. Run Scala and open the New Scale dialog under the File menu (Ctrl+I).

2015-02-21 11_32_09-Greenshot

Paste the values on the clipboard into the blank field, and be sure to type in a description at the top, which will make the name of the microtuning visible in the Pianoteq VSTi with the saved Scala SCL file. Click Apply and OK. Now click the Show button at the top of Scala, to see the tuning.

2015-02-21 11_40_51-Scala

At this point, we are ready to Save our Scala SCL format file. Before we begin though, let’s first create the directory folder where we will export all of our microtuning files created in this tutorial. In this example, we’ll create a folder at the following path:

D:\Scala Batch

[In Windows, right-click and choose New > Folder, then name it accordingly.]

Under the File menu, choose Save File As (Shift+Ctrl+S), type in a name for the tuning – ED2-41 Trivalent Heptatonic.scl – then save it in the above directory we just created.

2015-02-21 14_01_22-Scala Batch

Next we’ll need to create our Scala KBM file, which will specify how our microtuning is mapped to the controller. Click the Map button on the Scala toolbar to open the Edit MIDI Keyboard Mapping dialog.

2015-02-21 11_53_55-Program Manager

Among the powerful features of virtual instruments that support full-controller microtuning, is the ability to freely map the pitches of an intonation system to the controller in any way required of the musical context at hand. Since we are operating in this article with an imaginary scenario, let’s illustrate this level of flexibility by doing something perhaps a little different…

In this case we are creating the most basic type of Keyboard Mapping file: what is referred to as a linear mapping.

In the Key For 1/1 field, select 60. In the Reference Frequency field, type or select 440, and finally, in the Reference Key field, select 69. With these parameters, our microtuning will be mapped with the 1/1 starting pitch on MIDI Note 60 (middle C), and our Reference Pitch will be 440 Hz on MIDI Note 69 (middle A).

Yes – both the 1/1 – and – the Reference Pitch – can be set to different values; this is the exciting freedom of full-controller microtuning that empowers musicians and composers to map the pitches of their intonation systems to their controllers any way they like! The above example is to vividly illustrate that there are other possibilities beyond just mapping everything to middle C, which in this case will give the microtuning a completely different sonic character.

Now it’s time to Save our KBM file. On the already opened Edit MIDI Keyboard Mapping dialog, click the Save As button at the bottom. Save the KBM file to the same directory as the SCL above. A naming-convention suggestion is to name your linear mapping KBM file according to the fields used to create it, and in this case it would be “60-440-69.kbm” which tells us at a glance how this will map our microtunings to the controller: MIDI Note 60 is the 1/1 starting note, while the Reference Frequency is 440 Hz on MIDI Note 69.

2015-02-21 14_11_33-Greenshot

Tip-1: Collections of KBM files with different mapping parameters can be created, saved and used interchangeably with any Scala SCL files. Establishing good naming-conventions makes it easy to identify these parameters and change the mapping of a selected microtuning.

Now that we have created our Scala SCL and KBM files, it’s time to explore the time-saving ability to create a batch processing command for use in Scala that can automate exporting any desired type of microtuning files.

Scala Workflow – Part B | Creating And Using A Batch Command File

As we know, typically when we are exporting our microtunings from Scala, it is a one-at-a-time process, in which we’ve got to select the instrument’s tuning model number, then Export the microtunings individually for a particular format. So, we export MTS (Tuning Model 107) as one step, TUN (Tuning Model 112) as another, and KSP (Tuning Model 129) as yet another. If you’ve ever wished for a faster way to get things done, then creating a batch process command file is the answer.

The principle is very simple: we will write a set of instructions for Scala that will export all of our formats to a user specified directory on our computers. Let’s make one now that will accommodate the above imaginary microtuning scenario…

First create a text file (TXT) using Windows Notepad and name it batch.txt. Open the TXT file and paste in the following code:

! batch.cmd
set synth 107
send/file “D:\Scala Batch\%scl(.mid)”
set synth 112
send/file “D:\Scala Batch\%scl(.tun)”
set synth 129
send/file “D:\Scala Batch\%scl(.txt)”

2015-02-21 13_07_52-Program Manager

Again, these instructions will tell Scala to Export our microtunings in the MTS, TUN and KSP formats, all at once. Make sure that at the end there is a return. Next, Save the TXT file, then change the file extension to CMD.

Copy this CMD file into the Scala CMD directory where your Scala installation resides. In this case, the path is:

C:\Program Files (x86)\Scala\cmd

2015-02-21 13_04_53-cmd

As we can see, the Scala CMD directory is filled with other command files, as they are a fundamental part of the operation of the program. When we place our batch.cmd file in this directory, it will be seen by Scala the next time we run the program, and every time thereafter. The nice thing is that we only need to create this CMD file one time to use for all future batch processing of our preferred microtuning formats.

Now that we’ve created our batch.cmd file, and have placed it in the Scala\cmd directory, lets close and run Scala again to ensure that it sees our custom CMD file.

Now drag-and-drop (or Open) the SCL and KBM files onto the Scala interface. Next, using the File menu, select Execute CMD File (Shift+Ctrl+@), navigate to the Scala\cmd directory and open batch.cmd.

Once you have opened batch.cmd, Scala will then instantly write all of the formats at once for MTS, TUN and KSP into the D:\Scala Batch directory we created at the beginning.

2015-02-21 14_32_13-Program Manager

It should be self-apparent, that one can specify any directory on their computer within which to save Scala batch file exports (as well as any of the other available Tuning Models numbers), for instance, in Documents, or anywhere you like. Just ensure to type that path into the CMD file:

! batch.cmd
set synth 107
send/file “D:\Scala Batch\%scl(.mid)”
set synth 112
send/file “D:\Scala Batch\%scl(.tun)”
set synth 129
send/file “D:\Scala Batch\%scl(.txt)”

Tip-2: Once you have created your own custom batch.cmd file it can be easily ran with any SCL and KBM combination currently loaded into Scala, and will export all the different file formats with the mapping parameters specified in the KBM file into the directory specified in the CMD file.

Tip-3: The Scala Batch folder is best treated as a temporary export directory. Once you have exported all of the files needed for your compositions, move the files into another directory to avoid accidentally overwriting with new batch file exports.

In review, we’ve now seen how to greatly streamline our Scala workflow, create and save Scala SCL and KBM files from which our other microtuning formats can be exported (MTS, TUN, KSP), and how to create a batch-command file (CMD) to automate exporting of our custom microtunings. Hopefully this will help accelerate the creation of your preferred microtuning format files, and enable getting to work more quickly with composition. Feel free to let me know how this works out for you.

 Posted by at 8:08 pm

  17 Responses to “Microtuning Virtual Instruments – Part 5”

  1. if you used LMSO your tutorial would have been much shorter!!!

  2. Indeed.



  3. Unfortunately that shorter tutorial would be: “LMSO doesn’t support batch files.”! :-/

  4. how i convert those files into mid..the ONE-SF2 requires .mid scale

  5. the batch does not work in my winxp package3, no files are sent besides I cannot create a D:// folder .i only have C:

  6. It should be self-apparent, that one can specify any directory on their computer within which to save Scala batch file exports (as well as any of the other available Tuning Models numbers), for instance, in Documents, or anywhere you like. Just ensure to type that path into the CMD file:

    ! batch.cmd
    set synth 107
    send/file “C:\Scala Batch\%scl(.mid)”
    set synth 112
    send/file “C:\Scala Batch\%scl(.tun)”
    set synth 129
    send/file “C:\Scala Batch\%scl(.txt)”

  7. Not sure what’s i am doing wrong I have followed all the steps and when i try to execute a batch i get

    ” Scale File\%scl(.mid)” not found ”

    Any ideas on what the problem may be?

  8. You might want to confirm that you have created the folder on your C-Drive before executing the batch:

    1. Run Windows Explorer
    2. Right-Click your C:\ icon, then choose, New > Folder
    3. Name the folder Scala Batch

    Now when you run the batch file, it should be writing the files into that folder.

    You could alternatively set up the batch file to write the files to My Documents, or anywhere on the computer desired. As described above, you just have to make sure that:

    A. You’ve created the folder where you want to export the microtuning batch files beforehand.
    B. The path is typed correctly into the batch file.

    Paste the contents of your custom batch file into the comments, and we’ll take a look at it. I feel confident that it’s some small detail.

    [FYI: It may be about 24 hours from now before I can reply though. Bear with me.]

    In some ways, this is an advanced tutorial that deals with concepts of data management on one’s computer, but once one is able to get this working, it will be a good introduction on how to manage the creation and storage of these various microtuning format files, which is something very important to have mastery over when working with microtonal virtual instruments, because invariably, as one composes a lot of music through the years, one will want to have some solid data archiving skills in place.

    At some time in the future, I’ve thought that it might be helpful to write another tutorial in this series, discussing how I and other musicians and composers archive their work, for in the event they wish to restore their compositions in the future.

  9. Thanks for your fast replay. I’ll give it another go.

    Anymore tutorials would be great.

    Really liking this site as i am very interested in working in other tunings and shorter intervals to give more aggressive melodies in my productions.

  10. Hi thanks for this I am hoping to batch convert the .scl archive to .txt files for synth 135 (Max/MSP) so I wrote a .cmd:

    ! batch.cmd
    set synth 135
    send/file “D:\ScalaBatch\%scl(.txt)”

    saved to C:\Program Files (x86)\Scala22\cmd\rory.cmd

    I reopen Scala, execute the cmd file, drag 5 .scl files into the window. But I get the error “File could not be created”. The command history looks like this:

    echo Welcome to Scala.
    echo Type “@tutorial” to view the tutorial.
    echo Edit startup.cmd to configure initial settings.
    @”C:\Program Files (x86)\Scala22\cmd\rory.cmd”
    set synth 135
    send/file “D:\ScalaBatch\%scl(.txt)”
    load “C:\Users\Rory\Documents\Max 7\Library\Scala\scl\07-19.scl” 0
    load “C:\Users\Rory\Documents\Max 7\Library\Scala\scl\05-19.scl” 1
    load “C:\Users\Rory\Documents\Max 7\Library\Scala\scl\05-22.scl” 2
    load “C:\Users\Rory\Documents\Max 7\Library\Scala\scl\05-24.scl” 3
    load “C:\Users\Rory\Documents\Max 7\Library\Scala\scl\06-41.scl” 4
    @”C:\Program Files (x86)\Scala22\cmd\rory.cmd”
    set synth 135
    send/file “D:\ScalaBatch\%scl(.txt)”

    The window history looks like this:

    Welcome to Scala.
    Type “@tutorial” to view the tutorial.
    Edit startup.cmd to configure initial settings.
    Scala version 2.40c Copyright E.F. Op de Coul, the Netherlands, 1992-2016

    Synthesizer 135: Max/MSP coll data, via text file
    Nineteen-tone equal major
    5 out of 19-tET
    Pentatonic “generator” of 09-22.scl
    5 out of 24-tET, symmetrical
    Hexatonic scale in 41-tET

    Synthesizer 135: Max/MSP coll data, via text file

    Any idea what I’m doing wrong?

    Thanks for any help in advance. Much appreciated!

    • I forgot to say, after dragging the files and they load, I then went to File> @rory.cmd
      which is when I get the error.

  11. Also, I created D:\ScalaBatch (no space) ahead of time and the directory is empty

  12. Welcome Rory,

    Converting the entire SCL archive is a different process than anything I’ve detailed in these articles, and we will need to tweak the approach here to get the result you require.

    Since I’m a little short for time this evening, I’ll give some quick suggestions and will try to offer more help (if possible) in about 24 hours from posting this reply.

    In the Scala CMD directory, there are several .cmd files that are named “archiveYXZ”. Make a copy of one of those, study how it works, make another for synth 135, then see if you can export the SCL archive in your format.

    I’ll check back here tomorrow for your reply.

  13. I’ll help you now so you don’t have to wait…

    1. Create a directory where you will batch convert your SCL files, such as the one under discussion:

    D:\Scala Batch

    2. Download and extract the Scala SCL archive into this same directory.

    3. Run Scala and set the Synth Tuning Model (under Options) to 135.

    4. Under the Scala File menu, select Change Directory, and change the directory to: D:\Scala Batch

    5. Under the Scala File menu, select Execute CMD File, navigate to the CMD directory and the file labeled:


    6. The instant you execute this CMD file, Scala will start batch converting all of the SCL files you extracted to D:\Scala Batch, to 135 TXT files. It will convert them all which might take a little while depending on how fast your PC is, since there are thousands of them.

    BTW – As you will see, this completely obviates any need to drag-n-drop SCL files. It just mechanically converts them all without intervention.

  14. thanks jacky very useful

  15. thanks jacky very useful

  16. Hi Daniel,

    Thanks for dropping by and you’re welcome.

    Working with these custom CMD files has completely transformed the way I do things in Scala. Glad you’ve found it useful too.

    Check out part-6 here if you like:


    Someone wrote behind the scenes recently and asked for help with batch converting the Scala archive into the 135 Max-MSP coll format, and this is the way I did it, which only took a couple of minutes to achieve.

 Leave a Reply

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>