Help for Tune Smithy Koch snowflake icon.gif

Velocity keyswitches retuning script wish list

From Tune Smithy

Revision as of 23:53, 26 May 2015 by WikiSysop (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a wish list of some things I'd like to add to the script in the future - for the script see Velocity keyswitches retuning.

If you have any wishes do let me know at

See also Velocity keyswitches retuning script - to do list which is a list of mainly minor things on my "to do" list for the software.


Per note stereo pan and volume


Set per note stereo pan

This is something you can do in Kontakt so I can add it to the script. It will let you pan notes around while they continue to sound. You could for instance pan the notes from left to right as they rise in pitch and back again as they fall, with the notes moving in different directions in the same channel simultaneously just like the pitch gliding examples for pitch.

You could also pan each note of a piano to a different pan position, all in the same channel. Up to 128 pan positions one for each note and you can play them all simultaneously if you so wish (e.g. big 128 note harmonic series chord with stero pan - I'll give that a go if I get this programmed).

127, 10 = 'Send per note stereo pan, 3 bytes
126, note = ' input note to adjust
126, p1 = ' Pan - coarse
126, p2 = ' Pan - fine

Where as usual the data values can be sent as

127,127= ' data value 0

Also - if you set the pan immediately after you play a note you get a "blip" as it instantly changes to the new pan position.

So we need

127, 11 = 'Send stereo pan for next note, 2 bytes
126, p1 = ' Pan - coarse
126, p2 = ' Pan - fine

Where the pan value is applied in the "on note" processing for the next note played before it is sounded

Set per note volume

Again, this is something you can do in Kontakt so I can add it to the script, this will let you vary the volume of the note while it is sounding

127, 7 = 'Send per note volume, 3 bytes
126, note = ' input note to adjust
126, v1 = ' volume (coarse)
126, v2 = ' volume (fine)

Where as usual the data values can be sent as

127,127= ' data value 0

Also - if you set the expression immediately after you play a note you get a "blip" as it instantly changes to the new expression value.

So we need

127, 8 = 'Send per note volume, 2 bytes
126, v1 = ' volume (coarse)
126, v2 = ' volume (fine)

Where the pan value is applied in the "on note" processing for the next note played before it is sounded

Set a "channel" for the notes

This is so that you can have multiple notes all with the same input note, differing only in the channel number, retuned in different ways. So increases the number of distinctly tuned notes you have from 128 to, say 128*128 all in the same Kontakt instrument, addressable by the channel number.

Especially useful for polytonality if you have a different tuning for each instrument in a composition, for instance.

127,10 = set "channel" could be up to 128 with one data byte - or range 0 to 15 or can you use the midi input channel?
126, channel = ' channel number

Then all the notes from then on are received on that channel. Default to 0 if not set. And when you send the 119,119 controller to start velocity keyswitches retuning then it would default to channel 0. So idea is that you have to set the channel for a bunch of messages if you want them to be anything except channel 0.

Then could do all the arrays as [128*16] or [128*128] etc increment note index into the arrays by multiple of 128 depending on "channel".

Or, can it detect the midi input channel? I think not.

New tuning options for the Kontakt example scales in the script

Repeat tuning at

For a twelve tone tuning if you adjust say C# then you probably want all the C#s to adjust by the same amount.

For other repeating scales e.g. if you have it set to n-equal with n = 7 or whatever, then would expect tuning to adjust every 7th note similarly.

This is just a case of adding a menu "Tune notes in all scale repeats simultaneously", "Tune notes individually" or some such, and internally the coding would be simple to do.

Load and save tunings

I could add a button to save your current tuning as a file and to open a previously saved tuning using load_array(...) and save_array(...).

This would save all the cents values of all the notes as millicents. You could also save the ratios as well, I could make a giant array 3*128 entries long and load all of those into it.

Twelve tone scales could be saved as a shorter file of 12 numbers. It saves it as an easy to read text file. All in millicents though.

Here is an example I did as a test to see how save_array works in Kontakt:


I can't at present see an easy way to load SCALA scales or .Tun tuning files in Kontakt. You would need to convert these to ordinary numbers, e.g. millicents first before Kontakt can load them, AFAIK.

Also is somewhat limited, don't see how to load descriptions - unless you add them at the end as ascii converted into numbers because I think these arrays can only hold numbers. For techy reasons, seems that you will need to set the number of notes for the scale first in the user interface in Kontakt, then the button would expect to open a scale with that number of notes.

It could read the number of notes in the scale as the first number in the file, but the problem is, that Kontakt expects fixed sized arrays so to permit scales of any size you would have to make sure all the scales are padded out with extra entries (0s probably) to the required number of entries. Which is a bit awkward if editing by hand. Though not an issue if you only load tunings that you previously saved from Kontakt.

At least, I think so, will probably find out more when I try to code it...

More scales

Could add a few more examples of interesting scales to get you started.

Could also add equal subdivisions of ratio so you can set any ratio there not just 3/1 and 3/2.


For example if you want to explore David Beardsley's 128 note harmonic fragment you probably want to set the 1/1 to play at midi note 0. But you still want it to play middle C, not midi note 0. So this needs a transpose feature.

Also useful for e.g. transposing one key to another. The Tune amount on the main panel doesn't have enough range for this, can only transpose by 3 octaves.

Seems easy enough to program so will surely add this to the script in the future.

black 1/1 at, stretch amount

These are all things I could add to separate screens in the ui, like the Tweaks page. The stretch could be set separately for the white and the black note scales, and the transpose amount too.

The stretch would be done as

Stretch 1200.000 to [1210.000 ] (user editable)
Stretch black keys separately to [1205.00]

Scala Modes

Not sure this is worth doing but just exploring it for completeness.

It would probably be easy to add the Scala modes list, would just add it as a big table to the script. The modes would be loaded automatically when you select the appropriate n-equal scale, as another droplist in the user interface.

These could be set to play on the white notes, with the black notes (if available) playing the next adjacent accidentals, or played consecutively.

Would be a case of writing a simple program to input the list of modes and convert them into Kontakt format for inlining into the script.

Scala Scales

It would also be possible to add the complete Scala scales archive, write code to convert it into a big Kontakt table, but I think that is overkill and would lead to a huge script. Also how can you organize so many scales in Kontakt menus for the user to use, given that there is no way for a Kontakt script to receive text input from a user?

It is probably better to access these via other software able to update the instrument with new tuning tables via midi or play in real time using velocity tuning keyswitches. It would also be possible for software to output scala scales to millicents in whatever form is eventually needed for the Kontakt script similar to .tun exports.

Personal tools
How to use the wiki