<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Modartt user forum - Simple batch export script for windows users]]></title>
	<link rel="self" href="https://forum.modartt.com/extern.php?action=feed&amp;tid=2326&amp;type=atom"/>
	<updated>2012-05-13T18:40:13Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.modartt.com/viewtopic.php?id=2326</id>
		<entry>
			<title type="html"><![CDATA[Re: Simple batch export script for windows users]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=22112#p22112"/>
			<content type="html"><![CDATA[<p>For my specific use case, Red Dot Forever is less simple. I use a Roland HP-302 to record improvisation, so for me I just hit a button and go. Once I&#039;ve accumulated a few dozen midi files, I want to export to high quality WAV but not have to manually do it for each file, this is why I wrote this script. Maybe it will be useful to somebody out there.</p>]]></content>
			<author>
				<name><![CDATA[derekandrews]]></name>
				<uri>https://forum.modartt.com/profile.php?id=2358</uri>
			</author>
			<updated>2012-05-13T18:40:13Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=22112#p22112</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple batch export script for windows users]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=22106#p22106"/>
			<content type="html"><![CDATA[<p>Wouldn&#039;t it be easier to use Red Dot Forever? It captures your MIDI and saves it to a file. It start recording when you click the record button and stops when you click the stop button. Simple.</p>]]></content>
			<author>
				<name><![CDATA[lhorwinkle]]></name>
				<uri>https://forum.modartt.com/profile.php?id=2798</uri>
			</author>
			<updated>2012-05-13T17:48:04Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=22106#p22106</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Simple batch export script for windows users]]></title>
			<link rel="alternate" href="https://forum.modartt.com/viewtopic.php?pid=22093#p22093"/>
			<content type="html"><![CDATA[<p>Hi everyone,</p><p>I use Pianoteq PLAY to export dozens (and dozens) of piano improvisations that I record on a daily basis from my digital piano.</p><p>Since Pianoteq does not have batch export, I looked into writing a simple visual basic script to perform batch export. It uses the file open and the export functions. I could not get ctrl to work, so I changed the default key combinations to simply O and E. Here&#039;s the script once I changed the key combinations:</p><div class="codebox"><pre><code>Const ForReading = 1
Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objTextFile = objFSO.OpenTextFile _
    (&quot;files.txt&quot;, ForReading)

set a=createobject(&quot;wscript.shell&quot;)
a.run(&quot;pianoteq&quot;)
wscript.sleep 10000

Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline

    a.sendkeys &quot;o&quot;
    a.sendkeys strNextLine
    a.sendkeys &quot;{ENTER}&quot;
    a.sendkeys &quot;e&quot;
    a.sendkeys &quot;{TAB}&quot;
    a.sendkeys &quot;{TAB}&quot;
    a.sendkeys &quot;{TAB}&quot;
    a.sendkeys &quot;{TAB}&quot;
    a.sendkeys &quot;{TAB}&quot;
    a.sendkeys &quot;{ENTER}&quot;
    wscript.sleep 60000
Loop</code></pre></div><p>Just put the above into a file called export.vbs. In Windows, you can double click such a file to cause it to execute. This script must have a file called &quot;files.txt&quot; in the same directory spelling out absolute paths to each midi file you wish to export. To create such a file, I usually use ls -1. I&#039;m not sure how I&#039;d do that in windows actually <i class="far fa-smile-beam smiley"></i> I use cygwin on top of windows...</p><p>sample files.txt:</p><p>&quot;C:\organize\recordings\midi\2011\2011 August 01 01.MID&quot;<br />&quot;C:\organize\recordings\midi\2011\2011 August 01 02.MID&quot;<br />&quot;C:\organize\recordings\midi\2011\2011 August 03 02.MID&quot;<br />&quot;C:\organize\recordings\midi\2011\2011 August 08 01.MID&quot;</p><br /><p>Anyway---the script is not very robust and needs a &quot;worst case&quot; wait time for each export. It is what I could do in the space of a couple of hours without really knowing vbscript very well. But, for my purposes it works great. Once I have a few dozen (or hundred) midi files I want to export to wav, I just get a list of the files and set this script running and by morning I have a huge pile of exported WAV files.</p><p>To cancel a script in windows, you must ctrl+alt+delete into the task manager and kill the wscript process.</p><p>Hopefully that ends up useful to somebody! Maybe there&#039;s already a better solution similar to this on this forum, I hadn&#039;t found one when I searched, though.</p>]]></content>
			<author>
				<name><![CDATA[derekandrews]]></name>
				<uri>https://forum.modartt.com/profile.php?id=2358</uri>
			</author>
			<updated>2012-05-13T01:03:40Z</updated>
			<id>https://forum.modartt.com/viewtopic.php?pid=22093#p22093</id>
		</entry>
</feed>
