diff --git a/funstim.html b/funstim.html index 3e07082..5b41ec3 100644 --- a/funstim.html +++ b/funstim.html @@ -1,7 +1,8 @@

Convert funscript to phase modulated MP3

+

Mods by astonia


-

Global Settings

+

Settings

@@ -54,7 +55,6 @@

Global Settings

-

Funscript Conversion Settings

@@ -133,7 +133,7 @@

Custom Generation Settings

- Generate output files for every combination of parameters between min and max. Global settings from above are still in effect. + Generate an output file for every combination of stroke parameters between min and max. Settings from above are still in effect.
@@ -165,13 +165,13 @@

Custom Generation Settings

- + overrides generation parameters above
Enter time offset (ms) and position pairs for each action separated by commas. When the last action is reached, the cycle will start again at the beginning. - Each pair can be further modified by appending a : and then an incrment modifier to adjust the value for the next cycle. A second : and value can be added to stop the increment when a specific value is reached. A third : and value (0 or 1) can be added to indicate if the increment should be reversed when the stop target is reached. The reverse will continue until the inital value is reached and then reverse again continuing the cycle. + Each value in the pair can be further modified by appending a : and then an increment modifier to adjust the value for the next cycle. A second : and value can be added to stop the increment when a specific value is reached. A third : and value (0 or 1) can be added to indicate if the increment should be reversed when the stop target is reached. The reverse will continue until the inital value is reached and then reverse again continuing the cycle. e.g. "500,20:-1,1000:-10,80:+1:90:1" = 1st action at +500ms at position 20 then decrement position by 1, 2nd action at +1000ms at position 80, then decrement ms by 10 and increment position by 1 until it gets to 90 then reverse until it's back at 80
@@ -314,7 +314,7 @@

Save/Load Settings

mp3tag.read(); if(mp3tag.error!='') throw new Error(mp3tag.error); mp3tag.tags.v2={}; - mp3tag.tags.v2.COMM=[{language: 'eng', descriptor: '', text: 'Converted from "'+file.name+'"'}]; + mp3tag.tags.v2.COMM=[{language: 'eng', descriptor: '', text: 'Converted from "'+file.name+'"\n'+getsettingsjson()}]; mp3tag.save({strict:true, id3v2: { padding: 4096}}); download(fileName + ".mp3", arraybufftoarray(mp3tag.buffer)); } @@ -334,7 +334,7 @@

Save/Load Settings

} // create output from custom funscript - function createmp3(fsobj,fileName) { + function createmp3(fsobj,fileName,comment) { let msg = {}; let row = document.createElement('div'); @@ -356,8 +356,15 @@

Save/Load Settings

left: { min: 1, center: 1, max: 1 }, right: { min: 1, center: 1, max: 1 } }; - msg.nor_min = 0; - msg.nor_max = 100; + msg.volumeMap.center = document.getElementById('map_center_pos').value / 100.0; + msg.volumeMap.left.min = document.getElementById('map_left_min').value / 100.0; + msg.volumeMap.left.center = document.getElementById('map_left_center').value / 100.0; + msg.volumeMap.left.max = document.getElementById('map_left_max').value / 100.0; + msg.volumeMap.right.min = document.getElementById('map_right_min').value / 100.0; + msg.volumeMap.right.center = document.getElementById('map_right_center').value / 100.0; + msg.volumeMap.right.max = document.getElementById('map_right_max').value / 100.0; + msg.nor_min = document.getElementById('nor_min').value / 1.0; + msg.nor_max = document.getElementById('nor_max').value / 1.0; msg.funscript = fsobj; @@ -372,7 +379,7 @@

Save/Load Settings

mp3tag.read(); if(mp3tag.error!='') throw new Error(mp3tag.error); mp3tag.tags.v2={}; - mp3tag.tags.v2.COMM=[{language: 'eng', descriptor: '', text: 'Custom generation by funstim script converter'}]; + mp3tag.tags.v2.COMM=[{language: 'eng', descriptor: '', text: comment}]; mp3tag.save({strict:true, id3v2: { padding: 4096}}); download(fileName + ".mp3", arraybufftoarray(mp3tag.buffer)); } @@ -516,7 +523,7 @@

Save/Load Settings

if(customtiming.length>0) { let fileName = 'custom_'+document.getElementById('frequency').value.split(",").join("_")+'hz_'+customtiming.length+'action'; - createmp3(JSON.stringify(createcustomtimingfs(customtiming,duration)),fileName); + createmp3(JSON.stringify(createcustomtimingfs(customtiming,duration)),fileName,'Custom generation by funstim script converter\n'+getsettingsjson()); } else { @@ -542,14 +549,14 @@

Save/Load Settings

}while(ms<=duration*1000); let fileName = 'stroke_'+spm+'spm_'+document.getElementById('frequency').value.split(",").join("_")+'hz_'+p1+'_'+p2; - createmp3(JSON.stringify(fs),fileName); + createmp3(JSON.stringify(fs),fileName,'Custom generation by funstim script converter\n'+getsettingsjson()); } } } } } - function clickSaveSettings(e) + function getsettingsjson() { inp=document.getElementsByTagName('input'); sel=document.getElementsByTagName('select'); @@ -570,7 +577,12 @@

Save/Load Settings

settings.push({id:sel[i].id,val:sel[i].value}); } } - document.getElementById('settings').value=JSON.stringify(settings); + return JSON.stringify(settings); + } + + function clickSaveSettings(e) + { + document.getElementById('settings').value=getsettingsjson(); } function clickLoadSettings(e)