<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Modartt user forum - Setting Random Seed in command line interface]]></title>
		<link>https://forum.modartt.com/viewtopic.php?id=11481</link>
		<description><![CDATA[The most recent posts in Setting Random Seed in command line interface.]]></description>
		<lastBuildDate>Fri, 10 May 2024 03:50:10 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996771#p996771</link>
			<description><![CDATA[<p>I see, I did not even know what a random seed is.<br />Thanks, <br />Marcos</p>]]></description>
			<author><![CDATA[null@example.com (marcos daniel)]]></author>
			<pubDate>Fri, 10 May 2024 03:50:10 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996771#p996771</guid>
		</item>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996768#p996768</link>
			<description><![CDATA[<p>sharpnine, I want to be able to change the condition of the piano and have it repeatable, by setting the same random seed. I also want to be able to change it if I don&#039;t like the specific &#039;tuning&#039;.</p>]]></description>
			<author><![CDATA[null@example.com (hagagogu)]]></author>
			<pubDate>Thu, 09 May 2024 22:01:00 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996768#p996768</guid>
		</item>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996765#p996765</link>
			<description><![CDATA[<div class="quotebox"><cite>hagagogu wrote:</cite><blockquote><p>Thanks for the reply marcos! This doesn&#039;t vary the random seed though, so the condition would always be one of 10 values.</p></blockquote></div><p>hagagogu&#039;s original question about the random seed hasn&#039;t been addressed. The random seed is different from a random number.<br />Since hagagogu has not clarified their reason for wanting to set the random seed, it has been difficult to respond.<br />Typically each time you run pianoteq, and click the dice, you get a random set of parameters. I assume that this series will be different each time you run pianoteq (although I haven&#039;t tried it recently). This is typically what we expect from random. So if you start pianoteq, and click the dice once, then you get a setup that you haven&#039;t seen before, and when you run pianoteq again later, and click the dice once, you will get a different random setup.</p><p>Setting the random seed is typically for purposes that require repeatability. For example, you click the dice three times, and you get three unique random setups.<br />Then the next time you run pianoteq you wish to get exactly the same three setups for the first three clicks.<br />You would accomplish this by setting the random seed to a known value, each time you start pianoteq. Typically if you do not set the random seed explicitly, then the system clock will be used to initialize the seed to a value based on the clock and which will therefore be different each time you run.<br />I am not sure if hagagogu is trying to get repeatability. If not, then I am not sure what they are after, or perhaps they are using the term &#039;random seed&#039; incorrectly. It would be good if they can clarify their use case.</p><p>In any case I am not aware of a way to explicitly set the random seed in pianoteq, but such a feature likely exists because software testers will often find this useful. They may want to achieve repeatability when running tests that involve random numbers.</p>]]></description>
			<author><![CDATA[null@example.com (sharpnine)]]></author>
			<pubDate>Thu, 09 May 2024 17:10:19 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996765#p996765</guid>
		</item>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996747#p996747</link>
			<description><![CDATA[<div class="quotebox"><cite>hagagogu wrote:</cite><blockquote><p>Thanks for the reply marcos! This doesn&#039;t vary the random seed though, so the condition would always be one of 10 values.</p></blockquote></div><p>Since English is not my native language, maybe I didn&#039;t understand correctly what a random seed is. In any case, the possible values the script gives are 0, 0.01, 0.02, ..., 9.98, 9.99, 10, which are taken pseudo-randomly.</p><p>I asked Bing AI... in Windows this could be done by the following commands in the PowerShell:</p><div class="quotebox"><cite>PS wrote:</cite><blockquote><p>cd &#039;C:\Program Files\Modartt\Pianoteq 8\&#039; <br />$random_number = Get-Random<br />echo $random_number<br />$divisor = 214748364.7<br />$condition = $random_number/$divisor<br />echo $condition<br />&amp; &#039;.\Pianoteq 8.exe&#039; --set-param Condition=$condition</p></blockquote></div><p>The description is as follows:<br />cd &#039;C:\Program Files\Modartt\Pianoteq 8\&#039;: change the actual directory to Pianoteq&#039;s<br />$random_number = Get-Random: gets a random number between 0 and 2147483647, which is 2^31-1<br />echo $random_number: just prints the number to the screen, it is not necessary<br />$divisor = 214748364.7: 2147483647/10; in order to get a number between 0 and 10<br />$condition = $random_number/$divisor: this calculation will &#039;normalize&#039; the random number between 0 and 10<br />echo $condition: just check the result<br />&amp; &#039;.\Pianoteq 8.exe&#039; --set-param Condition=$condition: runs Pianoteq with the condition</p><p>All this can be run without typing each time by saving it on a text file with the extension .ps1 (the extension of the Windows&#039; PowerShell).</p><p>I have also asked the AI for Linux, but I can&#039;t post it here since I don&#039;t know if the answer works (I must confess with shame that I have stopped using Linux lately, and at this moment I do not have the devices on which I run it on hand). But if this is what you need, you can try and post the results here...<br />Marcos</p>]]></description>
			<author><![CDATA[null@example.com (marcos daniel)]]></author>
			<pubDate>Wed, 08 May 2024 12:47:29 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996747#p996747</guid>
		</item>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996744#p996744</link>
			<description><![CDATA[<div class="quotebox"><cite>hagagogu wrote:</cite><blockquote><p>Thanks for the reply marcos! This doesn&#039;t vary the random seed though, so the condition would always be one of 10 values.</p></blockquote></div><p>I assume you are running Pianoteq from the command line. If so, run &quot;pianoteq --help&quot; and see if there is an option there for what you are trying to do. If not, there is likely no solution, but you could contact Modartt directly to verify.</p>]]></description>
			<author><![CDATA[null@example.com (wonner)]]></author>
			<pubDate>Wed, 08 May 2024 01:30:47 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996744#p996744</guid>
		</item>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996741#p996741</link>
			<description><![CDATA[<p>Thanks for the reply marcos! This doesn&#039;t vary the random seed though, so the condition would always be one of 10 values.</p>]]></description>
			<author><![CDATA[null@example.com (hagagogu)]]></author>
			<pubDate>Tue, 07 May 2024 21:07:39 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996741#p996741</guid>
		</item>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996686#p996686</link>
			<description><![CDATA[<p>Sorry I forgot about this.<br />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).<br />The most complicated part is to manage the spaces in the folder and file names, I managed to make it work but I don&#039;t understand why it works now, neither the reason it did not work at the first try. May be in your distro you&#039;ll need to fiddle with the code. <br />I tested this script and works fine for me under Armbian Linux:<br />(it should be saved as a Python file, e.g. filename.py next to Pianoteq binary file. If not, you must add the path...)</p><div class="quotebox"><cite>Python code wrote:</cite><blockquote><p>import os<br />import random</p><p>randon_number = random.uniform(0, 10)&nbsp; #generate a random number between 0 and 10<br />print(randon_number)<br />rounded_number = round(randon_number,2) #round the number to 2 decimals (idk if necessary)<br />print(rounded_number)<br />number_in_string = str(rounded_number)&nbsp; #convert from float to string<br />print(number_in_string)<br />path_to_pt =&quot;\&quot;./Pianoteq 8\&quot;&quot;&nbsp; #path to PT<br />parameter = &quot; --set-param Condition=&quot;+ number_in_string&nbsp; &nbsp; &nbsp;#concatenate the random number<br />command = path_to_pt + parameter<br />print(command)<br />os.system(command)</p></blockquote></div><p>Of course you can remove the &quot;print&quot; stuff.</p><p>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 &quot;&quot; usage... in fact I first wrote it under windows and then noticed it did not work under Linux, so this is the original version):</p><br /><div class="quotebox"><cite>Python code wrote:</cite><blockquote><p>import subprocess<br />import random</p><br /><p>randon_number = random.uniform(0, 10)&nbsp; #generate a random number between 0 and 10<br />print(randon_number)<br />rounded_number = round(randon_number,2) #round the number to 2 decimals (idk if necessary)<br />print(rounded_number)<br />number_in_string = str(rounded_number)&nbsp; #convert from float to string<br />print(number_in_string)<br />path_to_pt =&quot;C:\\Program Files\\Modartt\\Pianoteq 8/Pianoteq 8.exe --set-param Condition=&quot;&nbsp; #path to PT<br />command = path_to_pt + number_in_string&nbsp; &nbsp; &nbsp;#concatenate the random number<br />print(command)<br />subprocess.run(command)</p></blockquote></div><p>I hope it helps, <br />Marcos</p>]]></description>
			<author><![CDATA[null@example.com (marcos daniel)]]></author>
			<pubDate>Fri, 03 May 2024 02:56:34 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996686#p996686</guid>
		</item>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996685#p996685</link>
			<description><![CDATA[<p>Anyone knows? <i class="far fa-smile smiley"></i> If it&#039;s not possible, that would be good to know too!</p>]]></description>
			<author><![CDATA[null@example.com (hagagogu)]]></author>
			<pubDate>Thu, 02 May 2024 21:33:02 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996685#p996685</guid>
		</item>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996597#p996597</link>
			<description><![CDATA[<p>Linux, does that matter?</p>]]></description>
			<author><![CDATA[null@example.com (hagagogu)]]></author>
			<pubDate>Tue, 23 Apr 2024 19:05:39 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996597#p996597</guid>
		</item>
		<item>
			<title><![CDATA[Re: Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996585#p996585</link>
			<description><![CDATA[<p>Are you using windows or linux?</p>]]></description>
			<author><![CDATA[null@example.com (marcos daniel)]]></author>
			<pubDate>Tue, 23 Apr 2024 14:49:06 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996585#p996585</guid>
		</item>
		<item>
			<title><![CDATA[Setting Random Seed in command line interface]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=996580#p996580</link>
			<description><![CDATA[<p>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?</p><p>A separate question, is it possible to use the randomize (dice) button on the command line?</p><p>Thank you!</p>]]></description>
			<author><![CDATA[null@example.com (hagagogu)]]></author>
			<pubDate>Tue, 23 Apr 2024 08:12:47 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=996580#p996580</guid>
		</item>
	</channel>
</rss>
