Topic: Setting Random Seed in command line interface

Calling ./Pianoteq 8 --list-param shows that Condition can be set from 0 to 10.00. How do I set the random seed for condition?

A separate question, is it possible to use the randomize (dice) button on the command line?

Thank you!

Re: Setting Random Seed in command line interface

Are you using windows or linux?

Pianoteq Pro - Bechstein - Blüthner - Grotrian - K2 - Kremsegg 1 & 2 - Petrof - Steingraeber - Steinway B & D - YC5
Kawai CL35 & MP11

Re: Setting Random Seed in command line interface

Linux, does that matter?

Re: Setting Random Seed in command line interface

Anyone knows? If it's not possible, that would be good to know too!

Re: Setting Random Seed in command line interface

Sorry I forgot about this.
I was asking the OS because there are some ways to generate random numbers in the console. So you could write a little bash script or, in windows, a .bat file. But I think it would be much easier to write a Python script (could be a little C program, too).
The most complicated part is to manage the spaces in the folder and file names, I managed to make it work but I don't understand why it works now, neither the reason it did not work at the first try. May be in your distro you'll need to fiddle with the code.
I tested this script and works fine for me under Armbian Linux:
(it should be saved as a Python file, e.g. filename.py next to Pianoteq binary file. If not, you must add the path...)

Python code wrote:

import os
import random

randon_number = random.uniform(0, 10)  #generate a random number between 0 and 10
print(randon_number)
rounded_number = round(randon_number,2) #round the number to 2 decimals (idk if necessary)
print(rounded_number)
number_in_string = str(rounded_number)  #convert from float to string
print(number_in_string)
path_to_pt ="\"./Pianoteq 8\""  #path to PT
parameter = " --set-param Condition="+ number_in_string     #concatenate the random number
command = path_to_pt + parameter
print(command)
os.system(command)

Of course you can remove the "print" stuff.

For some reason, the same script does not work under Windows 10, this slighty modified version does work (again, I believe the culprit are the /, spaces and "" usage... in fact I first wrote it under windows and then noticed it did not work under Linux, so this is the original version):


Python code wrote:

import subprocess
import random


randon_number = random.uniform(0, 10)  #generate a random number between 0 and 10
print(randon_number)
rounded_number = round(randon_number,2) #round the number to 2 decimals (idk if necessary)
print(rounded_number)
number_in_string = str(rounded_number)  #convert from float to string
print(number_in_string)
path_to_pt ="C:\\Program Files\\Modartt\\Pianoteq 8/Pianoteq 8.exe --set-param Condition="  #path to PT
command = path_to_pt + number_in_string     #concatenate the random number
print(command)
subprocess.run(command)

I hope it helps,
Marcos

Last edited by marcos daniel (Today 03:59)
Pianoteq Pro - Bechstein - Blüthner - Grotrian - K2 - Kremsegg 1 & 2 - Petrof - Steingraeber - Steinway B & D - YC5
Kawai CL35 & MP11