Synth1/VST to ModPlug Parameter Converter

Started by Speed, April 21, 2021, 00:26:24

Previous topic - Next topic

Speed

Synth1/VST to ModPlug Parameter Converter
by Speed / Audiologic Experiment

Simple tool that I made some time ago.
It saved me a lot of time and allowed to create all advanced magic by controlling dynamically many VST parameters at the same time in quick and more comfortable way.
For example, if I needed to control gain or filter or any other parameter of any VST, by changing it precisely up and down during playback, I do not had to calculate 128 or other non 10/100/1000 range parameters with 1000 percent MPT range for exact values anymore.
It was made for my personal use (maybe there are other, better tools, I do not know), but maybe someone will find it helpful for his or her own music projects, depending on how often VST plugins with non 10/100/1000 range parameters are controlled dynamically.

It is pure JS code, so you can see no virus there, no dead link in the future, and you can run it on anything that has basic browser (IE, Chrome, FireFox, ...), even very old versions should be compatible.
Just copy code, paste in notepad, save as converter.htm and open with your browser by drag and drop.

Code:
<b>Synth1/VST to ModPlug Parameter Converter by Speed / Audiologic Experiment</b><br>
Note (Mode): <input type="text" size="3" value="PC " id="v_n" onclick="if(this.value=='PC '){this.value='PCs';}else{this.value='PC ';}" title="Click to switch effect mode. PC for instant. PCs for smooth."> |
Instrument (FX ID): <input type="text" size="3" value="1" id="v_i" onclick="this.select();" title="Click to set ID of FX VST slot to dynamically control. 1-250."> |
Effect (Parameter): <input type="text" size="3" value="1" id="v_e" onclick="this.select();" title="Click to set ID of parameter to dynamically control. You can check them in Plugins section of General tab. 0-999."> |
Range (0+Max): <input type="text" size="3" value="128" id="v_r" onclick="this.select();" title="Click to set total amount of values for parameter, including 0. Synth1 has 128 for most of them. Fomula for conversion is (value/range)*1000 rounded up."> <input type="checkbox" id="v_128" title="If checked, then 128 range will use nicer converted values. In this special mode, 0/25/50/75% are fixed to 0/250/500/750 and other values are relatively increased by 8." checked> 128Mod |
Space (Empty Notes): <input type="text" size="3" value="0" id="v_s" onclick="this.select();" title="Click to set amount of empty spaces between each parameter change. 0 for none."> |
<input type="button" value="Help" onclick="alert('Hover mouse cursor over each element to get short description.');">
<br>
Progress (start-end): <input type="text" size="3" value="0" id="v_start" onclick="this.select();" title="Click to set starting value for automation. Lower than ending value for increase. Higher than ending value for decrease.">-<input type="text" size="3" value="127" id="v_end" onclick="this.select();" title="Click to set ending value for automation."> |
Precision (gradation level): <input type="text" size="3" value="1" id="v_precision" onclick="this.select();" title="Click to set amount to modify per value for automation. 1 for highest precision."> |
Length (rows per value): <input type="text" size="3" value="1" id="v_length" onclick="this.select();" title="Click to set amount of rows per value for automation."> |
<input type="button" value="Automate" onclick="automate();" title="Click to automate range of values in Values input. Generated values can still be edited manually and output refreshed with Convert button.">
<br>Values (1 per line) =&gt; ModPlug Parameters (ready to copy into pattern): <input type="button" value="Convert & Auto Copy" onclick="convert();" title="Click to convert Values into ModPlug Parameters. They are automatically copied to clipboard. Just paste them in ModPlug Patterns tab.">
<br>
<textarea rows="64" cols="4" id="v_input" ondblclick="this.select();" title="Type parameter values, each in new line. Empty lines can be used for empty spaces between values. Double click to select all for quick remove."></textarea><textarea rows="64" cols="20" id="v_output" ondblclick="this.select(); document.execCommand('copy');" title="Parameter values converted for ModPlug. Double click to select all and auto copy to clipboard. Just paste them in ModPlug Patterns tab."></textarea>
<script>
function mod128()
{
var x=0;
var m128=[];
for(var i=0; i<128; i++)
{
if(i==0){x=0;}
else if(i==32){x=250;}
else if(i==64){x=500;}
else if(i==96){x=750;}
m128[i]=zeros(x);
x=x+8;
}
return m128;
}
function zeros(x)
{
if(x<10){return '00'+x;}
else if(x<100){return '0'+x;}
return ''+x;
}
function ids(x)
{
var v=[':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'];
if(x<10){return '0'+x;}
if(x>99)
{
x=''+x;
return v[(Math.floor(x/10)-10)]+x[x.length-1];
}
return ''+x;
}
function convert()
{
var v='ModPlug Tracker MPT\n';
var v0='|...........';
var v1='|'+document.getElementById('v_n').value+''+ids(document.getElementById('v_i').value)+''+zeros(document.getElementById('v_e').value);
var max=document.getElementById('v_r').value;
var space=document.getElementById('v_s').value;
var input=document.getElementById('v_input').value.split('\n');
var v128=0;
var m128=[];
if(document.getElementById('v_128').checked==true && max==128){v128=1; m128=mod128();}
for(var i=0; i<input.length; i++)
{
if(input[i]==""){v+=v0+'\n';}
else if(v128==1){v+=v1+m128[input[i]]+'\n';}
else{v+=v1+zeros(Math.ceil((input[i]/max)*1000))+'\n';}
for(var i2=0; i2<space; i2++){v+=v0+'\n';}
}
document.getElementById('v_output').value=v;
document.getElementById('v_output').select();
document.execCommand('copy');
}
function automate()
{
var v='';
var v0=document.getElementById('v_start').value;
var v1=document.getElementById('v_end').value;
var precision=(document.getElementById('v_precision').value*1);
var length=document.getElementById('v_length').value;
var counter=0;
if(v0>v1){precision*=-1;}
counter=v0*1;
while(true)
{
if((precision<0 && counter<=v1) || (precision>0 && counter>=v1)){counter=v1;}
v+=counter+'\n';
for(var i2=1; i2<length; i2++){v+='\n';}
if(counter==v1){v=v.substr(0, (v.length-1)); break;}
counter+=precision;
}
document.getElementById('v_input').value=v;
convert();
}
</script>


Elements:
Note (Mode) - Click to switch effect mode. PC for instant. PCs for smooth.
Instrument (FX ID) - Click to set ID of FX VST slot to dynamically control. 1-250.
Effect (Parameter) - Click to set ID of parameter to dynamically control. You can check them in Plugins section of General tab. 0-999.
Range (0+Max) - Click to set total amount of values for parameter, including 0. Synth1 has 128 for most of them.
Space (Empty Notes) - Click to set amount of empty spaces between each parameter change. 0 for none.
Help - Hover mouse cursor over each element to get short description.
Progress (start-end) - Click to set starting value for automation. Lower than ending value for increase. Higher than ending value for decrease. Click to set ending value for automation.
Precision (gradation level) - Click to set amount to modify per value for automation. 1 for highest precision.
Length (rows per value) - Click to set amount of rows per value for automation.
Automate - Click to automate range of values in Values input. Generated values can still be edited manually and output refreshed with Convert button.
Values (1 per line) - Type parameter values, each in new line. Empty lines can be used for empty spaces between values. Double click to select all for quick remove.
ModPlug Parameters (ready to copy into pattern) - Parameter values converted for ModPlug. Double click to select all and auto copy to clipboard. Just paste them in ModPlug Patterns tab.
Convert & Auto Copy - Click to convert Values into ModPlug Parameters. They are automatically copied to clipboard. Just paste them in ModPlug Patterns tab.

Example:
Increasing values for Gain in Synth1 VST (PCs for smooth, FX ID is 1, parameter ID is 29, range is 128, no empty notes needed).

Values (input):
96
100
104
108
112
116
120
124
127


ModPlug Parameters (output to paste in ModPlug pattern):
ModPlug Tracker MPT
|PCs01001750
|PCs01001782
|PCs01001814
|PCs01001846
|PCs01001878
|PCs01001910
|PCs01001942
|PCs01001974
|PCs01001998


To calculate single value by hand, formula is ((value/max)*1000) rounded up.
For Synth1 with 128 range parameter, simple value 64 would be ((64/128)*1000), which gives 500.

All values for 128 range parameter if someone prefer to copy by hand:
000 = 000
001 = 008
002 = 016
003 = 024
004 = 032
005 = 040
006 = 048
007 = 056

008 = 064
009 = 072
010 = 080
011 = 088
012 = 096
013 = 104
014 = 112
015 = 120

016 = 128
017 = 136
018 = 144
019 = 152
020 = 160
021 = 168
022 = 176
023 = 184

024 = 192
025 = 200
026 = 208
027 = 216
028 = 224
029 = 232
030 = 240
031 = 248

032 = 250
033 = 258
034 = 266
035 = 274
036 = 282
037 = 290
038 = 298
039 = 306

040 = 314
041 = 322
042 = 330
043 = 338
044 = 346
045 = 354
046 = 362
047 = 370

048 = 378
049 = 386
050 = 394
051 = 402
052 = 410
053 = 418
054 = 426
055 = 434

056 = 442
057 = 450
058 = 458
059 = 466
060 = 474
061 = 482
062 = 490
063 = 498

064 = 500
065 = 508
066 = 516
067 = 524
068 = 532
069 = 540
070 = 548
071 = 556

072 = 564
073 = 572
074 = 580
075 = 588
076 = 596
077 = 604
078 = 612
079 = 620

080 = 628
081 = 636
082 = 644
083 = 652
084 = 660
085 = 668
086 = 676
087 = 684

088 = 692
089 = 700
090 = 708
091 = 716
092 = 724
093 = 732
094 = 740
095 = 748

096 = 750
097 = 758
098 = 766
099 = 774
100 = 782
101 = 790
102 = 798
103 = 806

104 = 814
105 = 822
106 = 830
107 = 838
108 = 846
109 = 854
110 = 862
111 = 870

112 = 878
113 = 886
114 = 894
115 = 902
116 = 910
117 = 918
118 = 926
119 = 934

120 = 942
121 = 950
122 = 958
123 = 966
124 = 974
125 = 982
126 = 990
127 = 998



Saga Musix

» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.