Topic: Changing tuning via command line

Hello everyone,

does anyone know whether there is any way to change the temperament of a preset, when you convert a .midi-file to a .wav-file via the command line "./Pianoteq ..."? So far I always used pitch-bending messages in the midi-file. But since the resonance changes depending of the tuning, I would prefer to actually change the tuning dynamically.

Best regards,

uummmoo

Re: Changing tuning via command line

Not quite sure what you are thinking of doing, but you could create a preset with a scala tuning file and then load that from the command line - see options with --help option.

Re: Changing tuning via command line

Thank you for your reply. No I mean I would like to change the tuning of a preset via the command line without having to open Pianoteq manually. Imagine having a algorithmically generated musical data, for instance a melody with more than 50 different (microtonal) pitches per octave. Now you would like to synthesize this melody with Pianoteq. You could of course generate every 12 pitches a preset manually, meaning that you would have to generate 5 different presets (50 / 12 = 4.1). I guess that is a lot of work if you just want to try out different melodies and whenever you change anything you would have to make a new preset. I also thought about changing the preset automatically, but since the fxp-files are not human readable I don't see any way to change a preset apart from "--set-param"-command. But if you check "--list-param" you can see there is no temperament option.

Did I missed anything, any way to change the tuning of a preset without having to open Pianoteq, click on the button, choose your scala file..? Like for instance a way to load a scala-file via the command-line?

---

edit (0):

Well, I've just googled a bit and found this forum entry:

https://www.forum-pianoteq.com/viewtopic.php?id=4725

It really seems like there is no way to do it than those crazy midi messages or pitch-bending - messages.

---

edit (1):

I've also checked this:

https://www.forum-pianoteq.com/viewtopic.php?id=5754

So there are some kind of SysEx - midi - messages that you could send to retune every midi pitch to a new pitch immediately (http://www.microtonal-synthesis.com/MIDItuning.html). I managed to get what I wanted to do through them. In case anyone else is looking for something similar, I'll just write how it works, since the form of the message may be a bit confusing.

I checked how they looked in the example-midi-file provided by the pianoteq-guy at the forum entry above. The fifth message in this example file is:

F0 7F 7F 08 02 00 01 28 28 0C 66 F7

If you deconstruct this, there are basically two / three different parts:

1. "F0 7F 7F 08 02 00 01" -> that specifies that the content of SysEx - message will be about detuning a specific midi pitch. I'm not sure what those ID things mean, but when I copied this part to a different midi-file, it worked. So just copy & paste it, I guess.

2. "28 28 0C 66" -> The first number "28" is the midi-pitch you want to retune. Remember that all of those numbers are hexadecimal, meaning that "28" actually means midi-number 40 (E2). The next three numbers (28 0C 66) say how the actual tuning of this midi note 40 will be. The first number 28 equals a semitone (E2 again). The last two numbers (0C 66) descripe how much higher the semitone is supposed to be. The first one (0C) is measured in 0.78125 cents units. Since hexadecimal 0C equals decimal 12, it means that the E2 gets 0.78125 * 12 = 9.375 cents higher. The last number (66) is measured in 0.0061 cents units. Therefore the pitch E2 gets 102 * 0.0061 = 0.6222 cents higher. The resulting pitch will be an approximately 10 cents too high E2 (9.375 + 0.6222 = 9.9972).

3. "F7" -> same like 1. just copy and paste it after 2.


So what you have to change to get the tuning you want to is 2. The message is valid for every following pitch and will be valid until another message overwrite its content.

Last edited by uummoo (25-10-2018 03:49)