这里会显示出您选择的修订版和当前版本之间的差别。
|
information:tutorial:job_plugin_lua [2012/01/16 18:22] solpie |
information:tutorial:job_plugin_lua [2012/01/17 00:44] (当前版本) |
||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | V3尾音PIT LUA脚本 源代码 (下载后自行保存为.LUA,如weiyin.LUA 然后在V3 job plugin管理器中添加即可) | + | <WRAP round info 50%>\\ |
| + | **作者: solpie** | ||
| + | </WRAP> | ||
| + | ====== Vocaloid3尾音PIT LUA脚本 源代码 ====== | ||
| + | **(下载后在V3 job plugin管理器中添加即可)** | ||
| - | {{:下载片段|myfile.foo}} | ||
| + | <code lua weiyin.lua> | ||
| + | function manifest() | ||
| + | myManifest = { | ||
| + | name = "Weiyin", | ||
| + | comment = "Weiyin PIT", | ||
| + | author = "SolPie", | ||
| + | pluginID = "{D82068B8-9A30-4912-B619-284B50B42D60}", | ||
| + | pluginVersion = "1.0.0.1", | ||
| + | apiVersion = "3.0.0.1" | ||
| + | } | ||
| + | |||
| + | return myManifest | ||
| + | end | ||
| - | <code> | ||
| - | function manifest()\ | + | -- |
| + | -- VOCALOID3 Job 插件的main入口 | ||
| + | -- | ||
| + | function main(processParam, envParam) | ||
| + | -- 実行時に渡された処理条件パラメータを取得します. | ||
| + | local beginPosTick = processParam.beginPosTick -- 选区开始时间的(开始的TICK)。 | ||
| + | local endPosTick = processParam.endPosTick -- 选区结束时间的(结束Tick). | ||
| + | local songPosTick = processParam.songPosTick -- 当前歌曲的位置时。 | ||
| - | myManifest = {\ | + | -- 実行時に渡された実行環境パラメータを取得します. |
| - | + | local scriptDir = envParam.scriptDir -- 目录路径,Lua脚本的位置(在末尾分隔符“\”内)。 | |
| - | name = "Weiyin",\ | + | local scriptName = envParam.scriptName -- Lua脚本文件名。 |
| - | + | local tempDir = envParam.tempDir -- 临时目录路径的Lua插件是可用的(在末尾分隔符“\”内)。 | |
| - | comment = "Weiyin PIT",\ | + | |
| - | + | ||
| - | author = "SolPie",\ | + | |
| - | + | ||
| - | pluginID = "{D82068B8-9A30-4912-B619-284B50B42D60}",\ | + | |
| - | + | ||
| - | pluginVersion = "1.0.0.1",\ | + | |
| - | + | ||
| - | apiVersion = "3.0.0.1"\ | + | |
| - | + | ||
| - | }\ | + | |
| - | + | ||
| - | \ | + | |
| - | + | ||
| - | return myManifest\ | + | |
| + | --xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx下面是重点xxxxxxxxxxxxxxxxxxxxx | ||
| + | local control = {} | ||
| + | local controlList = {} | ||
| + | local len=32 --尾音长度 | ||
| + | local num = 0 --值 | ||
| + | local step = 8191/(len/2)--步进值 | ||
| + | VSUpdateControlAt("PBS", endPosTick-len , 6)--设置PBS参数 | ||
| + | VSUpdateControlAt("PBS", endPosTick , 2) | ||
| + | for posTick=endPosTick-len,endPosTick-len/2 do | ||
| + | VSUpdateControlAt("PIT", posTick , num) | ||
| + | num = num + step | ||
| + | end | ||
| + | VSUpdateControlAt("PIT", endPosTick , 0) | ||
| + | |||
| end | end | ||
| - | |||
| - | \ | ||
| - | |||
| - | --\ | ||
| - | |||
| - | -- VOCALOID3 Job 插件的main入口\ | ||
| - | |||
| - | --\ | ||
| - | |||
| - | function main(processParam, envParam)\ | ||
| - | |||
| - | -- 実行時に渡された処理条件パラメータを取得します.\ | ||
| - | |||
| - | local beginPosTick = processParam.beginPosTick -- 选区开始时间的(开始的TICK)。\ | ||
| - | |||
| - | local endPosTick = processParam.endPosTick -- 选区结束时间的(结束Tick).\ | ||
| - | |||
| - | local songPosTick = processParam.songPosTick -- 当前歌曲的位置时。 | ||
| - | |||
| - | |||
| - | -- 実行時に渡された実行環境パラメータを取得します.\ | ||
| - | |||
| - | local scriptDir = envParam.scriptDir -- 目录路径,Lua脚本的位置(在末尾分隔符“<nowiki>\</nowiki>”内)。\ | ||
| - | |||
| - | local scriptName = envParam.scriptName -- Lua脚本文件名。\ | ||
| - | |||
| - | local tempDir = envParam.tempDir -- 临时目录路径的Lua插件是可用的(在末尾分隔符“<nowiki>\</nowiki>”内)。 | ||
| - | |||
| - | |||
| - | --xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx下面是重点xxxxxxxxxxxxxxxxxxxxx\ | ||
| - | |||
| - | local control = {}\ | ||
| - | |||
| - | local controlList = {}\ | ||
| - | |||
| - | local len=32 --尾音长度\ | ||
| - | |||
| - | local num = 0 --值\ | ||
| - | |||
| - | local step = 8191/(len/2)--步进值\ | ||
| - | |||
| - | VSUpdateControlAt("PBS", endPosTick-len , 6)--设置PBS参数\ | ||
| - | |||
| - | VSUpdateControlAt("PBS", endPosTick , 2)\ | ||
| - | |||
| - | for posTick=endPosTick-len,endPosTick-len/2 do\ | ||
| - | |||
| - | VSUpdateControlAt("PIT", posTick , num) \ | ||
| - | |||
| - | num = num + step\ | ||
| - | |||
| - | end\ | ||
| - | |||
| - | VSUpdateControlAt("PIT", endPosTick , 0) \ | ||
| - | |||
| - | \ | ||
| - | |||
| - | end\ | ||
| </code> | </code> | ||
| - | |||
| - | |||
| - | \\ | ||
| - | |||