├── .gitignore ├── Various ├── Articulation Map │ ├── jsfx │ │ └── zaibuyidao_articulation_map │ │ │ └── simul-arts.txt │ └── banks │ │ ├── 75-96 Three-Body Raindrop & Blade (扬琴落英).reabank │ │ ├── 75-96 Three-Body Raindrop & Blade.reabank │ │ ├── 73-96 Ample Sound Qudi (曲笛風逸).reabank │ │ ├── 72-96 Ample Sound Erhu (二胡凝月).reabank │ │ ├── 74-96 Three-Body Whisper of Loong (曲笛新雨).reabank │ │ ├── 74-96 Three-Body Whisper of Loong.reabank │ │ ├── 67-1 Cinematic Studio Strings.reabank │ │ ├── 68-2 Cinematic Studio Strings (UACC-58).reabank │ │ ├── 100-0 LASS 3 Full (CC Stack-0).reabank │ │ ├── 70-96 Ample Metal Eclipse (金属吉他).reabank │ │ ├── 71-96 Ample Metal Hellrazer (九弦吉他).reabank │ │ ├── 66-60 Spitfire Albion 2 (UACC-32).reabank │ │ └── 66-50 Spitfire Masse (UACC-32).reabank ├── Soundmole │ ├── data │ │ ├── icons.otf │ │ ├── icons-regular.otf │ │ └── odrf_upr_regular.otf │ └── zaibuyidao_Soundmole - Add Selected Files to Target Database.lua ├── Advanced Solo │ ├── lib │ │ └── speaker.cur │ └── zaibuyidao_Toggle Solo for Selected Tracks.lua ├── UCS │ ├── UCS_list_custom.csv │ └── lib │ │ ├── config.lua │ │ └── ucs.lua ├── SFX Tag Search │ ├── req │ │ ├── JGuiFunctions.lua │ │ ├── mouse.lua │ │ ├── j_trackstatechunk_functions.lua │ │ ├── JGuiColors.lua │ │ ├── j_string_functions.lua │ │ └── j_file_functions.lua │ └── lib │ │ ├── config-favorite-default.ini │ │ ├── config-thesaurus-default.ini │ │ ├── config-database-default.ini │ │ ├── LIP.lua │ │ ├── config-custom-tags-default.ini │ │ ├── config-ucs-default.ini │ │ └── config-ucs-synonym-index-default.ini ├── UCS Tag Search Rename Bundle.lua ├── Soundmole.lua ├── SFX Tag Search Bundle.lua └── Articulation Map Bundle.lua ├── JSFX ├── zaibuyidao_bank_msb_lsb_mapping │ └── bank-map.txt ├── zaibuyidao_midi_bank_program │ └── Roland SC-88 Pro.txt ├── MIDI Off Velocity Limiter.jsfx ├── MIDI Transform CC.jsfx ├── MIDI CC Events First.jsfx ├── MIDI Route CC To Channel.jsfx ├── MIDI Route PC To Channel.jsfx └── MIDI Bank Program on Specific Note.jsfx ├── README.md ├── Development ├── Lokasenna_GUI Library │ └── Set Lokasenna_GUI library.lua └── Lokasenna_GUI library.lua ├── Games ├── Blocks DS │ └── lib │ │ └── utils.lua └── Blocks DS.lua ├── Utility ├── zaibuyidao_Restart from Edit Cursor (If Playing).lua ├── zaibuyidao_Cakewalk Style Cursor Follow (Main).lua ├── zaibuyidao_Cakewalk Style Cursor Follow (MIDI Editor).lua ├── zaibuyidao_Media Explorer Search Filter.lua ├── zaibuyidao_Mouse Modifiers - Toggle Razor Editing.lua ├── zaibuyidao_Mouse Modifiers - Toggle Time Selection.lua ├── zaibuyidao_Cakewalk Style Cursor Follow (Main Or MIDI Editor).lua ├── zaibuyidao_Mouse Modifiers - Toggle Marquee Selection.lua └── zaibuyidao_Auto-Load VSTi for MIDI Playback (Settings).lua ├── MIDI Editor ├── zaibuyidao_Select All Events.lua ├── zaibuyidao_Unselect All Events.lua ├── zaibuyidao_Move Edit Cursor +10.lua ├── zaibuyidao_Move Edit Cursor -10.lua ├── zaibuyidao_Insert All Sound Off.lua ├── zaibuyidao_Random CC Value.lua ├── zaibuyidao_Trim Note Right Edge (Percentages).lua ├── zaibuyidao_Move Edit Cursor.lua ├── zaibuyidao_Note Off Velocity +01.lua ├── zaibuyidao_Trim Note Left Edge (Percentages).lua ├── zaibuyidao_Note Off Velocity +10.lua ├── zaibuyidao_Note Off Velocity -01.lua ├── zaibuyidao_Note Off Velocity -10.lua ├── zaibuyidao_Event Value -01.lua ├── zaibuyidao_Event Value -10.lua ├── zaibuyidao_Event Value +01.lua ├── zaibuyidao_Event Value +10.lua ├── zaibuyidao_Set CC Value (Percentages).lua ├── zaibuyidao_Set CC Value.lua ├── zaibuyidao_Set Velocity (Percentages).lua ├── zaibuyidao_Random Note Mute.lua ├── zaibuyidao_Remove Redundant CCs.lua ├── zaibuyidao_Select Note With The Same Channel.lua ├── zaibuyidao_Humanize Velocity (Customize).lua ├── zaibuyidao_Insert Random CC Events (For Selected Notes).lua ├── zaibuyidao_Insert Random CC Events.lua ├── zaibuyidao_Interval.lua ├── zaibuyidao_Slide +01.lua ├── zaibuyidao_Slide -01.lua ├── zaibuyidao_Select Note With The Same Channel (Under Mouse).lua ├── zaibuyidao_Slide +10.lua ├── zaibuyidao_Slide -10.lua ├── zaibuyidao_Time (QN).lua ├── zaibuyidao_Insert Sustain Pedal.lua ├── zaibuyidao_Random Velocity (Customize).lua ├── zaibuyidao_Time (PPQ).lua ├── zaibuyidao_Trim MIDI Item Edges.lua ├── zaibuyidao_Insert Pitch Bend Reset.lua ├── zaibuyidao_Random CC Value (Limit Range).lua ├── zaibuyidao_Duplicate CC (For Selected CC).lua ├── zaibuyidao_Random Velocity (Limit Range).lua ├── zaibuyidao_Select Top Notes In Chord (Leave Single Notes Selected).lua ├── zaibuyidao_Select Bottom Notes In Chord (Leave Single Notes Selected).lua ├── zaibuyidao_Random Velocity.lua ├── zaibuyidao_Duplicate CC.lua └── zaibuyidao_Move Events Left 10ms.lua ├── Tracks Properties └── zaibuyidao_Remove All Empty Tracks.lua ├── Items Editing ├── zaibuyidao_Random Take Pan.lua ├── zaibuyidao_Random Take Volume.lua ├── zaibuyidao_Random Item Volume.lua ├── zaibuyidao_Move Items To Track Of First Selected Item.lua ├── zaibuyidao_Play Stop From Mouse Position.lua ├── zaibuyidao_Set Take Pan.lua ├── zaibuyidao_Set Take Pitch.lua ├── zaibuyidao_Random Take Pitch.lua ├── zaibuyidao_Set Take Volume.lua ├── zaibuyidao_Set Item Volume.lua ├── zaibuyidao_Equal Cut At Edit Cursor.lua ├── zaibuyidao_Move Selected Items +10.lua ├── zaibuyidao_Move Selected Items -10.lua ├── zaibuyidao_Equal Cut.lua ├── zaibuyidao_Move Selected Items.lua ├── zaibuyidao_Copy Align Item Position.lua ├── zaibuyidao_List Names of Selected Items.lua ├── zaibuyidao_List Names of Selected Items and Their Source Files.lua └── zaibuyidao_Scale Item Volume.lua ├── Regions ├── zaibuyidao_Set Selected Items to Matching Region Colors.lua └── zaibuyidao_Randomize Region Colors.lua ├── MIDI Event List Editor └── zaibuyidao_Insert NRPN.lua └── Markers ├── zaibuyidao_Random Marker Color.lua └── zaibuyidao_Random Marker Region Color.lua /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /Various/Articulation Map/jsfx/zaibuyidao_articulation_map/simul-arts.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /JSFX/zaibuyidao_bank_msb_lsb_mapping/bank-map.txt: -------------------------------------------------------------------------------- 1 | // @noindex 2 | 0-100=0-96 3 | 0-10=0-77 -------------------------------------------------------------------------------- /Various/Soundmole/data/icons.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zaibuyidao/ReaScripts/HEAD/Various/Soundmole/data/icons.otf -------------------------------------------------------------------------------- /Various/Advanced Solo/lib/speaker.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zaibuyidao/ReaScripts/HEAD/Various/Advanced Solo/lib/speaker.cur -------------------------------------------------------------------------------- /Various/Soundmole/data/icons-regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zaibuyidao/ReaScripts/HEAD/Various/Soundmole/data/icons-regular.otf -------------------------------------------------------------------------------- /Various/Soundmole/data/odrf_upr_regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zaibuyidao/ReaScripts/HEAD/Various/Soundmole/data/odrf_upr_regular.otf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ReaScripts 2 | REAPER, ReaScripts, MIDI Editor 3 | 4 | My ReaPack Repo : https://github.com/zaibuyidao/ReaScripts/raw/master/index.xml 5 | 6 | Donation : http://www.paypal.me/zaibuyidao 7 | -------------------------------------------------------------------------------- /JSFX/zaibuyidao_midi_bank_program/Roland SC-88 Pro.txt: -------------------------------------------------------------------------------- 1 | //This TXT file serves as the configuration file for "MIDI Bank Program on Specific Note (File-Based).jsfx". Each line in the file must adhere to a specific format: note number, Bank MSB, Bank LSB, and Program setting. 2 | 3 | 24,1,3,15 4 | 25,1,3,50 -------------------------------------------------------------------------------- /Various/UCS/UCS_list_custom.csv: -------------------------------------------------------------------------------- 1 | Category,SubCategory,CatID,CatShort,Synonyms - Comma Separated,Category_zh,SubCategory_zh,Synonyms_zh,Category_tw,SubCategory_tw,Synonyms_tw,Category_ja,SubCategory_ja,Synonyms_ja 2 | CUSTOM,Tags,CSTMTags,CSTM,"monster attack,monster voice,magic launch,magic dark",自定义,标签,"怪物 攻击,怪物 语音,魔法 发射,魔法 黑暗",自訂,標簽,"甲,乙,丙,丁",カスタマイズ,タグ,"A,B,C,D" -------------------------------------------------------------------------------- /Development/Lokasenna_GUI Library/Set Lokasenna_GUI library.lua: -------------------------------------------------------------------------------- 1 | -- NoIndex: true 2 | 3 | -- Stores the path to Lokasenna_GUI v2 for other scripts to access 4 | -- Must be run prior to using Lokasenna_GUI scripts 5 | 6 | local info = debug.getinfo(1,'S') 7 | local script_path = info.source:match[[^@?(.*[\/])[^\/]-$]] 8 | 9 | reaper.SetExtState("GUILibrary", "lib_path_v2", script_path, true) -------------------------------------------------------------------------------- /Games/Blocks DS/lib/utils.lua: -------------------------------------------------------------------------------- 1 | -- NoIndex: true 2 | local script_path = debug.getinfo(1,'S').source:match[[^@?(.*[\/])[^\/]-$]] 3 | package.path = package.path .. ";" .. script_path .. "?.lua" .. ";" .. script_path .. "/lib/?.lua" 4 | script_path = script_path:gsub("[/\\]+$","") 5 | script_path = script_path:gsub("[/\\]lib$","") -- 确保不在lib目录下 6 | 7 | local sep = package.config:sub(1, 1) 8 | script_path = script_path .. sep -------------------------------------------------------------------------------- /Various/Soundmole/zaibuyidao_Soundmole - Add Selected Files to Target Database.lua: -------------------------------------------------------------------------------- 1 | -- NoIndex: true 2 | reaper.SetExtState("Soundmole", "CMD_AddSelectedToTarget", "1", false) 3 | if reaper.APIExists('JS_Window_Find') then 4 | local hwnd = reaper.JS_Window_Find("Soundmole - Explore, Tag, and Organize Audio Resources", true) 5 | if hwnd then 6 | reaper.JS_Window_SetForeground(hwnd) 7 | reaper.JS_Window_SetFocus(hwnd) 8 | end 9 | end -------------------------------------------------------------------------------- /Various/Articulation Map/banks/75-96 Three-Body Raindrop & Blade (扬琴落英).reabank: -------------------------------------------------------------------------------- 1 | //REAPER Preferences - Media - MIDI - MIDI octave name display offset: -1 2 | //---------------------------------------------------------------------- 3 | Bank 75 96 三体扬琴落英 4 | 3 D#-1: 下行 1 5 | 4 E-1: 上行 1 6 | 5 F-1: 上行 2 7 | 6 F#-1: 泛音 8 | 7 G-1: 反竹 9 | 8 G#-1: 颤竹 10 | 9 A-1: 颤/轮竹 11 | 10 A#-1: 快枪竹 12 | 11 B-1: 三度轮竹 13 | 12 C0: 八度轮竹 14 | 13 C0#: 轮竹 15 | 14 D0: 长音 16 | 15 D0#: 止音 -------------------------------------------------------------------------------- /Various/Articulation Map/banks/75-96 Three-Body Raindrop & Blade.reabank: -------------------------------------------------------------------------------- 1 | //REAPER Preferences - Media - MIDI - MIDI octave name display offset: -1 2 | //---------------------------------------------------------------------- 3 | Bank 75 96 Three-Body Raindrop & Blade 4 | 3 D#-1: downward 5 | 4 E-1: upward 1 6 | 5 F-1: upward 2 7 | 6 F#-1: harmonic 8 | 7 G-1: hammer revert 9 | 8 G#-1: flicking 10 | 9 A-1: flicking/tremolo 11 | 10 A#-1: fast tremolo 12 | 11 B-1: tritone tremolo 13 | 12 C0: oct. tremolo 14 | 13 C0#: tremolo 15 | 14 D0: legato 16 | 15 D0#: release -------------------------------------------------------------------------------- /Utility/zaibuyidao_Restart from Edit Cursor (If Playing).lua: -------------------------------------------------------------------------------- 1 | -- @description Restart from Edit Cursor (If Playing) 2 | -- @version 1.0.1 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | 11 | local playing = (reaper.GetPlayState() & 1) == 1 12 | if playing then 13 | reaper.Main_OnCommand(1016, 0) -- Transport: Stop 14 | reaper.Main_OnCommand(1007, 0) -- Transport: Play 15 | end -------------------------------------------------------------------------------- /Games/Blocks DS.lua: -------------------------------------------------------------------------------- 1 | -- @description Blocks DS 2 | -- @author zaibuyidao 3 | -- @version 1.0.8 4 | -- @changelog 5 | -- New Script 6 | -- @reference 7 | -- https://forum.cockos.com/showthread.php?t=100100 8 | -- @links 9 | -- https://www.soundengine.cn/u/zaibuyidao 10 | -- https://github.com/zaibuyidao/ReaScripts 11 | -- @metapackage 12 | -- @provides 13 | -- [main=main] Blocks DS/zaibuyidao_Blocks DS.lua 14 | -- [nomain] Blocks DS/lib/*.lua 15 | -- @donation http://www.paypal.me/zaibuyidao 16 | -- @about 17 | -- A classic falling block puzzle game for REAPER. 18 | -- Style: DS / Classic mechanics. 19 | -- Requires JS_ReaScriptAPI & SWS Extension -------------------------------------------------------------------------------- /Various/Articulation Map/banks/73-96 Ample Sound Qudi (曲笛風逸).reabank: -------------------------------------------------------------------------------- 1 | //REAPER Preferences - Media - MIDI - MIDI octave name display offset: -1 2 | //---------------------------------------------------------------------- 3 | Bank 73 96 Ample Sound Qudi (曲笛風逸) 4 | 24 長音 5 | 25 單吐 6 | 26 上倚音 7 | 27 下倚音 8 | 28 上五聲 9 | 29 下五聲 10 | 30 波音 11 | 31 短顫音 12 | 32 長顫音 13 | 33 上歷音 14 | 34 下歷音 15 | 36 表情長音 16 | 37 匀速震音 17 | 38 匀速顫音 18 | 39 歷音花舌 19 | 40 氣震打音 20 | 41 氣震叠音 21 | 42 氣震上滑音 22 | 43 氣震下滑音 23 | 44 氣震圓滑音 24 | 45 贈音 25 | 46 尾滑音 26 | 48 樂句 27 | 50 鏡像 28 | 89 逵哥呼吸(FX) 29 | 90 敲竹杠(FX) 30 | 91 氣冲音一(FX) 31 | 92 氣冲音二(FX) 32 | 93 氣冲音三(FX) 33 | 94 顫音特效一(FX) 34 | 95 顫音特效二(FX) 35 | 96 曲笛鳥叫(FX) 36 | 97 口笛鳥叫(FX) -------------------------------------------------------------------------------- /JSFX/MIDI Off Velocity Limiter.jsfx: -------------------------------------------------------------------------------- 1 | desc: MIDI Off Velocity Limiter 2 | version: 1.0 3 | changelog: init 4 | author: zaibuyidao 5 | website: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | 7 | slider1:127<0,127,1>Threshold 8 | slider2:0<0,127,1>Limit 9 | 10 | in_pin:none 11 | out_pin:none 12 | 13 | @init 14 | note_on = $x90; 15 | note_off = $x80; 16 | 17 | @block 18 | while (midirecv(offset, msg1, msg2, msg3)) ( 19 | msg = msg1 & $xf0; 20 | msg_num = msg2; 21 | msg_val = msg3; 22 | msg == note_off ? ( 23 | off_vel = msg3; 24 | off_vel > slider1 ? ( 25 | msg3 = slider2; 26 | ); 27 | ); 28 | midisend(offset, msg1, msg2, msg3); 29 | ); 30 | -------------------------------------------------------------------------------- /Various/Articulation Map/banks/72-96 Ample Sound Erhu (二胡凝月).reabank: -------------------------------------------------------------------------------- 1 | //REAPER Preferences - Media - MIDI - MIDI octave name display offset: -1 2 | //---------------------------------------------------------------------- 3 | //Default KS Velocity 96, 默认键位切换键力度 96 4 | Bank 72 96 Ample Sound Erhu (二胡凝月) 5 | 24 長弓 6 | 25 頓弓 7 | 26 抛弓 8 | 27 撥弦 9 | 28 低吟 10 | 29 嘆息 11 | 30 哭泣 12 | 31 沙啞 13 | 32 顫弓 14 | 33 波弓 15 | 34 漸弱 16 | 35 強弱強 17 | 36 表情長弓 18 | 37 揉弦 19 | 38 顫音 20 | 39 波音 21 | 40 下波音 22 | 41 復波音 23 | 42 上回滑 24 | 43 下回滑 25 | 44 裝飾上滑&下尾滑 26 | 45 裝飾下滑&上尾滑 27 | 46 連奏滑音 28 | 47 虛擬滑音 29 | 48 樂句(G2-G5) 30 | 49 把位指定(D2-E4) 31 | 50 鏡像 32 | 51 内弦指定 33 | 52 外弦指定 34 | 92 擦弦噪音(FX) 35 | 93 拍音筒(FX) 36 | 94 滑音特效(FX) 37 | 95 馬鳴(FX) 38 | 96 鳥鳴(FX) 39 | 97 滑稽(FX) 40 | 98 哭泣(FX) -------------------------------------------------------------------------------- /Various/Articulation Map/banks/74-96 Three-Body Whisper of Loong (曲笛新雨).reabank: -------------------------------------------------------------------------------- 1 | //REAPER Preferences - Media - MIDI - MIDI octave name display offset: -1 2 | //---------------------------------------------------------------------- 3 | Bank 74 96 Three-Body Whisper of Loong (三体新雨) 4 | 38 D1: 吐音奏法 ON 5 | 39 D#1: 吐音奏法 OFF 6 | 40 E1: 花舌音头/吐音1 7 | 41 F1: 倚音4/吐音2 8 | 42 F#1: 上历音2/吐音3 9 | 43 G1: 上历音1/吐音4 10 | 44 G#1: 复倚音2/吐音5 11 | 45 A1: 复倚音1 12 | 46 A#1: 下波音 13 | 47 B1: 倚音3 14 | 48 ‌C2: 倚音2 15 | 49 C#2: 叠音4 16 | 50 D2: 叠音3 17 | 51 D#2: 叠音2 18 | 52 E2: 叠音1 19 | 53 F2: 波音 20 | 54 F#2: 倚音1 21 | 55 G2: 二度颤音 22 | 56 G#2: 渐快二度颤音 23 | 57 A2: 快速二度颤音 24 | 58 A#2: 三度颤音 25 | 59 B2: 打音 26 | 60 C3: 弹指 27 | 61 C#3: 二度颤音 28 | 62 D3: 三度颤音 29 | 63 D#3: 止音 30 | 64 E3: 下历音 31 | 65 F3: 下滑止音 32 | 66 F#3: 赠音 33 | 99 D#6: 呼吸噪声 -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Select All Events.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Select All Events 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2021-1-7) 14 | + Initial release 15 | --]] 16 | 17 | function Main() 18 | local editor = reaper.MIDIEditor_GetActive() 19 | local take = reaper.MIDIEditor_GetTake(editor) 20 | if take == nil then return end 21 | reaper.Undo_BeginBlock() 22 | reaper.MIDI_SelectAll(take, true) 23 | reaper.Undo_EndBlock("Select All Events", -1) 24 | reaper.UpdateArrange() 25 | end 26 | 27 | Main() -------------------------------------------------------------------------------- /JSFX/MIDI Transform CC.jsfx: -------------------------------------------------------------------------------- 1 | desc: MIDI Transform CC 2 | version: 1.0.1 3 | changelog: init 4 | author: zaibuyidao 5 | website: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | about: 7 | Transform CC# A Into CC# B. 8 | 9 | slider1:117<1,127,1>Convert CC# 10 | slider2:120<1,127,1>To CC# 11 | 12 | in_pin:none 13 | out_pin:none 14 | 15 | @init 16 | cc = $xb0; 17 | note_on = 9; 18 | note_off = 8; 19 | 20 | @slider 21 | 22 | @sample 23 | while ( 24 | midirecv(offset, msg1, msg2, msg3) ? ( 25 | status = msg1 & $xf0; 26 | channel = msg1 & $x0f; 27 | msg_num = msg2; 28 | msg_val = msg3; 29 | 30 | CC117 = slider1; 31 | status == cc && (msg2 == CC117) ? ( 32 | msg2 = slider2; 33 | ); 34 | 35 | midisend(offset, msg1, msg2, msg3); 36 | ); 37 | ); 38 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Unselect All Events.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Unselect All Events 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2021-1-7) 14 | + Initial release 15 | --]] 16 | 17 | function Main() 18 | local editor = reaper.MIDIEditor_GetActive() 19 | local take = reaper.MIDIEditor_GetTake(editor) 20 | if take == nil then return end 21 | reaper.Undo_BeginBlock() 22 | reaper.MIDI_SelectAll(take, false) 23 | reaper.Undo_EndBlock("Unselect All Events", -1) 24 | reaper.UpdateArrange() 25 | end 26 | 27 | Main() -------------------------------------------------------------------------------- /Tracks Properties/zaibuyidao_Remove All Empty Tracks.lua: -------------------------------------------------------------------------------- 1 | -- @description Remove All Empty Tracks 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- + New Script 6 | -- @links 7 | -- webpage https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- repo https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | function Main() 13 | local track_count = reaper.CountTracks(0) 14 | for i = track_count - 1, 0, -1 do -- 从最后一条轨道开始检查,避免删除轨道时影响索引 15 | local track = reaper.GetTrack(0, i) 16 | if reaper.CountTrackMediaItems(track) == 0 then 17 | reaper.DeleteTrack(track) -- 如果轨道中没有item,则删除轨道 18 | end 19 | end 20 | end 21 | reaper.Undo_BeginBlock() 22 | Main() 23 | reaper.Undo_EndBlock("Remove All Empty Tracks", -1) -------------------------------------------------------------------------------- /Various/Articulation Map/banks/74-96 Three-Body Whisper of Loong.reabank: -------------------------------------------------------------------------------- 1 | //REAPER Preferences - Media - MIDI - MIDI octave name display offset: -1 2 | //---------------------------------------------------------------------- 3 | Bank 74 96 Three-Body Whisper of Loong 4 | 38 D1: Staccato ON 5 | 39 D#1: Staccato OFF 6 | 40 E1: Flt. Arti. 7 | 41 F1: Grace 8 8 | 42 F#1: Run Up 2 9 | 43 G1: Run Up 1 10 | 44 G#1: D. Grace 2 11 | 45 A1: D. Grace 1 12 | 46 A#1: Mordent 2 13 | 47 B1: Grace 7 14 | 48 C2: Grace 6 15 | 49 C#2: Grace 5 16 | 50 D2: Grace 4 17 | 51 D#2: Grace 3 18 | 52 E2: Grace 2 19 | 53 F2: Mordent 1 20 | 54 F#2: Grace 1 21 | 55 G2: Trill 2 22 | 56 G#2: Trill 2 Str. 23 | 57 A2: Trill 2 Fast. 24 | 58 A#2: Trill 3 25 | 59 B2: Pop.1 26 | 60 C3: Pop.2 27 | 61 C#3: Trill 2 28 | 62 D3: Trill 3 29 | 63 D#3: Release 30 | 64 E3: Rel. Dn 1 31 | 65 F3: Rel. Dn 2 32 | 66 F#3: Rel. Up 33 | 99 D#6: Breath -------------------------------------------------------------------------------- /Various/Articulation Map/banks/67-1 Cinematic Studio Strings.reabank: -------------------------------------------------------------------------------- 1 | //REAPER Preferences - Media - MIDI - MIDI octave name display offset: -1 2 | //---------------------------------------------------------------------------- 3 | Bank 67 1 Cinematic Studio Strings 4 | //! 67-1-1=67-64-12 5 | 1 Standard Legato 6 | //! 67-1-2=67-64-18 7 | 2 Spiccato Overlay Off 8 | //! 67-1-3=67-64-22 9 | 3 Legato Off 10 | //! 67-1-4=67-64-23 11 | 4 Con Sordino Off 12 | //! 67-1-5=67-65-12 13 | 5 Advanced Legato 14 | //! 67-1-6=67-65-17 15 | 6 Staccato 16 | //! 67-1-7=67-65-18 17 | 7 Spiccato Overlay On 18 | //! 67-1-8=67-65-22 19 | 8 Legato On 20 | //! 67-1-9=67-65-23 21 | 9 Con Sordino On 22 | //! 67-1-10=67-97-17 23 | 10 Sfz 24 | //! 67-1-11=67-32-17 25 | 11 Spiccato 26 | //! 67-1-12=67-33-17 27 | 12 Staccatissimo 28 | //! 67-1-13=67-41-19 29 | 13 Pizzicato 30 | //! 67-1-14=67-42-19 31 | 14 Bartok Snap 32 | //! 67-1-15=67-85-19 33 | 15 Col Legno -------------------------------------------------------------------------------- /Various/SFX Tag Search/req/JGuiFunctions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | @author n0ne 3 | @version 0.7.0 4 | @noindex 5 | --]] 6 | 7 | -- Some functions to help working with the JGui 8 | 9 | -- Create multiple controls of controlType in a grid 10 | function createControls(controlType, num, perRow, settings, x, y, w, h, x_space, y_space) 11 | local tResult = {} 12 | local xOffs = 0 13 | local yOffs = 0 14 | 15 | for i = 1, num do 16 | if (i-1) % perRow == 0 and i > perRow then 17 | yOffs = yOffs + h + y_space 18 | xOffs = 0 19 | end 20 | 21 | c = controlType:new() 22 | c:setSettings(settings) 23 | c.width = w 24 | c.height = h 25 | c.x = x + xOffs 26 | c.y = y + yOffs 27 | 28 | table.insert(tResult, c) 29 | 30 | xOffs = xOffs + w + x_space 31 | end 32 | 33 | return tResult 34 | end 35 | -------------------------------------------------------------------------------- /Development/Lokasenna_GUI library.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Description: Get Lokasenna_GUI library 3 | Version: 2.16.26 4 | Changelog: 5 | Add IME Chinese input support. 6 | Author: Lokasenna 7 | Provides: 8 | [main] Lokasenna_GUI Library/Set Lokasenna_GUI library.lua 9 | [nomain] Lokasenna_GUI Library/{Core,Classes/*,Modules/*}.lua 10 | Metapackage: true 11 | Donation: https://paypal.me/Lokasenna 12 | Links: 13 | Forum Thread https://forum.cockos.com/showthread.php?t=177772 14 | Lokasenna's Website http://forum.cockos.com/member.php?u=10417 15 | About: 16 | Provides a framework allowing Lua scripts to use a graphical interface, since Reaper 17 | has no ability to do so natively. 18 | INSTALLATION: After installing this package, you must tell Reaper where to find the 19 | library. In the Action List, find and run: 20 | "Script: Set Lokasenna_GUI library path.lua" 21 | --]] 22 | 23 | -- Licensed under the GNU GPL v3 -------------------------------------------------------------------------------- /Various/UCS Tag Search Rename Bundle.lua: -------------------------------------------------------------------------------- 1 | -- @description UCS Tag Search Rename Bundle 2 | -- @author zaibuyidao 3 | -- @version 1.7.0 4 | -- @changelog 5 | -- Optimized Textbox focus 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @metapackage 10 | -- @provides 11 | -- [main] UCS/zaibuyidao_UCS Tag Rename.lua 12 | -- [main] UCS/zaibuyidao_UCS Tag Search.lua 13 | -- [main] UCS/zaibuyidao_UCS Metadata Item-Region.lua 14 | -- [main] UCS/zaibuyidao_UCS Metadata Item-Take.lua 15 | -- [main] UCS/zaibuyidao_UCS Metadata Region Manager.lua 16 | -- [main] UCS/zaibuyidao_UCS Metadata Region Within Time Selection.lua 17 | -- [main] UCS/zaibuyidao_UCS Edit CatID.lua 18 | -- [nomain] UCS/lib/*.lua 19 | -- UCS/*.csv 20 | -- @donation http://www.paypal.me/zaibuyidao 21 | -- @about Requires JS_ReaScriptAPI & SWS Extension 22 | 23 | -- Licensed under the GNU GPL v3 -------------------------------------------------------------------------------- /JSFX/MIDI CC Events First.jsfx: -------------------------------------------------------------------------------- 1 | desc: MIDI CC Events First 2 | desc: MIDI CC Events First [zaibuyidao] 3 | version: 1.0 4 | changelog: init 5 | author: zaibuyidao 6 | links: 7 | webpage https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | repo https://github.com/zaibuyidao/ReaScripts 9 | about: 10 | This script allows for the advance sending of specified CC (Control Change) events. 11 | 该脚本允许提前发送指定的 CC (控制更改) 事件. 12 | 13 | slider1:119<0,127,1>CC number: 14 | slider2:1<0,10,1>Advance time (ms): 15 | 16 | @init 17 | 18 | advance_samples = slider2/1000 * srate; // 将提前秒数转换为样本数 19 | 20 | @block 21 | 22 | while (midirecv(offset, msg1, msg2, msg3)) ( 23 | // 检查是否为CC消息且CC编号与滑块指定的相符 24 | ((msg1 & 0xF0) == $xB0 && msg2 == slider1) ? ( 25 | // 计算新的偏移量, 确保不会小于0 26 | new_offset = max(offset - advance_samples, 0); 27 | // 提前发送指定的CC消息 28 | midisend(new_offset, msg1, msg2, msg3); 29 | ) : ( 30 | // 其他所有消息正常传递 31 | midisend(offset, msg1, msg2, msg3); 32 | ); 33 | ); 34 | -------------------------------------------------------------------------------- /Various/Soundmole.lua: -------------------------------------------------------------------------------- 1 | -- @description Soundmole 2 | -- @author zaibuyidao 3 | -- @version 1.0.134 4 | -- @changelog 5 | -- Added 'Add Selected Files to Target Database' script, enabling shortcut binding to quickly add selected files to the target database. 6 | -- Support reaper_soundmole-x64.dll v0.0.10 7 | -- @reference 8 | -- https://forum.cockos.com/showthread.php?t=300916 9 | -- @links 10 | -- https://www.soundengine.cn/u/zaibuyidao 11 | -- https://github.com/zaibuyidao/ReaScripts 12 | -- @metapackage 13 | -- @provides 14 | -- [main=main] Soundmole/zaibuyidao_Soundmole.lua 15 | -- [main=main] Soundmole/zaibuyidao_Soundmole - Add Selected Files to Target Database.lua 16 | -- [nomain] Soundmole/lib/*.lua 17 | -- Soundmole/data/*.csv 18 | -- Soundmole/data/icons.otf 19 | -- Soundmole/data/icons-regular.otf 20 | -- Soundmole/data/odrf_upr_regular.otf 21 | -- @donation http://www.paypal.me/zaibuyidao 22 | -- @about Requires JS_ReaScriptAPI & SWS Extension 23 | 24 | -- Licensed under the GNU GPL v3 -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Random Take Pan.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random Take Pan 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2021-1-7) 14 | + Initial release 15 | --]] 16 | 17 | function Msg(param) reaper.ShowConsoleMsg(tostring(param) .. "\n") end 18 | count_sel_items = reaper.CountSelectedMediaItems(0) 19 | reaper.Undo_BeginBlock() -- 撤消塊開始 20 | if count_sel_items > 0 then 21 | for i = 0, count_sel_items - 1 do 22 | local item = reaper.GetSelectedMediaItem(0, i) 23 | local take = reaper.GetActiveTake(item) 24 | local rand = math.random() * 2 - 1 25 | reaper.SetMediaItemTakeInfo_Value(take, 'D_PAN', rand) 26 | reaper.UpdateItemInProject(item) 27 | end 28 | end 29 | reaper.Undo_EndBlock("Random Take Pan", -1) -- 撤消塊結束 -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Move Edit Cursor +10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Move Edit Cursor +10 3 | * Instructions: Open a MIDI take in MIDI Editor. Run. 4 | * Version: 1.1 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | * provides: [main=midi_editor,midi_eventlisteditor] . 12 | --]] 13 | 14 | --[[ 15 | * Changelog: 16 | * v1.0 (2020-1-27) 17 | + Initial release 18 | --]] 19 | 20 | local tick = 10 21 | 22 | script_title = "Move Edit Cursor +10" 23 | reaper.Undo_BeginBlock() 24 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 25 | local pos = reaper.GetCursorPositionEx() 26 | local ppq = reaper.MIDI_GetPPQPosFromProjTime(take, pos) 27 | reaper.SetEditCurPos(reaper.MIDI_GetProjTimeFromPPQPos(take, ppq+tick), true, true) 28 | reaper.Undo_EndBlock(script_title, 0) 29 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Move Edit Cursor -10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Move Edit Cursor -10 3 | * Instructions: Open a MIDI take in MIDI Editor. Run. 4 | * Version: 1.1 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | * provides: [main=midi_editor,midi_eventlisteditor] . 12 | --]] 13 | 14 | --[[ 15 | * Changelog: 16 | * v1.0 (2020-1-27) 17 | + Initial release 18 | --]] 19 | 20 | local tick = -10 21 | 22 | script_title = "Move Edit Cursor -10" 23 | reaper.Undo_BeginBlock() 24 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 25 | local pos = reaper.GetCursorPositionEx() 26 | local ppq = reaper.MIDI_GetPPQPosFromProjTime(take, pos) 27 | reaper.SetEditCurPos(reaper.MIDI_GetProjTimeFromPPQPos(take, ppq+tick), true, true) 28 | reaper.Undo_EndBlock(script_title, 0) 29 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /Various/UCS/lib/config.lua: -------------------------------------------------------------------------------- 1 | -- NoIndex: true 2 | return { 3 | ui = { 4 | global = { 5 | title = { 6 | cn = "UCS 标签搜索器 - UCS 更新(2023年2月1日):版本 8.2", -- Window Title 窗口标题 7 | tw = "UCS 標簽搜索器 - UCS 更新(2023年2月1日):版本 8.2", 8 | en = "UCS Tag Search - UCS Update (Feb 1st, 2023): Version 8.2" 9 | }, 10 | font_sans = { 11 | cn = "Microsoft YaHei", -- General Font Name 常规字体名:""Microsoft YaHei""、"SimSun"、"华文宋体"、"华文仿宋"、"微软雅黑" 12 | tw = "Calibri", 13 | en = "Calibri" 14 | }, 15 | font_mono = { 16 | cn = "Microsoft YaHei Mono", -- Monospace Font Name 等宽字体名:"Microsoft YaHei Mono"、"SimSun"、"Courier New"、"FangSong"、"Lucida Console" 17 | tw = "Consolas", 18 | en = "Consolas" 19 | }, 20 | font_size_4 = 19, -- 文本字体大小 21 | font_size_3 = 19, -- 控件字体大小 22 | font_size_2 = 23, -- 标题字体大小 23 | font_size_m = 14, -- 等宽字体大小 24 | font_size_v = 14, -- 版本字体大小 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Random Take Volume.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random Take Volume 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-5-22) 15 | + Initial release 16 | --]] 17 | 18 | reaper.PreventUIRefresh(1) 19 | reaper.Undo_BeginBlock() 20 | local count_sel_items = reaper.CountSelectedMediaItems(0) 21 | if count_sel_items > 0 then 22 | for i = 0, count_sel_items - 1 do 23 | local item = reaper.GetSelectedMediaItem(0, i) 24 | local take = reaper.GetActiveTake(item) 25 | local rand = math.random() * 1 -- 0=-inf, 0.5=-6dB, 1=+0dB, 2=+6dB 26 | reaper.SetMediaItemTakeInfo_Value(take, 'D_VOL', rand) 27 | reaper.UpdateItemInProject(item) 28 | end 29 | end 30 | reaper.Undo_EndBlock('Random Take Volume', -1) 31 | reaper.PreventUIRefresh(-1) 32 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Random Item Volume.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random Item Volume 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-5-22) 15 | + Initial release 16 | --]] 17 | 18 | reaper.PreventUIRefresh(1) 19 | reaper.Undo_BeginBlock() 20 | local count_sel_items = reaper.CountSelectedMediaItems(0) 21 | if count_sel_items > 0 then 22 | for i = 0, count_sel_items-1 do 23 | local item = reaper.GetSelectedMediaItem(0, i) 24 | local item_vol = reaper.GetMediaItemInfo_Value(item, 'D_VOL') 25 | local rand = math.random() * 1 -- 0=-inf, 0.5=-6dB, 1=+0dB, 2=+6dB 26 | reaper.SetMediaItemInfo_Value(item, 'D_VOL', rand) 27 | reaper.UpdateItemInProject(item) 28 | end 29 | end 30 | reaper.Undo_EndBlock('Random Item Volume', -1) 31 | reaper.PreventUIRefresh(-1) 32 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Insert All Sound Off.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Insert All Sound Off 3 | * Version: 1.1.1 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.1 (2020-2-16) 15 | # Default selected is false 16 | * v1.0 (2019-12-19) 17 | + Initial release 18 | --]] 19 | 20 | selected = false 21 | muted = false 22 | msg2 = 120 23 | msg3 = 0 24 | 25 | function Main() 26 | reaper.Undo_BeginBlock() 27 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 28 | local pos = reaper.GetCursorPositionEx() 29 | local ppq = reaper.MIDI_GetPPQPosFromProjTime(take, pos) 30 | reaper.MIDI_InsertCC(take, selected, muted, ppq - 10, 0xB0, 0, msg2, msg3) 31 | reaper.Undo_EndBlock("Insert All Sound Off", -1) 32 | reaper.UpdateArrange() 33 | end 34 | 35 | 36 | Main() 37 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /Various/Articulation Map/banks/68-2 Cinematic Studio Strings (UACC-58).reabank: -------------------------------------------------------------------------------- 1 | //Set the Mode of Articulation-Map-JSFX to Keyswitch CC (UACC) and set the number of Keyswitch CC to 58. 2 | //---------------------------------------------------------------------------- 3 | Bank 67 2 Cinematic Studio Strings (UACC-58) 4 | //! 67-2-0=67-58-0 5 | 0 Standard Legato 6 | //! 67-2-6=67-58-6 7 | 6 Advanced Legato 8 | //! 67-2-11=67-58-11 9 | 11 Spiccato 10 | //! 67-2-16=67-58-16 11 | 16 Staccatissimo 12 | //! 67-2-21=67-58-21 13 | 21 Staccato 14 | //! 67-2-26=67-58-26 15 | 26 Sforzando 16 | //! 67-2-31=67-58-31 17 | 31 Pizzicato 18 | //! 67-2-36=67-58-36 19 | 36 Bartok Snap 20 | //! 67-2-41=67-58-41 21 | 41 Col Legno 22 | //! 67-2-46=67-58-46 23 | 46 Trills 24 | //! 67-2-51=67-58-51 25 | 51 Harmonics 26 | //! 67-2-56=67-58-56 27 | 56 Tremolo 28 | //! 67-2-61=67-58-61 29 | 61 Measured Tremolo 30 | //! 67-2-66=67-58-66 31 | 66 Marcato without overlay 32 | //! 67-2-71=67-58-71 33 | 71 Marcato with overlay 34 | //! 67-2-76=67-58-76 35 | 76 Legato On 36 | //! 67-2-81=67-58-81 37 | 81 Legato Off 38 | //! 67-2-86=67-58-86 39 | 86 Con Sordino On 40 | //! 67-2-91=67-58-91 41 | 91 Con Sordino Off -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Random CC Value.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random CC Value 3 | * Version: 2.3 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2019-12-12) 14 | + Initial release 15 | --]] 16 | 17 | local diff = 127 18 | 19 | function Main() 20 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | _, _, ccevtcnt, _ = reaper.MIDI_CountEvts(take) 22 | reaper.MIDI_DisableSort(take) 23 | for i = 0, ccevtcnt-1 do 24 | retval, selected, muted, ppqpos, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 25 | if selected == true then 26 | reaper.MIDI_SetCC(take, i, nil, nil, nil, nil, nil, nil, math.random(diff), false) 27 | end 28 | i=i+1 29 | end 30 | reaper.UpdateArrange() 31 | reaper.MIDI_Sort(take) 32 | end 33 | 34 | script_title = "Random CC Value" 35 | reaper.Undo_BeginBlock() 36 | Main() 37 | reaper.Undo_EndBlock(script_title, 0) -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Move Items To Track Of First Selected Item.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Move Items To Track Of First Selected Item 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * Donation: http://www.paypal.me/zaibuyidao 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2022-3-27) 14 | + Initial release 15 | --]] 16 | 17 | function Msg(param) 18 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 19 | end 20 | count_sel_items = reaper.CountSelectedMediaItems(0) 21 | reaper.PreventUIRefresh(1) 22 | reaper.Undo_BeginBlock() 23 | if count_sel_items > 0 then 24 | for i = 0, count_sel_items - 1 do 25 | item = reaper.GetSelectedMediaItem(0, i) 26 | if i == 0 then 27 | track = reaper.GetMediaItem_Track(item) 28 | end 29 | reaper.MoveMediaItemToTrack(item, track) 30 | end 31 | end 32 | reaper.Undo_EndBlock("Move Items To Track Of First Selected Item", -1) 33 | reaper.PreventUIRefresh(-1) 34 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Play Stop From Mouse Position.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Play Stop From Mouse Position 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 or newer recommended 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2022-4-29) 15 | + Initial release 16 | --]] 17 | 18 | local function Msg(str) 19 | reaper.ShowConsoleMsg(tostring(str).."\n") 20 | end 21 | 22 | reaper.PreventUIRefresh(1) 23 | local cur_pos = reaper.GetCursorPosition() 24 | isPlay = reaper.GetPlayState() 25 | 26 | if isPlay == 0 then 27 | reaper.Main_OnCommand(40514, 0) -- View: Move edit cursor to mouse cursor (no snapping) 28 | reaper.Main_OnCommand(1007, 0) -- Transport: Play 29 | end 30 | 31 | if isPlay == 1 then 32 | reaper.Main_OnCommand(1016, 0) -- Transport: Stop 33 | end 34 | 35 | reaper.SetEditCurPos(cur_pos, 0, 0) 36 | reaper.PreventUIRefresh(-1) 37 | reaper.UpdateArrange() 38 | reaper.defer(function() end) -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Set Take Pan.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Set Take Pan 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-5-22) 15 | + Initial release 16 | --]] 17 | 18 | reaper.PreventUIRefresh(1) 19 | reaper.Undo_BeginBlock() 20 | local count_sel_items = reaper.CountSelectedMediaItems(0) 21 | if count_sel_items > 0 then 22 | local retval, retvals_csv = reaper.GetUserInputs('Set Take Pan', 1, 'New %:', '') 23 | if not retval or not tonumber(retvals_csv) then return end 24 | for i = 0, count_sel_items - 1 do 25 | local item = reaper.GetSelectedMediaItem(0, i) 26 | local take = reaper.GetActiveTake(item) 27 | local rand = retvals_csv/100 28 | reaper.SetMediaItemTakeInfo_Value(take, 'D_PAN', rand) 29 | reaper.UpdateItemInProject(item) 30 | end 31 | end 32 | reaper.Undo_EndBlock('Set Take Pan', -1) 33 | reaper.PreventUIRefresh(-1) 34 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Set Take Pitch.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Set Take Pitch 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-5-22) 15 | + Initial release 16 | --]] 17 | 18 | reaper.PreventUIRefresh(1) 19 | reaper.Undo_BeginBlock() 20 | local count_sel_items = reaper.CountSelectedMediaItems(0) 21 | if count_sel_items > 0 then 22 | local retval, retvals_csv = reaper.GetUserInputs('Set Take Pitch', 1, 'New (semitones):', '') 23 | if not retval or not tonumber(retvals_csv) then return end 24 | for i = 0, count_sel_items - 1 do 25 | local item = reaper.GetSelectedMediaItem(0, i) 26 | local take = reaper.GetActiveTake(item) 27 | local rand = retvals_csv/100 28 | reaper.SetMediaItemTakeInfo_Value(take, 'D_PAN', rand) 29 | reaper.UpdateItemInProject(item) 30 | end 31 | end 32 | reaper.Undo_EndBlock('Set Take Pitch', -1) 33 | reaper.PreventUIRefresh(-1) 34 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Random Take Pitch.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random Take Pitch 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-5-22) 15 | + Initial release 16 | --]] 17 | 18 | reaper.PreventUIRefresh(1) 19 | reaper.Undo_BeginBlock() 20 | local count_sel_items = reaper.CountSelectedMediaItems(0) 21 | local min = -12 22 | local max = 12 23 | if count_sel_items == 0 then return end 24 | for i = 0, count_sel_items-1 do 25 | local item = reaper.GetSelectedMediaItem(0,i) 26 | local take = reaper.GetActiveTake(item) 27 | local pitch = reaper.GetMediaItemTakeInfo_Value(take, 'D_PITCH') 28 | local new_pitch = math.random(min,max) 29 | if new_pitch ~= pitch then 30 | reaper.SetMediaItemTakeInfo_Value(take, 'D_PITCH', math.random()*new_pitch) 31 | reaper.UpdateItemInProject(item) 32 | end 33 | end 34 | reaper.Undo_EndBlock('Random Take Pitch', -1) 35 | reaper.PreventUIRefresh(-1) 36 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Various/SFX Tag Search Bundle.lua: -------------------------------------------------------------------------------- 1 | -- @description SFX Tag Search Bundle 2 | -- @author zaibuyidao 3 | -- @version 2.0.18 4 | -- @changelog 5 | -- + Optimized search term sending. 6 | -- Please back up the configuration files (*.ini) in the script directory and delete them. 7 | -- Running the script again will recreate the configuration files. 8 | -- @reference 9 | -- https://forum.cockos.com/showthread.php?t=229807 10 | -- @links 11 | -- https://www.soundengine.cn/u/zaibuyidao 12 | -- https://github.com/zaibuyidao/ReaScripts 13 | -- @metapackage 14 | -- @provides 15 | -- [main=main,mediaexplorer] SFX Tag Search/zaibuyidao_SFX Tag Search - Custom Tags.lua 16 | -- [main=main,mediaexplorer] SFX Tag Search/zaibuyidao_SFX Tag Search - Database.lua 17 | -- [main=main,mediaexplorer] SFX Tag Search/zaibuyidao_SFX Tag Search - Favorite.lua 18 | -- [main=main,mediaexplorer] SFX Tag Search/zaibuyidao_SFX Tag Search - Thesaurus.lua 19 | -- [main=main,mediaexplorer] SFX Tag Search/zaibuyidao_SFX Tag Search - UCS Synonym Index.lua 20 | -- [main=main,mediaexplorer] SFX Tag Search/zaibuyidao_SFX Tag Search - UCS.lua 21 | -- [nomain] SFX Tag Search/lib/*.lua 22 | -- [nomain] SFX Tag Search/req/*.lua 23 | -- SFX Tag Search/*.csv 24 | -- SFX Tag Search/lib/*.ini 25 | -- @donation http://www.paypal.me/zaibuyidao 26 | -- @about Requires JS_ReaScriptAPI & SWS Extension 27 | 28 | -- Licensed under the GNU GPL v3 -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Set Take Volume.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Set Take Volume 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-5-22) 15 | + Initial release 16 | --]] 17 | 18 | reaper.PreventUIRefresh(1) 19 | reaper.Undo_BeginBlock() 20 | local count_sel_items = reaper.CountSelectedMediaItems(0) 21 | local log10 = function(x) return math.log(x, 10) end 22 | if count_sel_items > 0 then 23 | local retval, retvals_csv = reaper.GetUserInputs('Set Take Volume', 1, 'New dB:', '') 24 | if not retval or not tonumber(retvals_csv) then return end 25 | for i = 0, count_sel_items - 1 do 26 | local item = reaper.GetSelectedMediaItem(0, i) 27 | local take = reaper.GetActiveTake(item) 28 | local take_vol = reaper.GetMediaItemTakeInfo_Value(take, 'D_VOL') 29 | local take_db = 20*log10(take_vol) 30 | local delta_db = retvals_csv - take_db 31 | reaper.SetMediaItemTakeInfo_Value(take, 'D_VOL', take_vol*10^(0.05*delta_db)) 32 | reaper.UpdateItemInProject(item) 33 | end 34 | end 35 | reaper.Undo_EndBlock('Set Take Volume', -1) 36 | reaper.PreventUIRefresh(-1) 37 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Trim Note Right Edge (Percentages).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Trim Note Right Edge (Percentages) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2020-1-19) 16 | + Initial release 17 | --]] 18 | 19 | reaper.Undo_BeginBlock() 20 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | _, notecnt, _, _ = reaper.MIDI_CountEvts(take) 22 | local ok, j = reaper.GetUserInputs("Trim Note Right Edge", 1, "Percentages", "200") 23 | if not ok then return reaper.SN_FocusMIDIEditor() end 24 | reaper.MIDI_DisableSort(take) 25 | for i = 0, notecnt-1 do 26 | retval, sel, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 27 | if sel == true then 28 | local len = endppqpos-startppqpos 29 | reaper.MIDI_SetNote(take, i, sel, muted, startppqpos, endppqpos+len*(j/100)-len, chan, pitch, vel, false) 30 | end 31 | i=i+1 32 | end 33 | reaper.UpdateArrange() 34 | reaper.MIDI_Sort(take) 35 | reaper.Undo_EndBlock("Trim Note Right Edge (Percentages)", 0) 36 | reaper.SN_FocusMIDIEditor() 37 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Move Edit Cursor.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Move Edit Cursor 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | * provides: [main=midi_editor,midi_eventlisteditor] . 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2020-1-27) 16 | + Initial release 17 | --]] 18 | 19 | function Main() 20 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | local pos = reaper.GetCursorPositionEx() 22 | local ppq = reaper.MIDI_GetPPQPosFromProjTime(take, pos) 23 | local tick = reaper.GetExtState("MoveEditCursor", "Tick") 24 | if (tick == "") then tick = "10" end 25 | user_ok, get_input_csv = reaper.GetUserInputs("Move Edit Cursor", 1, "Enter A Tick", tick) 26 | if not user_ok then return reaper.SN_FocusMIDIEditor() end 27 | tick = get_input_csv:match("(.*)") 28 | if not tonumber(tick) then return reaper.SN_FocusMIDIEditor() end 29 | reaper.SetExtState("MoveEditCursor", "Tick", tick, false) 30 | reaper.SetEditCurPos(reaper.MIDI_GetProjTimeFromPPQPos(take, ppq+tick), true, true) 31 | end 32 | script_title = "Move Edit Cursor" 33 | reaper.Undo_BeginBlock() 34 | Main() 35 | reaper.Undo_EndBlock(script_title, 0) 36 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Set Item Volume.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Set Item Volume 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-5-22) 15 | + Initial release 16 | --]] 17 | 18 | reaper.PreventUIRefresh(1) 19 | reaper.Undo_BeginBlock() 20 | local count_sel_items = reaper.CountSelectedMediaItems(0) 21 | local log10 = function(x) return math.log(x, 10) end 22 | if count_sel_items > 0 then 23 | local retval, new_db = reaper.GetUserInputs("Set Item Volume", 1, "New dB:", "") 24 | if not retval or not tonumber(new_db) then return end 25 | if retval == true and new_db and tonumber(new_db) then 26 | for i = 0, count_sel_items-1 do 27 | local it = reaper.GetSelectedMediaItem(0, i) 28 | local it_vol = reaper.GetMediaItemInfo_Value(it, 'D_VOL') 29 | local it_db = 20*log10(it_vol) 30 | local delta_db = new_db - it_db 31 | reaper.SetMediaItemInfo_Value(it, 'D_VOL', it_vol*10^(0.05*delta_db)) 32 | reaper.UpdateItemInProject(it) 33 | end 34 | end 35 | end 36 | reaper.Undo_EndBlock('Set Item Volume', -1) 37 | reaper.PreventUIRefresh(-1) 38 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Equal Cut At Edit Cursor.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Equal Cut At Edit Cursor 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2021-5-22) 14 | + Initial release 15 | --]] 16 | 17 | reaper.PreventUIRefresh(1) 18 | reaper.Undo_BeginBlock() 19 | reaper.ClearConsole() 20 | local cur_pos = reaper.GetCursorPosition() 21 | local sel_item = reaper.GetSelectedMediaItem(0, 0) 22 | if sel_item == nil then return end 23 | 24 | local item_start = reaper.GetMediaItemInfo_Value(sel_item, "D_POSITION") 25 | if cur_pos <= item_start then return end 26 | local item_len = reaper.GetMediaItemInfo_Value(sel_item, "D_LENGTH") 27 | local cuts_len = cur_pos-item_start 28 | local num_cuts = math.floor(item_len/cuts_len) 29 | 30 | for i = 0, num_cuts do 31 | reaper.Main_OnCommand(40012, 0) -- Item: Split items at edit or play cursor 32 | sel_item = reaper.GetSelectedMediaItem(0, 0) 33 | item_start = reaper.GetMediaItemInfo_Value(sel_item, "D_POSITION") 34 | reaper.SetEditCurPos(item_start+cuts_len, 0, 0) 35 | end 36 | reaper.SetEditCurPos(cur_pos, 0, 0) 37 | reaper.SelectAllMediaItems(0, 0) 38 | reaper.Undo_EndBlock('Equal Cut At Edit Cursor', -1) 39 | reaper.PreventUIRefresh(-1) 40 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Regions/zaibuyidao_Set Selected Items to Matching Region Colors.lua: -------------------------------------------------------------------------------- 1 | -- @description Set Selected Items to Matching Region Colors 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | count_sel_items = reaper.CountSelectedMediaItems(0) 13 | 14 | if count_sel_items > 0 then 15 | reaper.PreventUIRefresh(1) 16 | reaper.Undo_BeginBlock() 17 | for i = 0, count_sel_items - 1 do 18 | local item = reaper.GetSelectedMediaItem(0, i) 19 | local take = reaper.GetActiveTake(item) 20 | local item_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") 21 | local marker_idx, region_idx = reaper.GetLastMarkerAndCurRegion(0, item_pos) 22 | local retval, isrgn, pos, rgnend, name, markrgnindexnumber, color = reaper.EnumProjectMarkers3(0, region_idx) 23 | 24 | if retval > 0 then 25 | if take then 26 | reaper.SetMediaItemTakeInfo_Value(take, "I_CUSTOMCOLOR", color, true) 27 | else 28 | reaper.SetMediaItemInfo_Value(item, "I_CUSTOMCOLOR", color, true) 29 | end 30 | end 31 | end 32 | reaper.Undo_EndBlock("Set Selected Items to Matching Region Colors", -1) 33 | reaper.UpdateArrange() 34 | reaper.PreventUIRefresh(-1) 35 | end 36 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Note Off Velocity +01.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Note Off Velocity +01 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-8-17) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) 19 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 20 | end 21 | 22 | local vel = 1 23 | take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 24 | local midi_ok, midi_string = reaper.MIDI_GetAllEvts(take, "") 25 | if not midi_ok then return end 26 | local string_pos, ticks, table_events, offset, flags, msg = 1, 0, {} 27 | local pack, unpack = string.pack, string.unpack 28 | while string_pos < #midi_string do 29 | offset, flags, msg, string_pos = unpack("i4Bs4", midi_string, string_pos) 30 | if flags&1 ==1 and #msg >= 3 and msg:byte(1)>>4 == 8 and msg:byte(3) ~= -1 then 31 | msg = msg:sub(1,2) .. string.char(math.max(0, math.min(127, (msg:byte(3) + vel)//1))) 32 | end 33 | table_events[#table_events+1] = pack("i4Bs4", offset, flags, msg) 34 | end 35 | reaper.MIDI_SetAllEvts(take, table.concat(table_events)) 36 | reaper.Undo_OnStateChange_Item(0, "Note Off Velocity +01", reaper.GetMediaItemTake_Item(take)) -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Trim Note Left Edge (Percentages).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Trim Note Left Edge (Percentages) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2020-3-4) 16 | + Initial release 17 | --]] 18 | 19 | function Msg(param) reaper.ShowConsoleMsg(tostring(param) .. "\n") end 20 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 22 | local retval, j = reaper.GetUserInputs("Trim Note Left Edge", 1, "Percentages", "200") 23 | if not retval then return reaper.SN_FocusMIDIEditor() end 24 | reaper.MIDI_DisableSort(take) 25 | reaper.Undo_BeginBlock() 26 | for i = 1, notes do 27 | retval, sel, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i-1) 28 | if sel == true then 29 | local len = endppqpos-startppqpos 30 | reaper.MIDI_SetNote(take, i-1, sel, nil, startppqpos-len*(j/100)+len, nil, nil, nil, nil, false) 31 | end 32 | end 33 | reaper.Undo_EndBlock("Trim Note Left Edge (Percentages)", 0) 34 | reaper.MIDI_Sort(take) 35 | reaper.UpdateArrange() 36 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /Various/Articulation Map/banks/100-0 LASS 3 Full (CC Stack-0).reabank: -------------------------------------------------------------------------------- 1 | Bank 100 0 LASS 3 Full (CC Stack) 2 | 1 Legato 3 | 2 Sustain 4 | 3 Sordino 5 | //! 100-0-4=100-0-6 6 | 4 Shorts 7 | //! 100-0-5=100-0-7 8 | 5 Pizzicato 9 | //! 100-0-6=100-0-9 10 | 6 Bartok Pizz 11 | //! 100-0-7=100-0-12 12 | 7 Tremolo 13 | //! 100-0-8=100-0-13 14 | 8 Trills 15 | //! 100-0-9=100-0-14 16 | 9 Harmonics 17 | //! 100-0-10=100-0-32 18 | 10 Staccato 19 | //! 100-0-11=100-0-33 20 | 11 Staccato (Tight) 21 | //! 100-0-12=100-0-34 22 | 12 Staccato (Tightest) 23 | //! 100-0-13=100-0-38 24 | 13 Spiccato 25 | //! 100-0-14=100-0-39 26 | 14 Spiccato (Tight) 27 | //! 100-0-15=100-0-40 28 | 15 Spiccato (Tightest) 29 | //! 100-0-16=100-0-41 30 | 16 Pizzicato 31 | //! 100-0-17=100-0-42 32 | 17 Pizzicato (Tight) 33 | //! 100-0-18=100-0-43 34 | 18 Pizzicato (Tightest) 35 | //! 100-0-19=100-0-47 36 | 19 Bartok Pizz 37 | //! 100-0-20=100-0-48 38 | 20 Bartok Pizz (Tight) 39 | //! 100-0-21=100-0-49 40 | 21 Bartok Pizz (Tightest) 41 | //! 100-0-22=100-0-72 42 | 22 Tremolo 43 | //! 100-0-23=100-0-73 44 | 23 Tremolo: Legato 45 | //! 100-0-24=100-0-75 46 | 24 Trills: Diat 47 | //! 100-0-25=100-0-76 48 | 25 Trills: Diat Legato 49 | //! 100-0-26=100-0-77 50 | 26 Trills: Half 51 | //! 100-0-27=100-0-78 52 | 27 Trills: Half Legato 53 | //! 100-0-28=100-0-79 54 | 28 Trills: Whole 55 | //! 100-0-29=100-0-80 56 | 29 Trills: Whole Legato 57 | //! 100-0-30=100-0-81 58 | 30 Harmonics 59 | //! 100-0-31=100-0-125 60 | 31 Marcato (Stac+Sus) 61 | //! 100-0-32=100-0-127 62 | 32 Marcato (Spic+Sus) 63 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Note Off Velocity +10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Note Off Velocity +10 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-8-17) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) 19 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 20 | end 21 | 22 | local vel = 10 23 | take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 24 | local midi_ok, midi_string = reaper.MIDI_GetAllEvts(take, "") 25 | if not midi_ok then return end 26 | local string_pos, ticks, table_events, offset, flags, msg = 1, 0, {} 27 | local pack, unpack = string.pack, string.unpack 28 | while string_pos < #midi_string do 29 | offset, flags, msg, string_pos = unpack("i4Bs4", midi_string, string_pos) 30 | if flags&1 ==1 and #msg >= 3 and msg:byte(1)>>4 == 8 and msg:byte(3) ~= -1 then 31 | msg = msg:sub(1,2) .. string.char(math.max(0, math.min(127, (msg:byte(3) + vel)//1))) 32 | end 33 | table_events[#table_events+1] = pack("i4Bs4", offset, flags, msg) 34 | end 35 | reaper.MIDI_SetAllEvts(take, table.concat(table_events)) 36 | reaper.Undo_OnStateChange_Item(0, "Note Off Velocity +10", reaper.GetMediaItemTake_Item(take)) -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Note Off Velocity -01.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Note Off Velocity -01 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-8-17) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) 19 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 20 | end 21 | 22 | local vel = -1 23 | take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 24 | local midi_ok, midi_string = reaper.MIDI_GetAllEvts(take, "") 25 | if not midi_ok then return end 26 | local string_pos, ticks, table_events, offset, flags, msg = 1, 0, {} 27 | local pack, unpack = string.pack, string.unpack 28 | while string_pos < #midi_string do 29 | offset, flags, msg, string_pos = unpack("i4Bs4", midi_string, string_pos) 30 | if flags&1 ==1 and #msg >= 3 and msg:byte(1)>>4 == 8 and msg:byte(3) ~= -1 then 31 | msg = msg:sub(1,2) .. string.char(math.max(0, math.min(127, (msg:byte(3) + vel)//1))) 32 | end 33 | table_events[#table_events+1] = pack("i4Bs4", offset, flags, msg) 34 | end 35 | reaper.MIDI_SetAllEvts(take, table.concat(table_events)) 36 | reaper.Undo_OnStateChange_Item(0, "Note Off Velocity -01", reaper.GetMediaItemTake_Item(take)) -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Note Off Velocity -10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Note Off Velocity -10 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-8-17) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) 19 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 20 | end 21 | 22 | local vel = -10 23 | take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 24 | local midi_ok, midi_string = reaper.MIDI_GetAllEvts(take, "") 25 | if not midi_ok then return end 26 | local string_pos, ticks, table_events, offset, flags, msg = 1, 0, {} 27 | local pack, unpack = string.pack, string.unpack 28 | while string_pos < #midi_string do 29 | offset, flags, msg, string_pos = unpack("i4Bs4", midi_string, string_pos) 30 | if flags&1 ==1 and #msg >= 3 and msg:byte(1)>>4 == 8 and msg:byte(3) ~= -1 then 31 | msg = msg:sub(1,2) .. string.char(math.max(0, math.min(127, (msg:byte(3) + vel)//1))) 32 | end 33 | table_events[#table_events+1] = pack("i4Bs4", offset, flags, msg) 34 | end 35 | reaper.MIDI_SetAllEvts(take, table.concat(table_events)) 36 | reaper.Undo_OnStateChange_Item(0, "Note Off Velocity -10", reaper.GetMediaItemTake_Item(take)) -------------------------------------------------------------------------------- /JSFX/MIDI Route CC To Channel.jsfx: -------------------------------------------------------------------------------- 1 | desc: MIDI Route CC To Channel 2 | version: 1.0 3 | changelog: init 4 | author: zaibuyidao 5 | website: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | about: 7 | listens for CC sets the MIDI channel to 1 ... 16 8 | 9 | slider1:118<1,127,1>Controller Number (CC) 10 | slider2:1<0,127,1>Value 11 | slider3:1<1,16,1>Channel 12 | 13 | in_pin:none 14 | out_pin:none 15 | 16 | @init 17 | note_on = 9; 18 | note_off = 8; 19 | 20 | // 記住當前音符 21 | start_ons = 1024; 22 | note_ons = start_ons; 23 | end_ons = note_ons + 128; 24 | memset(start_ons, -1, 128); 25 | 26 | @slider 27 | 28 | @sample 29 | while ( 30 | midirecv(offset, msg1, msg2, msg3) ? ( 31 | statusHi = (msg1 / 16) | 0; 32 | statusLo = msg1 - (statusHi * 16); 33 | msg = (msg1 / 16) | 0; 34 | msg_num = msg2; 35 | msg_val = msg3; 36 | 37 | CC118 = slider1; 38 | msg == 11 && (msg_num == CC118) ? ( 39 | slider2 = msg_val; 40 | msg_val > 0 ? msg_val -=1; 41 | channel_route = msg_val % 16; // 約束到 0 ... 15 42 | slider3 = channel_route + 1; 43 | msg1 = $xc0 + channel_route; 44 | ); 45 | 46 | msg == note_off || (msg == note_on && msg_val == 0) ? ( 47 | msg1 = msg * 16 + note_ons[msg_num]; 48 | ) : msg1 = msg * 16 + channel_route; 49 | msg == note_on && msg_val > 0 ? ( 50 | note_ons[msg_num] = channel_route; 51 | ); 52 | 53 | midisend(offset, msg1, msg2, msg3); 54 | ); 55 | ); 56 | -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Move Selected Items +10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Move Selected Items +10 3 | * Version: 1.0.1 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-3-15) 15 | + Initial release 16 | --]] 17 | 18 | interval = 10 -- 移动10tick 19 | 20 | function main() 21 | reaper.PreventUIRefresh(1) 22 | reaper.Undo_BeginBlock() 23 | count_sel_items = reaper.CountSelectedMediaItems(0) 24 | midi_tick = reaper.SNM_GetIntConfigVar("MidiTicksPerBeat", 480) 25 | for i = 1, count_sel_items do 26 | item = reaper.GetSelectedMediaItem(0, count_sel_items - i) 27 | track = reaper.GetMediaItem_Track(item) 28 | item_id = reaper.GetMediaItemInfo_Value(item, "IP_ITEMNUMBER") 29 | item_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") 30 | qn_item_pos = reaper.TimeMap2_timeToQN(0, item_pos) 31 | ppq_item_pos = math.floor(qn_item_pos * midi_tick + 0.5) 32 | new_ppq_item_pos = ppq_item_pos + interval 33 | new_qn_item_pos = new_ppq_item_pos / midi_tick 34 | new_item_pos = reaper.TimeMap2_QNToTime(0, new_qn_item_pos) 35 | reaper.SetMediaItemInfo_Value(item, "D_POSITION", new_item_pos) 36 | end 37 | reaper.Undo_EndBlock("Move Selected Items +10", -1) 38 | reaper.PreventUIRefresh(-1) 39 | reaper.UpdateArrange() 40 | end 41 | main() -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Move Selected Items -10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Move Selected Items -10 3 | * Version: 1.0.1 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-3-15) 15 | + Initial release 16 | --]] 17 | 18 | interval = -10 -- 移动10tick 19 | 20 | function main() 21 | reaper.PreventUIRefresh(1) 22 | reaper.Undo_BeginBlock() 23 | count_sel_items = reaper.CountSelectedMediaItems(0) 24 | midi_tick = reaper.SNM_GetIntConfigVar("MidiTicksPerBeat", 480) 25 | for i = 1, count_sel_items do 26 | item = reaper.GetSelectedMediaItem(0, count_sel_items - i) 27 | track = reaper.GetMediaItem_Track(item) 28 | item_id = reaper.GetMediaItemInfo_Value(item, "IP_ITEMNUMBER") 29 | item_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") 30 | qn_item_pos = reaper.TimeMap2_timeToQN(0, item_pos) 31 | ppq_item_pos = math.floor(qn_item_pos * midi_tick + 0.5) 32 | new_ppq_item_pos = ppq_item_pos + interval 33 | new_qn_item_pos = new_ppq_item_pos / midi_tick 34 | new_item_pos = reaper.TimeMap2_QNToTime(0, new_qn_item_pos) 35 | reaper.SetMediaItemInfo_Value(item, "D_POSITION", new_item_pos) 36 | end 37 | reaper.Undo_EndBlock("Move Selected Items -10", -1) 38 | reaper.PreventUIRefresh(-1) 39 | reaper.UpdateArrange() 40 | end 41 | main() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Event Value -01.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Event Value -01 3 | * Version: 1.1.1 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-1-27) 15 | + Initial release 16 | --]] 17 | 18 | local j = -1 19 | 20 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 22 | 23 | function NOTES() 24 | for i = 0, notes-1 do 25 | _, sel, _, _, _, _, _, vel = reaper.MIDI_GetNote(take, i) 26 | if sel == true then 27 | local x = vel+j 28 | if x < 1 then x = 1 end 29 | reaper.MIDI_SetNote(take, i, nil, nil, nil, nil, nil, nil, x, false) 30 | end 31 | i=i+1 32 | end 33 | end 34 | 35 | function CCS() 36 | for i = 0, ccs-1 do 37 | _, sel, _, _, _, _, _, msg3 = reaper.MIDI_GetCC(take, i) 38 | if sel == true then 39 | local y = msg3+j 40 | if y < 0 then y = 0 end 41 | reaper.MIDI_SetCC(take, i, sel, nil, nil, nil, nil, nil, y, false) 42 | end 43 | i=i+1 44 | end 45 | end 46 | 47 | reaper.Undo_BeginBlock() 48 | reaper.MIDI_DisableSort(take) 49 | NOTES() 50 | CCS() 51 | reaper.MIDI_Sort(take) 52 | reaper.Undo_EndBlock("Event Value -01", -1) 53 | reaper.UpdateArrange() 54 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Event Value -10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Event Value -10 3 | * Version: 1.1.1 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-2-4) 15 | + Initial release 16 | --]] 17 | 18 | local j = -10 19 | 20 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 22 | 23 | function NOTES() 24 | for i = 0, notes-1 do 25 | _, sel, _, _, _, _, _, vel = reaper.MIDI_GetNote(take, i) 26 | if sel == true then 27 | local x = vel+j 28 | if x < 1 then x = 1 end 29 | reaper.MIDI_SetNote(take, i, nil, nil, nil, nil, nil, nil, x, false) 30 | end 31 | i=i+1 32 | end 33 | end 34 | 35 | function CCS() 36 | for i = 0, ccs-1 do 37 | _, sel, _, _, _, _, _, msg3 = reaper.MIDI_GetCC(take, i) 38 | if sel == true then 39 | local y = msg3+j 40 | if y < 0 then y = 0 end 41 | reaper.MIDI_SetCC(take, i, sel, nil, nil, nil, nil, nil, y, false) 42 | end 43 | i=i+1 44 | end 45 | end 46 | 47 | reaper.Undo_BeginBlock() 48 | reaper.MIDI_DisableSort(take) 49 | NOTES() 50 | CCS() 51 | reaper.MIDI_Sort(take) 52 | reaper.Undo_EndBlock("Event Value -10", -1) 53 | reaper.UpdateArrange() 54 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Event Value +01.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Event Value +01 3 | * Version: 1.1.1 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-1-27) 15 | + Initial release 16 | --]] 17 | 18 | local j = 1 19 | 20 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 22 | 23 | function NOTES() 24 | for i = 0, notes-1 do 25 | _, sel, _, _, _, _, _, vel = reaper.MIDI_GetNote(take, i) 26 | if sel == true then 27 | local x = vel+j 28 | if x > 127 then x = 127 end 29 | reaper.MIDI_SetNote(take, i, nil, nil, nil, nil, nil, nil, x, false) 30 | end 31 | i=i+1 32 | end 33 | end 34 | 35 | function CCS() 36 | for i = 0, ccs-1 do 37 | _, sel, _, _, _, _, _, msg3 = reaper.MIDI_GetCC(take, i) 38 | if sel == true then 39 | local y = msg3+j 40 | if y > 127 then y = 127 end 41 | reaper.MIDI_SetCC(take, i, nil, nil, nil, nil, nil, nil, y, false) 42 | end 43 | i=i+1 44 | end 45 | end 46 | 47 | reaper.Undo_BeginBlock() 48 | reaper.MIDI_DisableSort(take) 49 | NOTES() 50 | CCS() 51 | reaper.MIDI_Sort(take) 52 | reaper.Undo_EndBlock("Event Value +01", -1) 53 | reaper.UpdateArrange() 54 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Event Value +10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Event Value +10 3 | * Version: 1.1.1 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-2-4) 15 | + Initial release 16 | --]] 17 | 18 | local j = 10 19 | 20 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 22 | 23 | function NOTES() 24 | for i = 0, notes-1 do 25 | _, sel, _, _, _, _, _, vel = reaper.MIDI_GetNote(take, i) 26 | if sel == true then 27 | local x = vel+j 28 | if x > 127 then x = 127 end 29 | reaper.MIDI_SetNote(take, i, nil, nil, nil, nil, nil, nil, x, false) 30 | end 31 | i=i+1 32 | end 33 | end 34 | 35 | function CCS() 36 | for i = 0, ccs-1 do 37 | _, sel, _, _, _, _, _, msg3 = reaper.MIDI_GetCC(take, i) 38 | if sel == true then 39 | local y = msg3+j 40 | if y > 127 then y = 127 end 41 | reaper.MIDI_SetCC(take, i, nil, nil, nil, nil, nil, nil, y, false) 42 | end 43 | i=i+1 44 | end 45 | end 46 | 47 | reaper.Undo_BeginBlock() 48 | reaper.MIDI_DisableSort(take) 49 | NOTES() 50 | CCS() 51 | reaper.MIDI_Sort(take) 52 | reaper.Undo_EndBlock("Event Value +10", -1) 53 | reaper.UpdateArrange() 54 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Set CC Value (Percentages).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Set CC Value (Percentages) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select CC Event. Run. 4 | * Version: 1.1 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2020-1-19) 16 | + Initial release 17 | --]] 18 | 19 | local retval, user_input = reaper.GetUserInputs('Set CC Value', 1, 'Percentages', '125') 20 | if not retval then return reaper.SN_FocusMIDIEditor() end 21 | 22 | function Main() 23 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 24 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 25 | reaper.MIDI_DisableSort(take) 26 | for i = 0, ccs-1 do 27 | retval, sel, muted, ppqpos, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 28 | if sel == true then 29 | local x = math.floor(msg3 * (user_input/100)) 30 | if x > 127 then x = 127 end 31 | if x < 1 then x = 1 end 32 | reaper.MIDI_SetCC(take, i, sel, mutedIn, ppqposIn, chanmsgIn, chanIn, msg2In, x, false) 33 | end 34 | i=i+1 35 | end 36 | reaper.UpdateArrange() 37 | reaper.MIDI_Sort(take) 38 | end 39 | 40 | script_title = "Set CC Value (Percentages)" 41 | reaper.Undo_BeginBlock() 42 | Main() 43 | reaper.Undo_EndBlock(script_title, 0) 44 | reaper.SN_FocusMIDIEditor() 45 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Set CC Value.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Set CC Value 3 | * Instructions: Open a MIDI take in MIDI Editor. Select CC Event. Run. 4 | * Version: 1.4 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2019-12-12) 16 | + Initial release 17 | --]] 18 | 19 | local retval, x = reaper.GetUserInputs('Set CC Value', 1, 'Value', '100') 20 | if not retval then return reaper.SN_FocusMIDIEditor() end 21 | x = tonumber(x) 22 | 23 | if x > 127 or x < 1 then 24 | return reaper.MB("Please enter a value from 1 through 127", "Error", 0), 25 | reaper.SN_FocusMIDIEditor() 26 | end 27 | 28 | function Main() 29 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 30 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 31 | reaper.MIDI_DisableSort(take) 32 | for i = 0, ccs-1 do 33 | retval, sel, muted, ppqpos, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 34 | if sel == true then 35 | reaper.MIDI_SetCC(take, i, sel, mutedIn, ppqposIn, chanmsgIn, chanIn, msg2In, x, false) 36 | end 37 | i=i+1 38 | end 39 | reaper.UpdateArrange() 40 | reaper.MIDI_Sort(take) 41 | end 42 | 43 | script_title = "Set CC Value" 44 | reaper.Undo_BeginBlock() 45 | Main() 46 | reaper.Undo_EndBlock(script_title, 0) 47 | reaper.SN_FocusMIDIEditor() 48 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Set Velocity (Percentages).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Set Velocity (Percentages) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.1 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2020-1-19) 16 | + Initial release 17 | --]] 18 | 19 | local retval, user_input = reaper.GetUserInputs('Set Velocity', 1, 'Percentages', '125') 20 | if not retval then return reaper.SN_FocusMIDIEditor() end 21 | 22 | function Main() 23 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 24 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 25 | reaper.MIDI_DisableSort(take) 26 | for i = 0, notes-1 do 27 | retval, sel, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 28 | if sel == true then 29 | local x = math.floor(vel * (user_input/100)) 30 | if x > 127 then x = 127 end 31 | if x < 1 then x = 1 end 32 | reaper.MIDI_SetNote(take, i, sel, muted, startppqpos, endppqpos, chan, pitch, x, false) 33 | end 34 | i=i+1 35 | end 36 | reaper.UpdateArrange() 37 | reaper.MIDI_Sort(take) 38 | end 39 | 40 | script_title = "Set Velocity (Percentages)" 41 | reaper.Undo_BeginBlock() 42 | Main() 43 | reaper.Undo_EndBlock(script_title, 0) 44 | reaper.SN_FocusMIDIEditor() 45 | -------------------------------------------------------------------------------- /Various/Articulation Map/banks/70-96 Ample Metal Eclipse (金属吉他).reabank: -------------------------------------------------------------------------------- 1 | //REAPER Preferences - Media - MIDI - MIDI octave name display offset: -1 2 | //---------------------------------------------------------------------- 3 | //Default KS Velocity 96 4 | Bank 70 96 Ample Metal Eclipse 5 | 18 6弦指定 6 | 19 5弦指定 7 | 20 4弦指定 8 | 21 3弦指定 9 | 22 2弦指定 10 | 23 1弦指定 11 | 24 标准音 12 | 25 自然泛音 13 | 26 手掌闷音(力度越小,压制程度越大) 14 | 27 无头与无尾滑音 15 | 28 连奏滑音(同弦) 16 | 29 击勾弦 17 | 30 点指 18 | 32 把位指定 19 | 36 0把位指定 20 | 37 1把位指定 21 | 38 2把位指定 22 | 39 3把位指定 23 | 40 4把位指定 24 | 41 5把位指定 25 | 42 6把位指定 26 | 43 7把位指定 27 | 44 8把位指定 28 | 45 9把位指定 29 | 46 10把位指定 30 | 47 11把位指定 31 | 48 12把位指定 32 | 49 13把位指定 33 | 50 14把位指定 34 | 51 15把位指定 35 | 52 16把位指定 36 | 53 17把位指定 37 | 54 18把位指定 38 | 89 滑弦噪音(Scratch) 39 | 90 拍弦(Slap) 40 | 91 护弦制音(Press) 41 | 92 扫弦制音(Stroke Muting) 42 | 93 下扫噪音 1(Downstroke 1) 43 | 94 上扫噪音 1(Upstroke 1) 44 | 95 下扫噪音 2(Downstroke 2) 45 | 96 上扫噪音 2(Upstroke 2) 46 | 101 刮弦噪音(Pick Scrape) 47 | 102 效果滑音 1(FX Slide 1) 48 | 103 效果滑音 2(FX Slide 2) 49 | 50 | //KS Velocity 1 51 | Bank 70 1 Ample Metal Eclipse 52 | 24 标准音-Full Mute 53 | 28 连奏滑音-不改变把位 54 | 29 击勾弦-不改变把位 55 | 18 6弦指定-不改变把位 56 | 19 5弦指定-不改变把位 57 | 20 4弦指定-不改变把位 58 | 21 3弦指定-不改变把位 59 | 22 2弦指定-不改变把位 60 | 23 1弦指定-不改变把位 61 | 99 自动连奏-开启自动击勾弦 62 | 104 空弦优先 关 63 | 64 | //KS Velocity 22 65 | Bank 70 22 Ample Metal Eclipse 66 | 24 标准音-3/4 Mute 67 | 68 | //KS Velocity 43 69 | Bank 70 43 Ample Metal Eclipse 70 | 24 标准音-Half Mute 71 | 72 | //KS Velocity 64 73 | Bank 1 64 Ample Metal Eclipse 74 | 24 标准音-Sustain 75 | 76 | //KS Velocity 127 77 | Bank 70 127 Ample Metal Eclipse 78 | 24 标准音-重勾或搓泛音 79 | 25 自然泛音-搓泛音 80 | 99 自动连奏-开启自动滑音 81 | 104 空弦优先 开 -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Random Note Mute.lua: -------------------------------------------------------------------------------- 1 | -- @description Random Note Mute 2 | -- @version 1.0.1 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Random Note Script Series, filter "zaibuyidao random note" in ReaPack or Actions to access all scripts. 11 | 12 | function main() 13 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 14 | if not take or not reaper.TakeIsMIDI(take) then return end 15 | 16 | local _, notecnt = reaper.MIDI_CountEvts(take) 17 | local has_selected_notes = reaper.MIDI_EnumSelNotes(take, -1) ~= -1 18 | 19 | reaper.MIDI_DisableSort(take) 20 | 21 | if has_selected_notes then 22 | local i = reaper.MIDI_EnumSelNotes(take, -1) 23 | while i ~= -1 do 24 | local _, sel = reaper.MIDI_GetNote(take, i) 25 | if sel then 26 | local mute_state = math.random(2) == 1 27 | reaper.MIDI_SetNote(take, i, nil, mute_state, nil, nil, nil, nil, nil, true) 28 | end 29 | i = reaper.MIDI_EnumSelNotes(take, i) 30 | end 31 | else 32 | -- 如果没有选中的音符,则处理所有音符 33 | for i = 0, notecnt - 1 do 34 | local mute_state = math.random(2) == 1 35 | reaper.MIDI_SetNote(take, i, nil, mute_state, nil, nil, nil, nil, nil, true) 36 | end 37 | end 38 | 39 | reaper.MIDI_Sort(take) 40 | end 41 | 42 | reaper.Undo_BeginBlock() 43 | main() 44 | reaper.Undo_EndBlock("Random Note Mute", -1) -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Remove Redundant CCs.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Remove Redundant CCs 3 | * Version: 1.1 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2021-3-7) 14 | + Initial release 15 | --]] 16 | 17 | function Msg(param) reaper.ShowConsoleMsg(tostring(param) .. "\n") end 18 | local editor = reaper.MIDIEditor_GetActive() 19 | local take = reaper.MIDIEditor_GetTake(editor) 20 | local cnt, index = 0, {} 21 | local val = reaper.MIDI_EnumSelCC(take, -1) 22 | while val ~= - 1 do 23 | cnt = cnt + 1 24 | index[cnt] = val 25 | val = reaper.MIDI_EnumSelCC(take, val) 26 | end 27 | local idx, tc, tp = -1, "", "" 28 | reaper.Undo_BeginBlock() 29 | reaper.PreventUIRefresh(1) 30 | reaper.MIDI_DisableSort(take) 31 | for i = 1, #index do 32 | index[i] = reaper.MIDI_EnumSelCC(take, idx) 33 | retval, selected, muted, ppqpos, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, index[i]) 34 | pitchbend = 128 * msg3 + msg2 35 | if chanmsg == 176 and tc == msg3 then 36 | reaper.MIDI_DeleteCC(take, index[i]) 37 | elseif chanmsg == 224 and tp == pitchbend then 38 | reaper.MIDI_DeleteCC(take, index[i]) 39 | else 40 | tc = msg3 41 | tp = pitchbend 42 | idx = index[i] 43 | end 44 | end 45 | reaper.MIDI_Sort(take) 46 | reaper.PreventUIRefresh(-1) 47 | reaper.UpdateArrange() 48 | reaper.Undo_EndBlock("Remove Redundant CCs", 0) -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Select Note With The Same Channel.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Select Note With The Same Channel 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2020-6-7) 16 | + Initial release 17 | --]] 18 | 19 | function Msg(param) reaper.ShowConsoleMsg(tostring(param) .. "\n") end 20 | take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | _, notecnt, _, _ = reaper.MIDI_CountEvts(take) 22 | reaper.MIDI_DisableSort(take) 23 | local cnt, index = 0, {} 24 | local val = reaper.MIDI_EnumSelNotes(take, -1) 25 | while val ~= - 1 do 26 | cnt = cnt + 1 27 | index[cnt] = val 28 | val = reaper.MIDI_EnumSelNotes(take, val) 29 | end 30 | reaper.Undo_BeginBlock() 31 | if #index == 1 then 32 | _, _, _, _, _, chan_num, _, _ = reaper.MIDI_GetNote(take, index[1]) 33 | else 34 | return reaper.SN_FocusMIDIEditor() 35 | end 36 | for i = 1, notecnt do 37 | retval, sel, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i - 1) 38 | if chan == chan_num then 39 | reaper.MIDI_SetNote(take, i - 1, true, nil, nil, nil, nil, nil, nil, false) 40 | end 41 | end 42 | reaper.Undo_EndBlock("Select All Notes By Note Channel", 0) 43 | reaper.MIDI_Sort(take) 44 | reaper.UpdateArrange() 45 | reaper.SN_FocusMIDIEditor() 46 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Humanize Velocity (Customize).lua: -------------------------------------------------------------------------------- 1 | -- @description Humanize Velocity (Customize) 2 | -- @version 1.0.2 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- + Add Multi-Language Support 6 | -- @links 7 | -- webpage https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- repo https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | -- USER AREA 13 | -- Settings that the user can customize. 14 | 15 | strength = 3 16 | 17 | -- End of USER AREA 18 | 19 | function print(...) 20 | for _, v in ipairs({...}) do 21 | reaper.ShowConsoleMsg(tostring(v) .. " ") 22 | end 23 | reaper.ShowConsoleMsg("\n") 24 | end 25 | 26 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 27 | local _, noteCount, _, _ = reaper.MIDI_CountEvts(take) 28 | reaper.Undo_BeginBlock() 29 | reaper.MIDI_DisableSort(take) 30 | for i = 0, noteCount - 1 do 31 | local _, isSelected, muted, startppqpos, endppqpos, chan, pitch, velocity = reaper.MIDI_GetNote(take, i) 32 | if isSelected then 33 | local velocityChange = math.random(-strength, strength) 34 | local newVelocity = velocity + velocityChange 35 | if newVelocity > 127 then newVelocity = 127 end 36 | if newVelocity < 1 then newVelocity = 1 end 37 | reaper.MIDI_SetNote(take, i, isSelected, muted, startppqpos, endppqpos, chan, pitch, math.floor(newVelocity), false) 38 | end 39 | end 40 | reaper.MIDI_Sort(take) 41 | reaper.Undo_EndBlock("Humanize Velocity", -1) 42 | reaper.UpdateArrange() 43 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /Various/Articulation Map Bundle.lua: -------------------------------------------------------------------------------- 1 | -- @description Articulation Map Bundle 2 | -- @author zaibuyidao 3 | -- @version 1.0.50 4 | -- @changelog 5 | -- + The reabank file has been updated to support the latest mapping rules. 6 | -- @links 7 | -- Forum Thread https://forum.cockos.com/showthread.php?t=289373 8 | -- GitHub repository https://github.com/zaibuyidao/ReaScripts 9 | -- @metapackage 10 | -- @provides 11 | -- [jsfx] Articulation Map/jsfx/articulation_map.jsfx > Articulation Map/articulation_map.jsfx 12 | -- [jsfx] Articulation Map/jsfx/pre_trigger_events.jsfx > Articulation Map/pre_trigger_events.jsfx 13 | -- [data] Articulation Map/jsfx/zaibuyidao_articulation_map/simul-arts.txt > zaibuyidao_articulation_map/simul-arts.txt 14 | -- [main=midi_editor] Articulation Map/zaibuyidao_Articulation Map - No GUI.lua 15 | -- [main=midi_editor] Articulation Map/zaibuyidao_Articulation Map - CC to PC.lua 16 | -- [main=midi_editor] Articulation Map/zaibuyidao_Articulation Map - PC to CC.lua 17 | -- [main=midi_editor] Articulation Map/zaibuyidao_Articulation Map - Toggle PC to CC.lua 18 | -- [main=midi_editor] Articulation Map/zaibuyidao_Articulation Map - Toggle PC to Note.lua 19 | -- [main=midi_editor] Articulation Map/zaibuyidao_Articulation Map - Note to PC.lua 20 | -- [main=midi_editor] Articulation Map/zaibuyidao_Articulation Map - PC to Note.lua 21 | -- [main=midi_editor] Articulation Map/zaibuyidao_Articulation Map.lua 22 | -- [nomain] Articulation Map/lib/*.lua 23 | -- Articulation Map/banks/*.reabank 24 | -- Articulation Map/articulation_map_factory.reabank 25 | -- @donation http://www.paypal.me/zaibuyidao 26 | -- @about Requires JS_ReaScriptAPI & SWS Extension 27 | 28 | -- Licensed under the GNU GPL v3 -------------------------------------------------------------------------------- /Various/Articulation Map/banks/71-96 Ample Metal Hellrazer (九弦吉他).reabank: -------------------------------------------------------------------------------- 1 | //REAPER Preferences - Media - MIDI - MIDI octave name display offset: -1 2 | //---------------------------------------------------------------------- 3 | //Default KS Velocity 96 4 | Bank 71 96 Ample Metal Hellrazer 5 | 3 9弦指定 6 | 4 8弦指定 7 | 5 7弦指定 8 | 6 6弦指定 9 | 7 5弦指定 10 | 8 4弦指定 11 | 9 3弦指定 12 | 10 2弦指定 13 | 11 1弦指定 14 | 12 标准音 15 | 13 自然泛音 16 | 14 手掌闷音(力度越小,压制程度越大) 17 | 15 无头与无尾滑音 18 | 16 连奏滑音 19 | 17 击勾弦 20 | 18 点指 21 | 20 把位指定 22 | 25 0把位指定 23 | 26 1把位指定 24 | 27 2把位指定 25 | 28 3把位指定 26 | 29 4把位指定 27 | 30 5把位指定 28 | 31 6把位指定 29 | 32 7把位指定 30 | 33 8把位指定 31 | 34 9把位指定 32 | 35 10把位指定 33 | 36 11把位指定 34 | 37 12把位指定 35 | 38 13把位指定 36 | 39 14把位指定 37 | 40 15把位指定 38 | 41 16把位指定 39 | 42 17把位指定 40 | 43 18把位指定 41 | 44 19把位指定 42 | 45 20把位指定 43 | 89 滑弦噪音(Scratch) 44 | 90 拍弦(Slap) 45 | 91 护弦制音(Press) 46 | 92 扫弦制音(Stroke Muting) 47 | 93 下扫噪音 1(Downstroke 1) 48 | 94 上扫噪音 1(Upstroke 1) 49 | 95 下扫噪音 2(Downstroke 2) 50 | 96 上扫噪音 2(Upstroke 2) 51 | 101 刮弦噪音(Pick Scrape) 52 | 102 效果滑音 1(FX Slide 1) 53 | 103 效果滑音 2(FX Slide 2) 54 | 55 | //KS Velocity 1 56 | Bank 71 1 Ample Metal Hellrazer 57 | 3 9弦指定-不改变把位 58 | 4 8弦指定-不改变把位 59 | 5 7弦指定-不改变把位 60 | 6 6弦指定-不改变把位 61 | 7 5弦指定-不改变把位 62 | 8 4弦指定-不改变把位 63 | 9 3弦指定-不改变把位 64 | 10 2弦指定-不改变把位 65 | 11 1弦指定-不改变把位 66 | 12 标准音-Full Mute 67 | 16 连奏滑音-不改变把位 68 | 17 击勾弦-不改变把位 69 | 99 自动连奏-开启自动击勾弦 70 | 104 空弦优先 关 71 | 72 | //KS Velocity 22 73 | Bank 71 22 Ample Metal Hellrazer 74 | 12 标准音-3/4 Mute 75 | 76 | //KS Velocity 43 77 | Bank 71 43 Ample Metal Hellrazer 78 | 12 标准音-Half Mute 79 | 80 | //KS Velocity 64 81 | Bank 71 64 Ample Metal Hellrazer 82 | 12 标准音- Sustain 83 | 84 | //KS Velocity 127 85 | Bank 71 127 Ample Metal Hellrazer 86 | 12 标准音-重勾或搓泛音 87 | 13 自然泛音-搓泛音 88 | 99 自动连奏-开启自动滑音 89 | 104 空弦优先 开 -------------------------------------------------------------------------------- /JSFX/MIDI Route PC To Channel.jsfx: -------------------------------------------------------------------------------- 1 | desc: MIDI Route PC To Channel 2 | version: 1.0 3 | changelog: init 4 | author: zaibuyidao 5 | reference: https://forum.cockos.com/showpost.php?p=1543389&postcount=9 6 | about: 7 | listens for Program Change messages sets the MIDI channel to 1 ... 16 8 | 9 | slider1:0<0,127,1>Program Change 10 | slider2:1<1,16,1>Channel 11 | 12 | in_pin:none 13 | out_pin:none 14 | 15 | @init 16 | note_on = 9; 17 | note_off = 8; 18 | 19 | // remember current notes 20 | start_ons = 1024; 21 | note_ons = start_ons; 22 | end_ons = note_ons + 128; 23 | memset(start_ons, -1, 128); 24 | 25 | @slider 26 | 27 | @sample 28 | while ( 29 | midirecv(offset, msg1, msg2, msg3) ? ( 30 | statusHi = (msg1 / 16) | 0; 31 | statusLo = msg1 - (statusHi * 16); 32 | msg = (msg1 / 16) | 0; 33 | msg_num = msg2; 34 | msg_val = msg3; 35 | 36 | pc_received = msg == 12; 37 | bs_received = msg == 11 && (msg_num == 0 || msg_num ==32); 38 | 39 | pc_received ? ( 40 | slider1 = msg_num; 41 | msg_num > 0 ? msg_num -=1; 42 | channel_route = msg_num % 16; // constrain to 0 ... 15 43 | slider2 = channel_route + 1; 44 | msg1 = $xc0 + channel_route; 45 | // msg = 0; // don't passthrough 46 | ); 47 | 48 | bs_received ? ( 49 | msg1 = $xb0 + channel_route; 50 | msg = 0; // don't passthrough 51 | ); 52 | 53 | msg == note_off || (msg == note_on && msg_val == 0) ? ( 54 | msg1 = msg * 16 + note_ons[msg_num]; 55 | ) : msg1 = msg * 16 + channel_route; 56 | msg == note_on && msg_val > 0 ? ( 57 | note_ons[msg_num] = channel_route; 58 | ); 59 | 60 | msg > 0 ? midisend(offset, msg1, msg2, msg3); 61 | ); 62 | ); 63 | -------------------------------------------------------------------------------- /Various/SFX Tag Search/lib/config-favorite-default.ini: -------------------------------------------------------------------------------- 1 | ; @noindex 2 | [files] 3 | sfx_tag_data_file=ratings-favorite.ini 4 | keywords_csv_file=keywords_favorite.csv 5 | [gui] 6 | ; Visual settings 7 | default_theme=imgui ; default theme, options: default, imgui, n0ne (设置主题, 可选项: default, imgui, n0ne) 8 | default_font=Calibri ; default font, options: Calibri, Microsoft YaHei, SimSun, STSong, STFangsong, ... (默认字体, 可选项: Calibri, 微软雅黑, SimSun, 华文宋体, 华文仿宋, ...) 9 | default_font_size=18 ; default font size (默认字体大小) 10 | font_size_adjustment=5 ; baseline offset for font size (字体大小的基线偏移) 11 | max_results=0 ; total number of results in the list, 0=unlimited (列表中结果的总数 0=不限) 12 | window_width=300 13 | window_height=600 14 | window_x=100 15 | window_y=100 16 | window_dock_state=0 17 | gui_size=20 ; The size ot the text, everything will scale accordingly (控件单位大小, 所有控件大小以此为基准) 18 | window_save_state=true ; remeber where the window was last time (关闭时记住窗口位置) 19 | cursor_focus_style=1 ; 0=Border 1=Fill (0=边框 1=填充) 20 | [color] 21 | ; Set highlight color for categories (为分类设置高亮颜色) 22 | color_row_highlight_01=null ; Grayish (霾蓝) 23 | color_row_highlight_02=null ; Yellowish (柳黄) 24 | color_row_highlight_03=null ; Blueish (碧蓝) 25 | color_row_highlight_04=null ; Greenish (苔绿) 26 | color_row_highlight_05=null ; Reddish (梅红) 27 | color_row_highlight_06=null ; Purplish (藤紫) 28 | color_row_highlight_07=null ; Tealish (鸭绿) 29 | color_row_highlight_08=null ; Rosish (蔷薇) 30 | color_row_highlight_09=null ; Orangish (橘红) 31 | color_row_highlight_10=null ; Brownish (褐黄) 32 | [misc] 33 | filter_name=true ; filter by name (是否过滤名称) 34 | filter_alias=true ; filter by alias (是否过滤别名) 35 | filter_category=false ; filter by category (是否过滤类别) 36 | english_first=false ; english list first (是否英文优先) 37 | update_ratings=false ; use rankings (是否使用排行) 38 | -------------------------------------------------------------------------------- /Various/SFX Tag Search/req/mouse.lua: -------------------------------------------------------------------------------- 1 | -- @noindex 2 | -- From Schwa's GUI example 3 | ----------------- 4 | -- Mouse table -- 5 | ----------------- 6 | 7 | local mouse = { 8 | -- Constants 9 | LB = 1, 10 | RB = 2, 11 | CTRL = 4, 12 | SHIFT = 8, 13 | ALT = 16, 14 | 15 | -- "cap" function 16 | cap = function (mask) 17 | if mask == nil then 18 | return gfx.mouse_cap end 19 | return gfx.mouse_cap&mask == mask 20 | end, 21 | 22 | uptime = 0, 23 | 24 | last_x = -1, last_y = -1, 25 | 26 | dx = 0, 27 | dy = 0, 28 | 29 | ox_l = 0, oy_l = 0, -- left click positions 30 | ox_r = 0, oy_r = 0, -- right click positions 31 | capcnt = 0, 32 | last_LMB_state = false, 33 | last_RMB_state = false, 34 | last_pressed_button = false, 35 | 36 | -- Function to read and reset the mousewheel info 37 | mouse_wheel = 38 | function() 39 | local cur_scroll = gfx.mouse_wheel 40 | if cur_scroll ~= 0 then 41 | gfx.mouse_wheel = 0 42 | return cur_scroll 43 | else 44 | return false 45 | end 46 | end 47 | 48 | 49 | 50 | } 51 | 52 | return mouse 53 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Insert Random CC Events (For Selected Notes).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Insert Random CC Events (For Selected Notes) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2019-2-24) 16 | + Initial release 17 | --]] 18 | 19 | selected = true 20 | muted = false 21 | chan = 0 22 | 23 | function Main() 24 | local take=reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 25 | if take == nil then return end 26 | item = reaper.GetMediaItemTake_Item(take) 27 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 28 | local retval, userInputsCSV = reaper.GetUserInputs("Insert Random CC Events", 2, "CC Number,Range", "10,127") 29 | if not retval then return reaper.SN_FocusMIDIEditor() end 30 | local msg2, msg3 = userInputsCSV:match("(.*),(.*)") 31 | msg2, msg3 = tonumber(msg2), tonumber(msg3) 32 | 33 | for i = 0, notes-1 do 34 | retval, selected, muted, ppq, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 35 | if selected == true then 36 | reaper.MIDI_InsertCC(take, selected, muted, ppq, 0xB0, chan, msg2, math.random(msg3)) 37 | reaper.UpdateItemInProject(item) 38 | end 39 | i=i+1 40 | end 41 | reaper.UpdateArrange() 42 | end 43 | 44 | script_title = "Insert Random CC Events (For Selected Notes)" 45 | reaper.Undo_BeginBlock() 46 | Main() 47 | reaper.Undo_EndBlock(script_title, 0) 48 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Insert Random CC Events.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Insert Random CC Events 3 | * Instructions: Open a MIDI take in MIDI Editor. Position Edit Cursor, Run. 4 | * Version: 2.1 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v2.0 (2020-1-5) 16 | + Version update 17 | * v1.0 (2019-12-12) 18 | + Initial release 19 | --]] 20 | 21 | selected = false 22 | 23 | local retval, userInputsCSV = reaper.GetUserInputs("Insert Random CC Events", 4, "CC Number,CC Events,Repetition,Interval", "11,8,4,240") 24 | if not retval then return reaper.SN_FocusMIDIEditor() end 25 | local cc_num, cc_event, cishu, jiange = userInputsCSV:match("(.*),(.*),(.*),(.*)") 26 | cc_num, cc_event, cishu, jiange = tonumber(cc_num), tonumber(cc_event), tonumber(cishu), tonumber(jiange) 27 | 28 | function Main() 29 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 30 | local pos = reaper.GetCursorPositionEx(0) 31 | local ppq = reaper.MIDI_GetPPQPosFromProjTime(take, pos) 32 | local x = 127 33 | ppq = ppq - jiange 34 | for i = 1, cishu do 35 | for i = 1, cc_event do 36 | ppq = ppq + jiange 37 | reaper.MIDI_InsertCC(take, selected, false, ppq, 0xB0, 0, cc_num, math.random(x)) 38 | i=i+1 39 | end 40 | end 41 | reaper.UpdateArrange() 42 | reaper.MIDI_Sort(take) 43 | end 44 | 45 | reaper.Undo_BeginBlock() 46 | Main() 47 | reaper.UpdateArrange() 48 | reaper.Undo_EndBlock("Insert Random CC Events", 0) 49 | reaper.SN_FocusMIDIEditor() 50 | -------------------------------------------------------------------------------- /Various/SFX Tag Search/lib/config-thesaurus-default.ini: -------------------------------------------------------------------------------- 1 | ; @noindex 2 | [files] 3 | sfx_tag_data_file=ratings-thesaurus.ini 4 | keywords_csv_file=keywords_thesaurus.csv 5 | [gui] 6 | ; Visual settings 7 | default_theme=imgui ; default theme, options: default, imgui, n0ne (设置主题, 可选项: default, imgui, n0ne) 8 | default_font=Calibri ; default font, options: Calibri, Microsoft YaHei, SimSun, STSong, STFangsong, ... (默认字体, 可选项: Calibri, 微软雅黑, SimSun, 华文宋体, 华文仿宋, ...) 9 | default_font_size=18 ; default font size (默认字体大小) 10 | font_size_adjustment=5 ; baseline offset for font size (字体大小的基线偏移) 11 | max_results=0 ; total number of results in the list, 0=unlimited (列表中结果的总数 0=不限) 12 | window_width=300 13 | window_height=600 14 | window_x=100 15 | window_y=100 16 | window_dock_state=0 17 | gui_size=20 ; The size ot the text, everything will scale accordingly (控件单位大小, 所有控件大小以此为基准) 18 | window_save_state=true ; remeber where the window was last time (关闭时记住窗口位置) 19 | cursor_focus_style=1 ; 0=Border 1=Fill (0=边框 1=填充) 20 | [color] 21 | ; Set highlight color for categories (为分类设置高亮颜色) 22 | color_row_highlight_01=null ; Grayish (霾蓝) 23 | color_row_highlight_02=null ; Yellowish (柳黄) 24 | color_row_highlight_03=null ; Blueish (碧蓝) 25 | color_row_highlight_04=null ; Greenish (苔绿) 26 | color_row_highlight_05=null ; Reddish (梅红) 27 | color_row_highlight_06=null ; Purplish (藤紫) 28 | color_row_highlight_07=null ; Tealish (鸭绿) 29 | color_row_highlight_08=null ; Rosish (蔷薇) 30 | color_row_highlight_09=null ; Orangish (橘红) 31 | color_row_highlight_10=null ; Brownish (褐黄) 32 | [misc] 33 | filter_name=true ; filter by Thesaurus (是否过滤同义词) 34 | filter_notes=false ; filter by Notes (是否过滤备注) 35 | filter_category=true ; filter by Category (是否过滤类别) 36 | english_first=false ; english first (是否英文优先) 37 | update_ratings=false ; use rankings (是否使用排行) 38 | [tag] 39 | show_notes=false 40 | -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Equal Cut.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Equal Cut 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2021-5-22) 14 | + Initial release 15 | --]] 16 | 17 | reaper.PreventUIRefresh(1) 18 | reaper.Undo_BeginBlock() 19 | local count_sel_items = reaper.CountSelectedMediaItems(0) 20 | if count_sel_items == 0 then return end 21 | 22 | reaper.ClearConsole() 23 | local cur_pos = reaper.GetCursorPosition() 24 | local sel_item = reaper.GetSelectedMediaItem(0, 0) 25 | if sel_item == nil then return end 26 | 27 | local retval, retvals_csv = reaper.GetUserInputs('Equal Cut', 1, 'Length (seconds):', '') 28 | if not retval or not tonumber(retvals_csv) then return end 29 | 30 | local item_start = reaper.GetMediaItemInfo_Value(sel_item, "D_POSITION") 31 | local item_len = reaper.GetMediaItemInfo_Value(sel_item, "D_LENGTH") 32 | local multi_cut = retvals_csv+item_start 33 | if multi_cut <= item_start then return end 34 | 35 | local cuts_len = multi_cut-item_start 36 | local num_cuts = math.floor(item_len/cuts_len) 37 | reaper.SetEditCurPos(multi_cut, 0, 0) 38 | 39 | for i = 0, num_cuts do 40 | reaper.Main_OnCommand(40012, 0) -- Item: Split items at edit or play cursor 41 | sel_item = reaper.GetSelectedMediaItem(0, 0) 42 | item_start = reaper.GetMediaItemInfo_Value(sel_item, "D_POSITION") 43 | reaper.SetEditCurPos(item_start+cuts_len, 0, 0) 44 | end 45 | reaper.SetEditCurPos(cur_pos, 0, 0) 46 | reaper.SelectAllMediaItems(0, 0) 47 | reaper.Undo_EndBlock('Equal Cut', -1) 48 | reaper.PreventUIRefresh(-1) 49 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Interval.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Interval 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2020-11-1) 14 | + Initial release 15 | --]] 16 | 17 | function Msg(param) 18 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 19 | end 20 | 21 | local script_title = "Interval" 22 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 23 | local _, notecnt, _, _ = reaper.MIDI_CountEvts(take) 24 | local value = reaper.GetExtState("Interval", "Value") 25 | if (value == "") then value = "7" end 26 | user_ok, value = reaper.GetUserInputs("Interval", 1, "Enter a semitone", value) 27 | if not user_ok or not tonumber(value) then return reaper.SN_FocusMIDIEditor() end 28 | value = tonumber(value) 29 | reaper.SetExtState("Interval", "Value", value, false) 30 | 31 | reaper.Undo_BeginBlock() -- 撤銷塊開始 32 | 33 | local note = {} 34 | for i = 1, notecnt do 35 | note[i] = {} 36 | note[i].ret, note[i].sel, note[i].muted, note[i].startppqpos, note[i].endppqpos, note[i].chan, note[i].pitch, note[i].vel = reaper.MIDI_GetNote(take, i - 1) 37 | end 38 | 39 | for i = 1, notecnt do 40 | if note[i].sel then 41 | note[i].pitch = note[i].pitch + value 42 | if note[i].pitch < 127 and note[i].pitch > 0 then 43 | reaper.MIDI_InsertNote(take, note[i].sel, note[i].muted, note[i].startppqpos, note[i].endppqpos, note[i].chan, note[i].pitch, note[i].vel, false) 44 | end 45 | end 46 | end 47 | 48 | reaper.Undo_EndBlock(script_title, -1) -- 撤銷塊結束 49 | reaper.UpdateArrange() -- 更新排列 50 | reaper.SN_FocusMIDIEditor() -- 聚焦MIDI編輯器 -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Move Selected Items.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Move Selected Items 3 | * Version: 1.0.1 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-3-15) 15 | + Initial release 16 | --]] 17 | 18 | function main() 19 | reaper.PreventUIRefresh(1) 20 | reaper.Undo_BeginBlock() 21 | count_sel_items = reaper.CountSelectedMediaItems(0) 22 | if count_sel_items == 0 then return end 23 | interval = reaper.GetExtState("MoveSelectedItems", "Tick") 24 | if (interval == "") then interval = "10" end 25 | userOK, interval = reaper.GetUserInputs("Move Selected Items", 1, "Enter A Tick", interval) 26 | if not userOK then return end 27 | reaper.SetExtState("MoveSelectedItems", "Tick", interval, false) 28 | midi_tick = reaper.SNM_GetIntConfigVar("MidiTicksPerBeat", 480) 29 | for i = 1, count_sel_items do 30 | item = reaper.GetSelectedMediaItem(0, count_sel_items - i) 31 | track = reaper.GetMediaItem_Track(item) 32 | item_id = reaper.GetMediaItemInfo_Value(item, "IP_ITEMNUMBER") 33 | item_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") 34 | qn_item_pos = reaper.TimeMap2_timeToQN(0, item_pos) 35 | ppq_item_pos = math.floor(qn_item_pos * midi_tick + 0.5) -- 获得item的tick位置 36 | new_ppq_item_pos = ppq_item_pos + interval 37 | new_qn_item_pos = new_ppq_item_pos / midi_tick 38 | new_item_pos = reaper.TimeMap2_QNToTime(0, new_qn_item_pos) 39 | reaper.SetMediaItemInfo_Value(item, "D_POSITION", new_item_pos) 40 | end 41 | reaper.Undo_EndBlock("Move Selected Items", -1) 42 | reaper.PreventUIRefresh(-1) 43 | reaper.UpdateArrange() 44 | end 45 | main() 46 | -------------------------------------------------------------------------------- /MIDI Event List Editor/zaibuyidao_Insert NRPN.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Insert NRPN 3 | * Version: 2.5 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2019-12-12) 14 | + Initial release 15 | --]] 16 | 17 | interval = 10 18 | 19 | function NonRegParm() 20 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 21 | local curpos = reaper.GetCursorPositionEx() 22 | local curppq = reaper.MIDI_GetPPQPosFromProjTime(take, curpos) 23 | 24 | local LSB = reaper.GetExtState("InsertNRPN", "LSB") 25 | local MSB = reaper.GetExtState("InsertNRPN", "MSB") 26 | if (LSB == "") then LSB = "0" end 27 | if (MSB == "") then MSB = "64" end 28 | 29 | local user_ok, user_input_CSV = reaper.GetUserInputs("Insert NRPN", 2, "98-NRPN,6-Data Entry", LSB .. ',' .. MSB) 30 | if not user_ok then return reaper.SN_FocusMIDIEditor() end 31 | LSB, MSB = user_input_CSV:match("(.*),(.*)") 32 | if not tonumber(LSB) or not tonumber(MSB) then return reaper.SN_FocusMIDIEditor() end 33 | 34 | reaper.SetExtState("InsertNRPN", "LSB", LSB, false) 35 | reaper.SetExtState("InsertNRPN", "MSB", MSB, false) 36 | 37 | reaper.MIDI_SelectAll(take, false) -- 取消選擇所有MIDI內容 38 | reaper.MIDI_InsertCC(take, false, false, curppq + interval, 0xB0, 0, 98, LSB) 39 | reaper.MIDI_InsertCC(take, true, false, curppq + interval * 2, 0xB0, 0, 6, MSB) 40 | reaper.SetEditCurPos(reaper.MIDI_GetProjTimeFromPPQPos(take, curppq + interval * 2), true, true) 41 | end 42 | 43 | reaper.Undo_BeginBlock() 44 | NonRegParm() 45 | reaper.Undo_EndBlock("Insert NRPN", -1) 46 | reaper.UpdateArrange() 47 | reaper.SN_FocusMIDIEditor() 48 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Slide +01.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Slide +01 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Events. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * provides: [main=midi_editor,midi_eventlisteditor] . 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2020-9-16) 16 | + Initial release 17 | --]] 18 | 19 | local j = 1 20 | 21 | local take=reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 22 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 23 | 24 | function Notes() 25 | for i = 0, notes-1 do 26 | retval, sel, muted, ppq_start, ppq_end, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 27 | if sel == true then 28 | reaper.MIDI_SetNote(take, i, sel, muted, ppq_start+j, ppq_end+j, chan, pitch, vel, false) 29 | end 30 | i=i+1 31 | end 32 | end 33 | 34 | function CCs() 35 | for i = 0, ccs-1 do 36 | retval, sel, muted, cc_ppq, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 37 | if sel == true then 38 | reaper.MIDI_SetCC(take, i, sel, muted, cc_ppq+j, chanmsgIn, chanIn, msg2In, msg3In, false) 39 | end 40 | i=i+1 41 | end 42 | end 43 | 44 | function SYSEX() 45 | for i = 0, sysex-1 do 46 | retval, sel, muted, ppqpos, type, msg = reaper.MIDI_GetTextSysexEvt(take, i) 47 | if sel == true then 48 | reaper.MIDI_SetTextSysexEvt(take, i, sel, muted, ppqpos+j, type, msg, false) 49 | end 50 | i=i+1 51 | end 52 | end 53 | 54 | script_title = "Slide +01" 55 | reaper.Undo_BeginBlock() 56 | reaper.MIDI_DisableSort(take) 57 | Notes() 58 | CCs() 59 | SYSEX() 60 | reaper.UpdateArrange() 61 | reaper.MIDI_Sort(take) 62 | reaper.Undo_EndBlock(script_title, 0) 63 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Slide -01.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Slide -01 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Events. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * provides: [main=midi_editor,midi_eventlisteditor] . 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2020-9-16) 16 | + Initial release 17 | --]] 18 | 19 | local j = -1 20 | 21 | local take=reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 22 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 23 | 24 | function Notes() 25 | for i = 0, notes-1 do 26 | retval, sel, muted, ppq_start, ppq_end, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 27 | if sel == true then 28 | reaper.MIDI_SetNote(take, i, sel, muted, ppq_start+j, ppq_end+j, chan, pitch, vel, false) 29 | end 30 | i=i+1 31 | end 32 | end 33 | 34 | function CCs() 35 | for i = 0, ccs-1 do 36 | retval, sel, muted, cc_ppq, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 37 | if sel == true then 38 | reaper.MIDI_SetCC(take, i, sel, muted, cc_ppq+j, chanmsgIn, chanIn, msg2In, msg3In, false) 39 | end 40 | i=i+1 41 | end 42 | end 43 | 44 | function SYSEX() 45 | for i = 0, sysex-1 do 46 | retval, sel, muted, ppqpos, type, msg = reaper.MIDI_GetTextSysexEvt(take, i) 47 | if sel == true then 48 | reaper.MIDI_SetTextSysexEvt(take, i, sel, muted, ppqpos+j, type, msg, false) 49 | end 50 | i=i+1 51 | end 52 | end 53 | 54 | script_title = "Slide -01" 55 | reaper.Undo_BeginBlock() 56 | reaper.MIDI_DisableSort(take) 57 | Notes() 58 | CCs() 59 | SYSEX() 60 | reaper.UpdateArrange() 61 | reaper.MIDI_Sort(take) 62 | reaper.Undo_EndBlock(script_title, 0) 63 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /Utility/zaibuyidao_Cakewalk Style Cursor Follow (Main).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Cakewalk Style Cursor Follow (Main) 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 7 | * Donation: http://www.paypal.me/zaibuyidao 8 | * provides: [main=main] . 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2022-6-30) 14 | + Initial release 15 | --]] 16 | 17 | function print(string) 18 | reaper.ShowConsoleMsg(tostring(string)..'\n') 19 | end 20 | 21 | flag = false 22 | 23 | function main() 24 | isPlay = reaper.GetPlayState() 25 | if isPlay == 0 then 26 | if flag == false then 27 | reaper.Main_OnCommand(39513, 0) -- Set default mouse modifier action for "Media item left click" to "Select item and move edit cursor" (factory default) 28 | reaper.Main_OnCommand(39577, 0) -- Set default mouse modifier action for "Track left click" to "Deselect all items and move edit cursor" (factory default) 29 | flag = true 30 | end 31 | elseif isPlay == 1 then 32 | if flag == true then 33 | reaper.Main_OnCommand(39579, 0) -- Set default mouse modifier action for "Track left click" to "Deselect all items" 34 | reaper.Main_OnCommand(39515, 0) -- Set default mouse modifier action for "Media item left click" to "Select item" 35 | flag = false 36 | end 37 | end 38 | reaper.defer(main) 39 | end 40 | 41 | local _, _, sectionId, cmdId = reaper.get_action_context() 42 | if sectionId ~= -1 then 43 | reaper.SetToggleCommandState(sectionId, cmdId, 1) 44 | reaper.RefreshToolbar2(sectionId, cmdId) 45 | main() 46 | reaper.atexit(function() 47 | reaper.SetToggleCommandState(sectionId, cmdId, 0) 48 | reaper.RefreshToolbar2(sectionId, cmdId) 49 | end) 50 | end 51 | 52 | reaper.defer(function() end) -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Select Note With The Same Channel (Under Mouse).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Select Note With The Same Channel (Under Mouse) 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-6-7) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) reaper.ShowConsoleMsg(tostring(param) .. "\n") end 19 | take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 20 | _, _, _ = reaper.BR_GetMouseCursorContext() 21 | _, _, note_row, _, _, _ = reaper.BR_GetMouseCursorContext_MIDI() -- 获得鼠标下的音高 22 | mouse_ppq_pos = reaper.MIDI_GetPPQPosFromProjTime(take, reaper.BR_GetMouseCursorContext_Position()) -- 获得鼠标的位置并将工程时间转换为PPQ 23 | _, notecnt, _, _ = reaper.MIDI_CountEvts(take) 24 | reaper.MIDI_DisableSort(take) 25 | reaper.Undo_BeginBlock() 26 | idx = {} -- 将鼠标悬停的音符的chan存入表中 27 | for i = 1, notecnt do 28 | _, sel, _, startppqpos, endppqpos, chan, pitch, _ = reaper.MIDI_GetNote(take, i - 1) 29 | if startppqpos < mouse_ppq_pos and endppqpos > mouse_ppq_pos and note_row == pitch then -- 如果音符在鼠标下 30 | table.insert(idx, chan) -- --idx[#idx+1] = notelen 31 | end 32 | end 33 | for k, v in ipairs(idx) do -- 删除表格中的nil值,只保留鼠标悬停的音符的chan值 34 | if v == nil then 35 | table.remove(idx, k) 36 | end 37 | end 38 | for i = 1, notecnt do 39 | retval, sel, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i - 1) 40 | if chan == idx[1] then 41 | reaper.MIDI_SetNote(take, i - 1, true, nil, nil, nil, nil, nil, nil, false) 42 | end 43 | end 44 | reaper.Undo_EndBlock("Select Note With The Same Channel (Under Mouse)", 0) 45 | reaper.MIDI_Sort(take) 46 | reaper.UpdateArrange() 47 | reaper.SN_FocusMIDIEditor() 48 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Slide +10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Slide +10 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Events. Run. 4 | * Version: 1.1 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | * provides: [main=midi_editor,midi_eventlisteditor] . 12 | --]] 13 | 14 | --[[ 15 | * Changelog: 16 | * v1.0 (2020-1-27) 17 | + Initial release 18 | --]] 19 | 20 | local j = 10 21 | 22 | local take=reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 23 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 24 | 25 | function Notes() 26 | for i = 0, notes-1 do 27 | retval, sel, muted, ppq_start, ppq_end, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 28 | if sel == true then 29 | reaper.MIDI_SetNote(take, i, sel, muted, ppq_start+j, ppq_end+j, chan, pitch, vel, false) 30 | end 31 | i=i+1 32 | end 33 | end 34 | 35 | function CCs() 36 | for i = 0, ccs-1 do 37 | retval, sel, muted, cc_ppq, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 38 | if sel == true then 39 | reaper.MIDI_SetCC(take, i, sel, muted, cc_ppq+j, chanmsgIn, chanIn, msg2In, msg3In, false) 40 | end 41 | i=i+1 42 | end 43 | end 44 | 45 | function SYSEX() 46 | for i = 0, sysex-1 do 47 | retval, sel, muted, ppqpos, type, msg = reaper.MIDI_GetTextSysexEvt(take, i) 48 | if sel == true then 49 | reaper.MIDI_SetTextSysexEvt(take, i, sel, muted, ppqpos+j, type, msg, false) 50 | end 51 | i=i+1 52 | end 53 | end 54 | 55 | script_title = "Slide +10" 56 | reaper.Undo_BeginBlock() 57 | reaper.MIDI_DisableSort(take) 58 | Notes() 59 | CCs() 60 | SYSEX() 61 | reaper.UpdateArrange() 62 | reaper.MIDI_Sort(take) 63 | reaper.Undo_EndBlock(script_title, 0) 64 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Slide -10.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Slide -10 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Events. Run. 4 | * Version: 1.1 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | * provides: [main=midi_editor,midi_eventlisteditor] . 12 | --]] 13 | 14 | --[[ 15 | * Changelog: 16 | * v1.0 (2020-1-27) 17 | + Initial release 18 | --]] 19 | 20 | local j = -10 21 | 22 | local take=reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 23 | retval, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 24 | 25 | function Notes() 26 | for i = 0, notes-1 do 27 | retval, sel, muted, ppq_start, ppq_end, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 28 | if sel == true then 29 | reaper.MIDI_SetNote(take, i, sel, muted, ppq_start+j, ppq_end+j, chan, pitch, vel, false) 30 | end 31 | i=i+1 32 | end 33 | end 34 | 35 | function CCs() 36 | for i = 0, ccs-1 do 37 | retval, sel, muted, cc_ppq, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 38 | if sel == true then 39 | reaper.MIDI_SetCC(take, i, sel, muted, cc_ppq+j, chanmsgIn, chanIn, msg2In, msg3In, false) 40 | end 41 | i=i+1 42 | end 43 | end 44 | 45 | function SYSEX() 46 | for i = 0, sysex-1 do 47 | retval, sel, muted, ppqpos, type, msg = reaper.MIDI_GetTextSysexEvt(take, i) 48 | if sel == true then 49 | reaper.MIDI_SetTextSysexEvt(take, i, sel, muted, ppqpos+j, type, msg, false) 50 | end 51 | i=i+1 52 | end 53 | end 54 | 55 | script_title = "Slide -10" 56 | reaper.Undo_BeginBlock() 57 | reaper.MIDI_DisableSort(take) 58 | Notes() 59 | CCs() 60 | SYSEX() 61 | reaper.UpdateArrange() 62 | reaper.MIDI_Sort(take) 63 | reaper.Undo_EndBlock(script_title, 0) 64 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /Various/SFX Tag Search/lib/config-database-default.ini: -------------------------------------------------------------------------------- 1 | ; @noindex 2 | [files] 3 | sfx_tag_data_file=ratings-database.ini 4 | keywords_csv_file=keywords_database.csv 5 | [gui] 6 | ; Visual settings 7 | default_theme=imgui ; default theme, options: default, imgui, n0ne (设置主题, 可选项: default, imgui, n0ne) 8 | default_font=Calibri ; default font, options: Calibri, Microsoft YaHei, SimSun, STSong, STFangsong, ... (默认字体, 可选项: Calibri, 微软雅黑, SimSun, 华文宋体, 华文仿宋, ...) 9 | default_font_size=18 ; default font size (默认字体大小) 10 | font_size_adjustment=5 ; baseline offset for font size (字体大小的基线偏移) 11 | max_results=0 ; total number of results in the list, 0=unlimited (列表中结果的总数 0=不限) 12 | window_width=300 13 | window_height=600 14 | window_x=100 15 | window_y=100 16 | window_dock_state=0 17 | gui_size=20 ; The size ot the text, everything will scale accordingly (控件单位大小, 所有控件大小以此为基准) 18 | window_save_state=true ; remeber where the window was last time (关闭时记住窗口位置) 19 | cursor_focus_style=1 ; 0=Border 1=Fill (0=边框 1=填充) 20 | [color] 21 | ; Set highlight color for categories (为分类设置高亮颜色) 22 | color_row_highlight_01=null ; Grayish (霾蓝) 23 | color_row_highlight_02=null ; Yellowish (柳黄) 24 | color_row_highlight_03=null ; Blueish (碧蓝) 25 | color_row_highlight_04=null ; Greenish (苔绿) 26 | color_row_highlight_05=null ; Reddish (梅红) 27 | color_row_highlight_06=null ; Purplish (藤紫) 28 | color_row_highlight_07=null ; Tealish (鸭绿) 29 | color_row_highlight_08=null ; Rosish (蔷薇) 30 | color_row_highlight_09=null ; Orangish (橘红) 31 | color_row_highlight_10=null ; Brownish (褐黄) 32 | [misc] 33 | filter_name=true ; filter by name (是否过滤名称) 34 | filter_alias=true ; filter by alias (是否过滤别名) 35 | filter_category=false ; filter by category (是否过滤类别) 36 | english_first=false ; english list first (是否英文优先) 37 | update_ratings=false ; use rankings (是否使用排行) 38 | [category_by_prefix_enable] 39 | category_by_prefix_enable=true 40 | [category_by_prefix] 41 | default_category_name=DATABASE 42 | type_prefix=GP: 43 | category_name=GROUP 44 | type_prefix=FD: 45 | category_name=FOLDER 46 | type_prefix=MG: 47 | category_name=MAGIC 48 | -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Copy Align Item Position.lua: -------------------------------------------------------------------------------- 1 | -- @description Copy Align Item Position 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- + New Script 6 | -- @links 7 | -- webpage https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- repo https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | function print(...) 13 | for _, v in ipairs({...}) do 14 | reaper.ShowConsoleMsg(tostring(v) .. " ") 15 | end 16 | reaper.ShowConsoleMsg("\n") 17 | end 18 | 19 | function table.serialize(obj) 20 | local lua = "" 21 | local t = type(obj) 22 | if t == "number" then 23 | lua = lua .. obj 24 | elseif t == "boolean" then 25 | lua = lua .. tostring(obj) 26 | elseif t == "string" then 27 | lua = lua .. string.format("%q", obj) 28 | elseif t == "table" then 29 | lua = lua .. "{\n" 30 | for k, v in pairs(obj) do 31 | lua = lua .. "[" .. table.serialize(k) .. "]=" .. table.serialize(v) .. ",\n" 32 | end 33 | local metatable = getmetatable(obj) 34 | if metatable ~= nil and type(metatable.__index) == "table" then 35 | for k, v in pairs(metatable.__index) do 36 | lua = lua .. "[" .. table.serialize(k) .. "]=" .. table.serialize(v) .. ",\n" 37 | end 38 | end 39 | lua = lua .. "}" 40 | elseif t == "nil" then 41 | return nil 42 | else 43 | error("can not serialize a " .. t .. " type.") 44 | end 45 | return lua 46 | end 47 | 48 | reaper.Undo_BeginBlock() 49 | 50 | local startT = {} 51 | CountSelectedItems = reaper.CountSelectedMediaItems(0) 52 | for i = 0, CountSelectedItems - 1 do 53 | local item = reaper.GetSelectedMediaItem(0, i) 54 | local take = reaper.GetActiveTake(item) 55 | itemStart = reaper.GetMediaItemInfo_Value(item, "D_POSITION") 56 | table.insert(startT, itemStart) 57 | end 58 | 59 | local EXT_SECTION = 'COPY_ITEM_POSITION' 60 | reaper.SetExtState(EXT_SECTION, "Position", table.serialize(startT), false) 61 | reaper.Undo_EndBlock("Copy Align Item Position", -1) -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Time (QN).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Time (QN) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.2 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | * provides: [main=midi_editor,midi_eventlisteditor] . 12 | --]] 13 | 14 | --[[ 15 | * Changelog: 16 | * v1.0 (2020-2-1) 17 | + Initial release 18 | --]] 19 | 20 | function Main() 21 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 22 | local tick = reaper.SNM_GetIntConfigVar("MidiTicksPerBeat", 480) 23 | local cur_pos = reaper.GetCursorPositionEx() 24 | local qn = reaper.TimeMap2_timeToQN(0, cur_pos) 25 | local ppqpos = reaper.MIDI_GetPPQPosFromProjQN(take, qn) 26 | local _, measures, _, _, _ = reaper.TimeMap2_timeToBeats(0, cur_pos) 27 | local start_meas = reaper.MIDI_GetPPQPos_StartOfMeasure(take, ppqpos) 28 | local start_beat = (ppqpos - start_meas) / tick 29 | local num_01, num_02 = math.modf(start_beat) 30 | num_01 = num_01 + 1 31 | num_02 = num_02 32 | num_add = num_01 + num_02 33 | measures = measures + 1 34 | local cur_range = tostring(measures)..','..tostring(num_add) 35 | local OK, get_input = reaper.GetUserInputs("Go", 2, "Measure,Beat", cur_range) 36 | if not OK then return reaper.SN_FocusMIDIEditor() end 37 | measure, beat = get_input:match("(.*),(.*)") 38 | if not measure:match('[%d%.]+') or not beat:match('[%d%.]+') then return reaper.SN_FocusMIDIEditor() end 39 | measure, beat = tonumber(measure), tonumber(beat) 40 | local x = measure - 1 41 | local z = beat - 1 42 | reaper.SetEditCurPos(reaper.TimeMap2_beatsToTime(0, z, x), true, true) 43 | end 44 | 45 | script_title = "Time (QN)" 46 | reaper.Undo_BeginBlock() 47 | Main() 48 | reaper.Undo_EndBlock(script_title, 0) 49 | reaper.SN_FocusMIDIEditor() 50 | -------------------------------------------------------------------------------- /Various/SFX Tag Search/lib/LIP.lua: -------------------------------------------------------------------------------- 1 | -- NoIndex: true 2 | local LIP = {}; 3 | 4 | --- Returns a table containing all the data from the INI file. 5 | --@param fileName The name of the INI file to parse. [string] 6 | --@return The table containing all data from the INI file. [table] 7 | function LIP.load(fileName) 8 | assert(type(fileName) == 'string', 'Parameter "fileName" must be a string.'); 9 | local file = assert(io.open(fileName, 'r'), 'Error loading file : ' .. fileName); 10 | local data = {}; 11 | local section; 12 | for line in file:lines() do 13 | local tempSection = line:match('^%[([^%[%]]+)%]$'); 14 | if(tempSection)then 15 | section = tonumber(tempSection) and tonumber(tempSection) or tempSection; 16 | data[section] = data[section] or {}; 17 | end 18 | local param, value = line:match('^([%w|_]+)%s-=%s-(.+)$'); 19 | if(param and value ~= nil)then 20 | if(tonumber(value))then 21 | value = tonumber(value); 22 | elseif(value == 'true')then 23 | value = true; 24 | elseif(value == 'false')then 25 | value = false; 26 | end 27 | if(tonumber(param))then 28 | param = tonumber(param); 29 | end 30 | data[section][param] = value; 31 | end 32 | end 33 | file:close(); 34 | return data; 35 | end 36 | 37 | --- Saves all the data from a table to an INI file. 38 | --@param fileName The name of the INI file to fill. [string] 39 | --@param data The table containing all the data to store. [table] 40 | function LIP.save(fileName, data) 41 | assert(type(fileName) == 'string', 'Parameter "fileName" must be a string.'); 42 | assert(type(data) == 'table', 'Parameter "data" must be a table.'); 43 | local file = assert(io.open(fileName, 'w+b'), 'Error loading file :' .. fileName); 44 | local contents = ''; 45 | for section, param in pairs(data) do 46 | contents = contents .. ('[%s]\n'):format(section); 47 | for key, value in pairs(param) do 48 | contents = contents .. ('%s=%s\n'):format(key, tostring(value)); 49 | end 50 | contents = contents .. '\n'; 51 | end 52 | file:write(contents); 53 | file:close(); 54 | end 55 | 56 | return LIP; -------------------------------------------------------------------------------- /Regions/zaibuyidao_Randomize Region Colors.lua: -------------------------------------------------------------------------------- 1 | -- @description Randomize Region Colors 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | function Msg(param) reaper.ShowConsoleMsg(tostring(param) .. "\n") end 13 | 14 | function RegionRGB() 15 | local R = math.random(256) - 1 16 | local G = math.random(256) - 1 17 | local B = math.random(256) - 1 18 | return R, G, B 19 | end 20 | 21 | function RGBHexToDec(R, G, B) 22 | local red = string.format("%x", R) 23 | local green = string.format("%x", G) 24 | local blue = string.format("%x", B) 25 | if (#red < 2) then red = "0" .. red end 26 | if (#green < 2) then green = "0" .. green end 27 | if (#blue < 2) then blue = "0" .. blue end 28 | local color = "01" .. blue .. green .. red 29 | return tonumber(color, 16) 30 | end 31 | 32 | function Main() 33 | local marker_ok, num_markers, num_regions = reaper.CountProjectMarkers(0) 34 | if marker_ok and (num_markers or num_regions ~= 0) then 35 | for i = 1, num_markers + num_regions do 36 | local retval, isrgn, pos, rgnend, name, markrgnindexnumber, color = reaper.EnumProjectMarkers3(0, i - 1) 37 | if retval ~= nil then 38 | local region = {} 39 | region.pos = pos 40 | region.name = name 41 | region.rgnend = rgnend 42 | region.idx = markrgnindexnumber 43 | region.color = RGBHexToDec(RegionRGB()) 44 | if isrgn == true then 45 | reaper.SetProjectMarker3(0, region.idx, isrgn, region.pos, region.rgnend, region.name, region.color) 46 | end 47 | end 48 | end 49 | end 50 | end 51 | reaper.Undo_BeginBlock() 52 | Main() 53 | reaper.Undo_EndBlock("Randomize Region Colors", -1) 54 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Various/SFX Tag Search/req/j_trackstatechunk_functions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | @author n0ne 3 | @version 0.7.0 4 | @noindex 5 | --]] 6 | 7 | require ('REQ.j_string_functions') 8 | require ('REQ.j_tables') 9 | local STR_FX_CHAIN = "") then 37 | depth = depth - 1 38 | end 39 | 40 | if depth == 0 then 41 | -- msg("found closing bracket at line: ".. i) 42 | break 43 | end 44 | i = i + 1 45 | end 46 | 47 | local newChunk = "" 48 | for k, v in ipairs(lines) do 49 | if k == i then 50 | -- msg("<-------- insert fx") 51 | newChunk = newChunk .. "\n" .. strFxChain 52 | end 53 | newChunk = newChunk .. "\n" .. v 54 | -- msg(k .. ": " .. v) 55 | end 56 | 57 | t:setStateChunk(newChunk) 58 | -- msg(t:getStateChunk()) 59 | end 60 | 61 | function jCreateTrackChainForSelectedTracks() 62 | -- This is a hacky function to create empty FX chains for selected tracks, but its a lot easier than messing with the state chunk 63 | reaper.Main_OnCommandEx(reaper.NamedCommandLookup("_S&M_SHOWFXCHAINSEL"),1,0) -- SWS/S&M: Show FX chain for selected tracks (selected FX) 64 | reaper.Main_OnCommandEx(reaper.NamedCommandLookup("_S&M_HIDEFXCHAIN"),1,0) -- SWS/S&M: Hide FX chain windows for selected tracks 65 | end -------------------------------------------------------------------------------- /Utility/zaibuyidao_Cakewalk Style Cursor Follow (MIDI Editor).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Cakewalk Style Cursor Follow (MIDI Editor) 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 7 | * Donation: http://www.paypal.me/zaibuyidao 8 | * provides: [main=midi_editor] . 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2022-6-30) 14 | + Initial release 15 | --]] 16 | 17 | function print(string) 18 | reaper.ShowConsoleMsg(tostring(string)..'\n') 19 | end 20 | 21 | flag = false 22 | 23 | function main() 24 | HWND = reaper.MIDIEditor_GetActive() 25 | isPlay = reaper.GetPlayState() 26 | if isPlay == 0 then 27 | if flag == false then 28 | reaper.MIDIEditor_OnCommand(HWND, 39705) -- Set default mouse modifier action for "MIDI piano roll left click" to "Deselect all notes and move edit cursor" (factory default) 29 | reaper.MIDIEditor_OnCommand(HWND, 39674) -- Set default mouse modifier action for "MIDI note left click" to "Select note and move edit cursor" (factory default) 30 | flag = true 31 | end 32 | elseif isPlay == 1 then 33 | if flag == true then 34 | reaper.MIDIEditor_OnCommand(HWND, 39707) -- Set default mouse modifier action for "MIDI piano roll left click" to "Deselect all notes" 35 | reaper.MIDIEditor_OnCommand(HWND, 39673) -- Set default mouse modifier action for "MIDI note left click" to "Select note" 36 | flag = false 37 | end 38 | end 39 | reaper.defer(main) 40 | end 41 | 42 | local _, _, sectionId, cmdId = reaper.get_action_context() 43 | if sectionId ~= -1 then 44 | reaper.SetToggleCommandState(sectionId, cmdId, 1) 45 | reaper.RefreshToolbar2(sectionId, cmdId) 46 | main() 47 | reaper.atexit(function() 48 | reaper.SetToggleCommandState(sectionId, cmdId, 0) 49 | reaper.RefreshToolbar2(sectionId, cmdId) 50 | end) 51 | end 52 | 53 | reaper.defer(function() end) -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Insert Sustain Pedal.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Insert Sustain Pedal 3 | * Version: 1.6 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2019-12-12) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) 19 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 20 | end 21 | 22 | local cishu = reaper.GetExtState("InsertSustainPedal", "Cishu") 23 | if (cishu == "") then cishu = "99" end 24 | 25 | local retval, user_input_csv = reaper.GetUserInputs("Insert Sustain Pedal", 1, "Repetition", cishu) 26 | if not retval then return reaper.SN_FocusMIDIEditor() end 27 | cishu = user_input_csv:match("(.*)") 28 | cishu = tonumber(cishu) 29 | reaper.SetExtState("InsertSustainPedal", "Cishu", cishu, false) 30 | 31 | function HoldPedalOn() 32 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 33 | if take == nil then return end 34 | for i = 1, cishu do 35 | local cur_pos = reaper.GetCursorPositionEx() 36 | local cur_pos_ppq = reaper.MIDI_GetPPQPosFromProjTime(take, cur_pos) 37 | local cur_pos_qn = reaper.MIDI_GetProjQNFromPPQPos(take, cur_pos_ppq) 38 | local Meas, Bar_Start_QN, Bar_End_QN = reaper.TimeMap_QNToMeasures(0, cur_pos_qn) 39 | local new_Start_QN = reaper.MIDI_GetPPQPosFromProjQN(take, Bar_Start_QN) 40 | local new_End_QN = reaper.MIDI_GetPPQPosFromProjQN(take, Bar_End_QN) 41 | reaper.MIDI_InsertCC(take, selected, false, new_Start_QN+110, 0xB0, 0, 64, 127) --踩下 42 | reaper.MIDI_InsertCC(take, selected, false, new_End_QN-10, 0xB0, 0, 64, 0) --釋放 43 | reaper.MIDIEditor_OnCommand(reaper.MIDIEditor_GetActive(), 40451) --Navigate: Move edit cursor to start of next measure 44 | end 45 | end 46 | 47 | reaper.Undo_BeginBlock() 48 | selected = true 49 | HoldPedalOn() 50 | reaper.UpdateArrange() 51 | reaper.Undo_EndBlock("Insert Sustain Pedal", 0) 52 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Random Velocity (Customize).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random Velocity (Customize) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2020-5-4) 16 | + Initial release 17 | --]] 18 | 19 | -- USER AREA 20 | -- Settings that the user can customize. 21 | 22 | min_val = 1 23 | max_val = 96 24 | 25 | -- End of USER AREA 26 | 27 | function Main() 28 | take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 29 | _, notes, _, _ = reaper.MIDI_CountEvts(take) 30 | if min_val > 127 then 31 | min_val = 127 32 | elseif min_val < 1 then 33 | min_val = 1 34 | elseif max_val > 127 then 35 | max_val = 127 36 | elseif max_val < 1 then 37 | max_val = 1 38 | elseif min_val > max_val then 39 | local t = max_val 40 | max_val = min_val 41 | min_val = t 42 | end 43 | if min_val == max_val then 44 | return 45 | reaper.MB("Random interval is empty, please re-enter", "Error", 0), 46 | reaper.SN_FocusMIDIEditor() 47 | end 48 | local diff = max_val - min_val 49 | reaper.MIDI_DisableSort(take) 50 | for i = 0, notes - 1 do 51 | retval, sel, muted, ppq_start, ppq_end, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 52 | if sel == true then 53 | vel = tonumber(min_val + math.random(diff)) 54 | reaper.MIDI_SetNote(take, i, sel, muted, ppq_start, ppq_end, chan, pitch, vel, false) 55 | end 56 | i = i + 1 57 | end 58 | reaper.UpdateArrange() 59 | reaper.MIDI_Sort(take) 60 | end 61 | script_title = "Random Velocity" 62 | reaper.Undo_BeginBlock() 63 | Main() 64 | reaper.Undo_EndBlock(script_title, 0) 65 | reaper.SN_FocusMIDIEditor() 66 | -------------------------------------------------------------------------------- /JSFX/MIDI Bank Program on Specific Note.jsfx: -------------------------------------------------------------------------------- 1 | desc: MIDI Bank/Program on Specific Note (By zaibuyidao) 2 | version: 1.0 3 | changelog: init 4 | author: zaibuyidao 5 | links: 6 | webpage https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | github https://github.com/zaibuyidao/ReaScripts 8 | donate: http://www.paypal.me/zaibuyidao 9 | about: 10 | This script allows users to specify Bank and Program for a particular MIDI note. 11 | When the specified MIDI note is received, the script applies the corresponding Bank and Program settings to the MIDI output based on the predefined parameter settings. 12 | 13 | slider1:0<0,15,1{Any,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}>Input Channel: 14 | slider2:12<0,127,1>Trigger Note: 15 | slider3:0<0,127,1>Bank MSB: 16 | slider4:0<0,127,1>Bank LSB: 17 | slider5:0<0,127,1>Program: 18 | slider6:1<0,1,1{Off,On}>Trigger Sound: 19 | 20 | @init 21 | noteon_cnt = 0; 22 | 23 | @block 24 | while(midirecv(offset, msg1, msg2, msg3)) ( 25 | status = (msg1 & 0xF0); // Get the message type 26 | channel = (msg1 & 0x0F); // Get the MIDI channel 27 | 28 | // Check if the received channel matches the slider1 value or any channel 29 | (channel == (slider1 - 1)) || (slider1 == 0) ? ( 30 | // Check if it's a Note On message and velocity is not zero 31 | (status == 0x90 && msg3 != 0) ? ( 32 | noteon_cnt += 1; // Increment note-on count 33 | 34 | // Check if the note matches the trigger note 35 | (msg2 == slider2) ? ( 36 | midisend(offset, 0xB0, 0x00, slider3); // Send Bank Select MSB 37 | midisend(offset, 0xB0, 0x20, slider4); // Send Bank Select LSB 38 | midisend(offset, 0xC0, slider5, 0); // Send Program Change 39 | 40 | // If sound is enabled, send the note-on message 41 | (slider6 == 1) ? ( 42 | midisend(offset, msg1, msg2, msg3) 43 | ); 44 | ) : ( 45 | midisend(offset, msg1, msg2, msg3) // If it's not the trigger note, pass through the event 46 | ) 47 | ) : ( 48 | 49 | midisend(offset, msg1, msg2, msg3) // Pass through other MIDI events 50 | ) 51 | ); 52 | ); 53 | -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_List Names of Selected Items.lua: -------------------------------------------------------------------------------- 1 | -- @description List Names of Selected Items 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | local function Msg(str) 13 | reaper.ShowConsoleMsg(tostring(str).."\n") 14 | end 15 | 16 | reaper.PreventUIRefresh(1) 17 | count_sel_items = reaper.CountSelectedMediaItems(0) 18 | reaper.ClearConsole() 19 | 20 | local startEvents = {} 21 | 22 | for i = 0, count_sel_items - 1 do 23 | local item = reaper.GetSelectedMediaItem(0, i) 24 | local track = reaper.GetMediaItem_Track(item) 25 | local pitch = reaper.GetMediaTrackInfo_Value(track, 'IP_TRACKNUMBER') 26 | local startPos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") 27 | local take = reaper.GetActiveTake(item) 28 | local takeName = reaper.GetTakeName(take) 29 | if startEvents[startPos] == nil then startEvents[startPos] = {} end 30 | local event = { 31 | ["startPos"]=startPos, 32 | ["pitch"]=pitch, 33 | ["takeName"]=takeName, 34 | ["item"]=item 35 | } 36 | 37 | table.insert(startEvents[startPos], event) 38 | end 39 | 40 | local tempEvents = {} 41 | for i in pairs(startEvents) do 42 | table.insert(tempEvents,i) 43 | end 44 | table.sort(tempEvents,function(a,b)return (tonumber(a) < tonumber(b)) end) -- 對key進行升序 45 | 46 | local result = {} 47 | for i,v in pairs(tempEvents) do 48 | table.insert(result,startEvents[v]) 49 | end 50 | 51 | local taketake = {} 52 | local j = 0 53 | for _, list in pairs(result) do 54 | for i = 1, #list do 55 | j = j + 1 56 | take = reaper.GetActiveTake(list[i].item) 57 | name = reaper.GetTakeName(take) 58 | table.insert(taketake, name) 59 | end 60 | end 61 | 62 | k = tostring(count_sel_items) 63 | k = #k 64 | for i = 0, count_sel_items -1 do 65 | idx = i + 1 66 | idx = string.format("%0" .. k .. "d", idx) 67 | Msg('['..idx..'] '..taketake[i+1]) 68 | end 69 | Msg('') 70 | Msg('Total: '..count_sel_items) 71 | reaper.PreventUIRefresh(-1) 72 | reaper.UpdateArrange() 73 | reaper.defer(function() end) -------------------------------------------------------------------------------- /Markers/zaibuyidao_Random Marker Color.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random Marker Color 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 or newer recommended 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-5-5) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) reaper.ShowConsoleMsg(tostring(param) .. "\n") end 19 | 20 | function RegionRGB() 21 | local R = math.random(256) - 1 22 | local G = math.random(256) - 1 23 | local B = math.random(256) - 1 24 | return R, G, B 25 | end 26 | 27 | function RGBHexToDec(R, G, B) 28 | local red = string.format("%x", R) 29 | local green = string.format("%x", G) 30 | local blue = string.format("%x", B) 31 | if (#red < 2) then red = "0" .. red end 32 | if (#green < 2) then green = "0" .. green end 33 | if (#blue < 2) then blue = "0" .. blue end 34 | local color = "01" .. blue .. green .. red 35 | return tonumber(color, 16) 36 | end 37 | 38 | function Main() 39 | local marker_ok, num_markers, num_regions = reaper.CountProjectMarkers(0) 40 | if marker_ok and (num_markers or num_regions ~= 0) then 41 | reaper.Undo_BeginBlock() 42 | for i = 1, num_markers + num_regions do 43 | local retval, isrgn, pos, rgnend, name, markrgnindexnumber, color = reaper.EnumProjectMarkers3(0, i - 1) 44 | if retval ~= nil then 45 | local marker = {} 46 | marker.pos = pos 47 | marker.name = name 48 | marker.rgnend = rgnend 49 | marker.idx = markrgnindexnumber 50 | marker.color = RGBHexToDec(RegionRGB()) 51 | if isrgn == false then 52 | reaper.SetProjectMarker3(0, marker.idx, isrgn, marker.pos, marker.pos, marker.name, marker.color) 53 | end 54 | end 55 | end 56 | reaper.Undo_EndBlock("Random Marker Color", -1) 57 | reaper.UpdateArrange() 58 | end 59 | end 60 | 61 | Main() 62 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Time (PPQ).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Time (PPQ) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.2 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * REAPER: 6.0 10 | * Donation: http://www.paypal.me/zaibuyidao 11 | * provides: [main=midi_editor,midi_eventlisteditor] . 12 | --]] 13 | 14 | --[[ 15 | * Changelog: 16 | * v1.1 (2020-2-15) 17 | # Add midi ticks per beat 18 | * v1.0 (2020-1-30) 19 | + Initial release 20 | --]] 21 | 22 | -- MIDI Editor -> Options -> Time format for ruler, transoprt, event properties -> Measures.Beats.MIDI_ticks 23 | 24 | function Main() 25 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 26 | local tick = reaper.SNM_GetIntConfigVar("MidiTicksPerBeat", 480) 27 | local cur_pos = reaper.GetCursorPositionEx() 28 | local qn = reaper.TimeMap2_timeToQN(0, cur_pos) 29 | local ppqpos = reaper.MIDI_GetPPQPosFromProjQN(take, qn) 30 | local _, measures, _, _, _ = reaper.TimeMap2_timeToBeats(0, cur_pos) 31 | local start_meas = reaper.MIDI_GetPPQPos_StartOfMeasure(take, ppqpos) 32 | local start_beat = (ppqpos - start_meas) / tick 33 | local num_01, num_02 = math.modf(start_beat) 34 | num_01 = num_01 + 1 35 | num_02 = num_02 * (tick / 1000) 36 | num_add = string.format("%.3f", num_01 + num_02) 37 | measures = measures + 1 38 | local cur_range = tostring(measures)..','..tostring(num_add) 39 | local OK, get_input = reaper.GetUserInputs("Go", 2, "Measure,Beat", cur_range) 40 | if not OK then return reaper.SN_FocusMIDIEditor() end 41 | measure, beat = get_input:match("(.*),(.*)") 42 | if not measure:match('[%d%.]+') or not beat:match('[%d%.]+') then return reaper.SN_FocusMIDIEditor() end 43 | measure, beat = tonumber(measure), tonumber(beat) 44 | num_03, num_04 = math.modf(beat) 45 | num_04 = num_04 / (tick / 1000) 46 | local x = measure - 1 47 | local z = (num_03 - 1) + num_04 48 | reaper.SetEditCurPos(reaper.TimeMap2_beatsToTime(0, z, x), true, true) 49 | end 50 | 51 | script_title = "Time (PPQ)" 52 | reaper.Undo_BeginBlock() 53 | Main() 54 | reaper.Undo_EndBlock(script_title, 0) 55 | reaper.SN_FocusMIDIEditor() 56 | -------------------------------------------------------------------------------- /Various/SFX Tag Search/req/JGuiColors.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | @author n0ne 3 | @version 0.7.1 4 | @noindex 5 | --]] 6 | 7 | jGuiColors = {} 8 | 9 | function jGuiColors:get(sColor, opacity) 10 | opacity = opacity or 1 11 | 12 | local myColors = { 13 | white = { 1, 1, 1 }, 14 | black = { 0, 0, 0 }, 15 | red = { 1, 0, 0 }, 16 | green = { 0, 1, 0 }, 17 | blue = { 0, 0, 1 }, 18 | yellow = { 1, 1, 0 } 19 | } 20 | 21 | if not myColors[sColor] then 22 | msg("Unknown color: " .. sColor) 23 | return false 24 | end 25 | local res = {table.unpack(myColors[sColor])} 26 | res[4] = opacity 27 | return res 28 | end 29 | 30 | function jGuiColors:setAllStates(tColors) 31 | local res = {} 32 | assert(#tColors == 4, "Colors table does not have 4 entries") 33 | res.normal = tColors 34 | res.hover = tColors 35 | res.focus = tColors 36 | res.active = tColors 37 | return res 38 | end 39 | 40 | function jGuiColors:lighter(x) 41 | x = x or 1.2 42 | return {self[1] * x, self[2] * x, self[3] * x, self[4]} 43 | end 44 | 45 | ------------- 46 | -- new color class 47 | jColor = {1, 1, 1, 1} 48 | 49 | function jColor:new(o) 50 | local newObject = {} 51 | 52 | if type(o) == "table" then 53 | newObject = o 54 | end 55 | 56 | setmetatable(newObject, self) 57 | self.__index = self 58 | 59 | if type(o) == "string" then 60 | newObject:make(o) 61 | end 62 | 63 | return newObject 64 | end 65 | 66 | function jColor:make(sColor, opacity) 67 | opacity = opacity or 1 68 | 69 | local myColors = { 70 | white = { 1, 1, 1 }, 71 | black = { 0, 0, 0 }, 72 | red = { 1, 0, 0 }, 73 | green = { 0, 1, 0 }, 74 | blue = { 0, 0, 1 }, 75 | yellow = { 1, 1, 0 } 76 | } 77 | 78 | if not myColors[sColor] then 79 | msg("Unknown color: " .. sColor) 80 | return false 81 | end 82 | local res = {table.unpack(myColors[sColor])} 83 | self[1] = res[1] 84 | self[2] = res[2] 85 | self[3] = res[3] 86 | self[4] = opacity 87 | 88 | return self 89 | end 90 | 91 | function jColor:lighter(x) 92 | x = x or 0.1 93 | -- self[1] = self[1] * x -- this will also change the original color this function is called on 94 | -- self[2] = self[2] * x 95 | -- self[3] = self[3] * x 96 | -- self[4] = self[4] * x 97 | -- return self 98 | return {self[1] + x, self[2] + x, self[3] + x, self[4]} 99 | end -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Trim MIDI Item Edges.lua: -------------------------------------------------------------------------------- 1 | -- @description Trim MIDI Item Edges 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/u/zaibuyidao 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about 11 | -- Requires JS_ReaScriptAPI & SWS Extension 12 | 13 | function get_note_bounds_ppq(take) 14 | local ret, notecnt = reaper.MIDI_CountEvts(take) 15 | if not ret or notecnt == 0 then return end 16 | 17 | local min_ppq, max_ppq = math.huge, -math.huge 18 | for i = 0, notecnt - 1 do 19 | local retval, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 20 | if retval then 21 | if startppqpos < min_ppq then min_ppq = startppqpos end 22 | if endppqpos > max_ppq then max_ppq = endppqpos end 23 | end 24 | end 25 | if min_ppq == math.huge or max_ppq == -math.huge or max_ppq <= min_ppq then 26 | return 27 | end 28 | return min_ppq, max_ppq 29 | end 30 | 31 | function trim_item_to_notes(item) 32 | local take = reaper.GetActiveTake(item) 33 | if not (take and reaper.TakeIsMIDI(take)) then return false end 34 | reaper.MIDI_Sort(take) 35 | 36 | local min_ppq, max_ppq = get_note_bounds_ppq(take) 37 | if not min_ppq then return end 38 | 39 | local start_qn = reaper.MIDI_GetProjQNFromPPQPos(take, min_ppq) 40 | local end_qn = reaper.MIDI_GetProjQNFromPPQPos(take, max_ppq) + 1e-9 -- 末端防截短 41 | 42 | reaper.MIDI_SetItemExtents(item, start_qn, end_qn) 43 | return true 44 | end 45 | 46 | function collect_selected_items() 47 | local items = {} 48 | local total = reaper.CountMediaItems(0) 49 | for i = 0, total - 1 do 50 | local item = reaper.GetMediaItem(0, i) 51 | if item and reaper.IsMediaItemSelected(item) then 52 | items[#items+1] = item 53 | end 54 | end 55 | return items 56 | end 57 | 58 | function main() 59 | local items = collect_selected_items() 60 | if #items == 0 then return end 61 | 62 | reaper.Undo_BeginBlock() 63 | reaper.PreventUIRefresh(1) 64 | 65 | local j = 0 66 | for _, item in ipairs(items) do 67 | if trim_item_to_notes(item) then 68 | j = j + 1 69 | end 70 | end 71 | 72 | reaper.PreventUIRefresh(-1) 73 | reaper.UpdateArrange() 74 | reaper.Undo_EndBlock(string.format("Trim MIDI Item Edges (Processed %d)", j), -1) 75 | end 76 | 77 | main() 78 | -------------------------------------------------------------------------------- /Markers/zaibuyidao_Random Marker Region Color.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random Marker/Region Color 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 or newer recommended 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2020-5-5) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) reaper.ShowConsoleMsg(tostring(param) .. "\n") end 19 | 20 | function RegionRGB() 21 | local R = math.random(256) - 1 22 | local G = math.random(256) - 1 23 | local B = math.random(256) - 1 24 | return R, G, B 25 | end 26 | 27 | function RGBHexToDec(R, G, B) 28 | local red = string.format("%x", R) 29 | local green = string.format("%x", G) 30 | local blue = string.format("%x", B) 31 | if (#red < 2) then red = "0" .. red end 32 | if (#green < 2) then green = "0" .. green end 33 | if (#blue < 2) then blue = "0" .. blue end 34 | local color = "01" .. blue .. green .. red 35 | return tonumber(color, 16) 36 | end 37 | 38 | function Main() 39 | local marker_ok, num_markers, num_regions = reaper.CountProjectMarkers(0) 40 | if marker_ok and (num_markers or num_regions ~= 0) then 41 | reaper.Undo_BeginBlock() 42 | for i = 1, num_markers + num_regions do 43 | local retval, isrgn, pos, rgnend, name, markrgnindexnumber, color = reaper.EnumProjectMarkers3(0, i - 1) 44 | if retval ~= nil then 45 | local region = {} 46 | region.pos = pos 47 | region.name = name 48 | region.rgnend = rgnend 49 | region.idx = markrgnindexnumber 50 | region.color = RGBHexToDec(RegionRGB()) 51 | if isrgn == true then 52 | reaper.SetProjectMarker3(0, region.idx, isrgn, region.pos, region.rgnend, region.name, region.color) 53 | else 54 | reaper.SetProjectMarker3(0, region.idx, isrgn, region.pos, region.pos, region.name, region.color) 55 | end 56 | end 57 | end 58 | reaper.Undo_EndBlock("Random Marker/Region Color", -1) 59 | reaper.UpdateArrange() 60 | end 61 | end 62 | Main() 63 | -------------------------------------------------------------------------------- /Various/SFX Tag Search/req/j_string_functions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | @author n0ne 3 | @version 0.7.0 4 | @noindex 5 | --]] 6 | 7 | function jStringExplodeOld(s, sep) 8 | -- Explode a string by seperator 9 | -- Returns #1: Table with parts 10 | -- Returns #2: Amount of times the seperator can be found 11 | -- If the seperator is NOT found it will return a table with 1 element and 0. 12 | local tResult = {} 13 | local i = 0 14 | 15 | -- Check if the seperator is found 16 | -- if not s:find(sep, 1, true) then 17 | -- table.insert(tResult, s) 18 | -- return tResult, i 19 | -- end 20 | 21 | 22 | local run = true 23 | local start = 1 24 | while run do 25 | local begin, fin = s:find(sep, start, true) 26 | if begin then 27 | table.insert(tResult, s:sub(start, fin - #sep)) 28 | start = fin + 1 29 | i = i + 1 30 | else 31 | table.insert(tResult, s:sub(start, s:len())) 32 | run = false 33 | end 34 | end 35 | 36 | 37 | return tResult, i 38 | end 39 | 40 | 41 | function jStringExplode(s, sep, bIgnoreCase) 42 | -- Explode a string by seperator 43 | -- Returns #1: Table with parts 44 | -- Returns #2: Amount of times the seperator can be found 45 | -- If the seperator is NOT found it will return a table with 1 element and 0. 46 | -- Default is case sensitive, use bIgnoreCase to turn off 47 | 48 | -- Potential bug: two consequitive occurances of sep will insert an empty element. Is that correct? 49 | 50 | local bIgnoreCase = false or bIgnoreCase 51 | 52 | local tResult = {} 53 | local i = 0 54 | local sOrig = s 55 | 56 | if bIgnoreCase then 57 | s = s:lower() 58 | sep = sep:lower() 59 | end 60 | 61 | 62 | local run = true 63 | local start = 1 64 | while run do 65 | local begin, fin = s:find(sep, start, true) 66 | if begin then 67 | table.insert(tResult, sOrig:sub(start, fin - #sep)) 68 | start = fin + 1 69 | i = i + 1 70 | else 71 | table.insert(tResult, sOrig:sub(start, s:len())) 72 | run = false 73 | end 74 | end 75 | 76 | 77 | return tResult, i 78 | end 79 | 80 | 81 | 82 | 83 | function jStringTrim(s) 84 | return s:match "^%s*(.-)%s*$" 85 | end 86 | 87 | function jStringIsInt(s) 88 | local r = s:match("^(%d+)$") 89 | return r ~= nil 90 | end -------------------------------------------------------------------------------- /Various/Advanced Solo/zaibuyidao_Toggle Solo for Selected Tracks.lua: -------------------------------------------------------------------------------- 1 | -- NoIndex: true 2 | local ZBYDFuncPath = reaper.GetResourcePath() .. '/Scripts/zaibuyidao Scripts/Utility/zaibuyidao_Functions.lua' 3 | if reaper.file_exists(ZBYDFuncPath) then 4 | dofile(ZBYDFuncPath) 5 | if not checkSWSExtension() or not checkJSAPIExtension() then return end 6 | else 7 | local errorMsg = "Error - Missing Script (错误 - 缺失脚本)\n\n" .. 8 | "[English]\nThe required 'zaibuyidao Functions' script file was not found. Please ensure the file is correctly placed at:\n" .. 9 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\nIf the file is missing, you can install it via ReaPack by searching for 'zaibuyidao Functions' in the ReaPack package browser.\n\n" .. 10 | "[中文]\n必需的 'zaibuyidao Functions' 脚本文件未找到。请确保文件正确放置在以下位置:\n" .. 11 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\n如果文件缺失,您可以通过 ReaPack 包浏览器搜索并安装 'zaibuyidao Functions'。\n" 12 | 13 | reaper.MB(errorMsg, "Missing Script Error/脚本文件缺失错误", 0) 14 | 15 | if reaper.APIExists('ReaPack_BrowsePackages') then 16 | reaper.ReaPack_BrowsePackages('zaibuyidao Functions') 17 | else 18 | local reapackErrorMsg = "Error - ReaPack Not Found (错误 - 未找到 ReaPack)\n\n" .. 19 | "[English]\nThe ReaPack extension is not found. Please install ReaPack to manage and install REAPER scripts and extensions easily. Visit https://reapack.com for installation instructions.\n\n" .. 20 | "[中文]\n未找到 ReaPack 扩展。请安装 ReaPack 来便捷地管理和安装 REAPER 脚本及扩展。访问 https://reapack.com 获取安装指南。\n" 21 | 22 | reaper.MB(reapackErrorMsg, "ReaPack Not Found/未找到 ReaPack", 0) 23 | end 24 | return 25 | end 26 | 27 | function NoUndoPoint() end 28 | reaper.PreventUIRefresh(1) 29 | 30 | local selectedTrackCount = reaper.CountSelectedTracks(0) 31 | for i = 0, selectedTrackCount - 1 do 32 | local track = reaper.GetSelectedTrack(0, i) 33 | if reaper.GetMediaTrackInfo_Value(track, 'I_SOLO') == 2 then return reaper.Main_OnCommand(40340,0) end 34 | end 35 | reaper.Main_OnCommand(40340, 0) -- Track: Unsolo all tracks 36 | for i = 0, selectedTrackCount - 1 do 37 | local track = reaper.GetSelectedTrack(0, i) 38 | reaper.SetTrackSelected(track, true) 39 | reaper.SetMediaTrackInfo_Value(track, 'I_SOLO', 2) 40 | end 41 | local window, _, _ = reaper.BR_GetMouseCursorContext() 42 | local _, inline_editor, _, _, _, _ = reaper.BR_GetMouseCursorContext_MIDI() 43 | if window == "midi_editor" and not inline_editor then reaper.SN_FocusMIDIEditor() end -- 聚焦 MIDI Editor 44 | 45 | reaper.PreventUIRefresh(-1) 46 | reaper.UpdateArrange() 47 | reaper.defer(NoUndoPoint) -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Insert Pitch Bend Reset.lua: -------------------------------------------------------------------------------- 1 | -- @description Insert Pitch Bend Reset 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about 11 | -- Pitch Bend Script Series, filter "zaibuyidao pitch bend" in ReaPack or Actions to access all scripts. 12 | -- Requires JS_ReaScriptAPI & SWS Extension 13 | 14 | local ZBYDFuncPath = reaper.GetResourcePath() .. '/Scripts/zaibuyidao Scripts/Utility/zaibuyidao_Functions.lua' 15 | if reaper.file_exists(ZBYDFuncPath) then 16 | dofile(ZBYDFuncPath) 17 | if not checkSWSExtension() or not checkJSAPIExtension() then return end 18 | else 19 | local errorMsg = "Error - Missing Script (错误 - 缺失脚本)\n\n" .. 20 | "[English]\nThe required 'zaibuyidao Functions' script file was not found. Please ensure the file is correctly placed at:\n" .. 21 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\nIf the file is missing, you can install it via ReaPack by searching for 'zaibuyidao Functions' in the ReaPack package browser.\n\n" .. 22 | "[中文]\n必需的 'zaibuyidao Functions' 脚本文件未找到。请确保文件正确放置在以下位置:\n" .. 23 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\n如果文件缺失,您可以通过 ReaPack 包浏览器搜索并安装 'zaibuyidao Functions'。\n" 24 | 25 | reaper.MB(errorMsg, "Missing Script Error/脚本文件缺失错误", 0) 26 | 27 | if reaper.APIExists('ReaPack_BrowsePackages') then 28 | reaper.ReaPack_BrowsePackages('zaibuyidao Functions') 29 | else 30 | local reapackErrorMsg = "Error - ReaPack Not Found (错误 - 未找到 ReaPack)\n\n" .. 31 | "[English]\nThe ReaPack extension is not found. Please install ReaPack to manage and install REAPER scripts and extensions easily. Visit https://reapack.com for installation instructions.\n\n" .. 32 | "[中文]\n未找到 ReaPack 扩展。请安装 ReaPack 来便捷地管理和安装 REAPER 脚本及扩展。访问 https://reapack.com 获取安装指南。\n" 33 | 34 | reaper.MB(reapackErrorMsg, "ReaPack Not Found/未找到 ReaPack", 0) 35 | end 36 | return 37 | end 38 | 39 | local language = getSystemLanguage() 40 | 41 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 42 | local pos = reaper.GetCursorPositionEx() 43 | local ppq = reaper.MIDI_GetPPQPosFromProjTime(take, pos) 44 | local pitchbend = 0 45 | 46 | reaper.Undo_BeginBlock() 47 | local LSB = pitchbend & 0x7F 48 | local MSB = (pitchbend >> 7) + 64 49 | reaper.MIDI_InsertCC(take, false, false, ppq, 224, 0, LSB, MSB) 50 | reaper.Undo_EndBlock("", -1) 51 | reaper.UpdateArrange() 52 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Random CC Value (Limit Range).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random CC Value (Limit Range) 3 | * Version: 2.3 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2019-12-12) 14 | + Initial release 15 | --]] 16 | 17 | function Main() 18 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 19 | local _, _, ccevtcnt, _ = reaper.MIDI_CountEvts(take) 20 | 21 | local min_val = reaper.GetExtState("RandCCValLimit", "Min") 22 | if (min_val == "") then min_val = "1" end 23 | local max_val = reaper.GetExtState("RandCCValLimit", "Max") 24 | if (max_val == "") then max_val = "127" end 25 | 26 | user_ok, user_input_csv = reaper.GetUserInputs("Random CC Value", 2, "Min Value,Max Value", min_val ..','.. max_val) 27 | if not user_ok then return reaper.SN_FocusMIDIEditor() end 28 | min_val, max_val = user_input_csv:match("(.*),(.*)") 29 | min_val, max_val = tonumber(min_val), tonumber(max_val) 30 | 31 | reaper.SetExtState("RandCCValLimit", "Min", min_val, false) 32 | reaper.SetExtState("RandCCValLimit", "Max", max_val, false) 33 | 34 | if min_val > 127 then 35 | min_val = 127 36 | elseif 37 | min_val < 1 then 38 | min_val = 1 39 | elseif 40 | max_val > 127 then 41 | max_val = 127 42 | elseif 43 | max_val < 1 then 44 | max_val = 1 45 | elseif 46 | min_val > max_val then 47 | local t = max_val 48 | max_val = min_val 49 | min_val = t 50 | end 51 | 52 | if min_val == max_val then 53 | return reaper.MB("Random interval is empty.", "Error", 0), 54 | reaper.SN_FocusMIDIEditor() 55 | end 56 | 57 | local diff = max_val - min_val 58 | reaper.MIDI_DisableSort(take) 59 | for i = 0, ccevtcnt-1 do 60 | retval, selected, muted, ppqpos, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 61 | if selected == true then 62 | local x = tonumber(min_val + math.random(diff)) 63 | reaper.MIDI_SetCC(take, i, nil, nil, nil, nil, nil, nil, x, false) 64 | end 65 | i=i+1 66 | end 67 | reaper.UpdateArrange() 68 | reaper.MIDI_Sort(take) 69 | end 70 | 71 | script_title = "Random CC Value (Limit Range)" 72 | reaper.Undo_BeginBlock() 73 | Main() 74 | reaper.Undo_EndBlock(script_title, 0) 75 | reaper.SN_FocusMIDIEditor() 76 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Duplicate CC (For Selected CC).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Duplicate CC (For Selected CC) 3 | * Version: 1.0.2 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-6-12) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) 19 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 20 | end 21 | 22 | if not reaper.SN_FocusMIDIEditor then 23 | local retval = reaper.ShowMessageBox("This script requires the SWS extension, would you like to download it now?\n這個脚本需要SWS擴展,你想現在就下載它嗎?", "Warning", 1) 24 | if retval == 1 then 25 | Open_URL("http://www.sws-extension.org/download/pre-release/") 26 | end 27 | end 28 | 29 | function Main() 30 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 31 | if not take or not reaper.TakeIsMIDI(take) then return end 32 | local _, _, ccevtcnt, _ = reaper.MIDI_CountEvts(take) 33 | 34 | local target = reaper.GetExtState("DuplicateCCForSelectedCC", "Target") 35 | if (target == "") then target = "11" end 36 | 37 | local retval, retvals_csv = reaper.GetUserInputs('Duplicate CC (For Selected CC)', 1, 'Target CC', target) 38 | target = retvals_csv:match("(.*)") 39 | if not retval or not tonumber(target) then return reaper.SN_FocusMIDIEditor() end 40 | target = tonumber(target) 41 | 42 | if target > 127 or target < 0 then 43 | return 44 | reaper.MB("請輸入從0到127的數值", "錯誤", 0), 45 | reaper.SN_FocusMIDIEditor() 46 | end 47 | 48 | reaper.SetExtState("DuplicateCCForSelectedCC", "Target", target, false) 49 | 50 | reaper.Undo_BeginBlock() 51 | reaper.MIDI_DisableSort(take) 52 | for i = 0, ccevtcnt - 1 do 53 | local _, selected, muted, ppqpos, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 54 | local _, shape, beztension = reaper.MIDI_GetCCShape(take, i) 55 | 56 | if selected == true then 57 | ccevtcnt = ccevtcnt + 1 58 | reaper.MIDI_InsertCC(take, selected, muted, ppqpos, chanmsg, chan, target, msg3) 59 | reaper.MIDI_SetCCShape(take, ccevtcnt - 1, shape, beztension, false) 60 | end 61 | end 62 | reaper.MIDI_Sort(take) 63 | reaper.Undo_EndBlock("Duplicate CC (For Selected CC)", -1) 64 | reaper.UpdateArrange() 65 | end 66 | 67 | Main() 68 | reaper.SN_FocusMIDIEditor() 69 | -------------------------------------------------------------------------------- /Utility/zaibuyidao_Media Explorer Search Filter.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Media Explorer Search Filter 3 | * Version: 1.0.2 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 7 | * Donation: http://www.paypal.me/zaibuyidao 8 | * Provides: [main=main,mediaexplorer] . 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2022-7-26) 14 | + Initial release 15 | --]] 16 | 17 | function print(param) 18 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 19 | end 20 | 21 | if not reaper.APIExists("JS_Localize") then 22 | reaper.MB("請右鍵單擊並安裝'js_ReaScriptAPI: API functions for ReaScripts'。然後重新啟動REAPER並再次運行腳本,謝謝!", "你必須安裝 JS_ReaScriptAPI", 0) 23 | local ok, err = reaper.ReaPack_AddSetRepository("ReaTeam Extensions", "https://github.com/ReaTeam/Extensions/raw/master/index.xml", true, 1) 24 | if ok then 25 | reaper.ReaPack_BrowsePackages("js_ReaScriptAPI") 26 | else 27 | reaper.MB(err, "錯誤", 0) 28 | end 29 | return reaper.defer(function() end) 30 | end 31 | 32 | function send_search_text(text) 33 | local title = reaper.JS_Localize("Media Explorer", "common") 34 | local hwnd = reaper.JS_Window_Find(title, true) 35 | local search = reaper.JS_Window_FindChildByID(hwnd, 1015) 36 | if search == nil then return end 37 | reaper.JS_Window_SetTitle(search, text) 38 | 39 | local os = reaper.GetOS() 40 | if os ~= "Win32" and os ~= "Win64" then 41 | reaper.JS_WindowMessage_Send(hwnd, "WM_COMMAND", 42051, 0, 0, 0) 42 | reaper.JS_WindowMessage_Send(hwnd, "WM_COMMAND", 42051, 0, 0, 0) 43 | else 44 | if reaper.GetToggleCommandStateEx(32063, 42051) == 1 then 45 | -- reaper.SetToggleCommandState(32063, 42051, 0) -- 无效 46 | reaper.JS_WindowMessage_Send(hwnd, "WM_COMMAND", 42051, 0, 0, 0) 47 | end 48 | -- https://github.com/justinfrankel/WDL/blob/main/WDL/swell/swell-types.h 49 | reaper.JS_WindowMessage_Post(search, "WM_KEYDOWN", 0x0020, 0, 0, 0) -- 空格 50 | reaper.JS_WindowMessage_Post(search, "WM_KEYUP", 0x0008, 0, 0, 0) -- 退格 51 | end 52 | end 53 | 54 | local text = reaper.GetExtState("MediaExplorerSearchFilter", "Keywords") 55 | if (text == "") then text = "" end 56 | userok, text = reaper.GetUserInputs("Media Explorer Search Filter", 1, "Keywords 關鍵詞,extrawidth=150", text) 57 | if not userok then return end 58 | reaper.SetExtState("MediaExplorerSearchFilter", "Keywords", text, false) 59 | 60 | reaper.Undo_BeginBlock() 61 | send_search_text(text) 62 | reaper.Undo_EndBlock("Media Explorer Search Filter", -1) 63 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Various/SFX Tag Search/lib/config-custom-tags-default.ini: -------------------------------------------------------------------------------- 1 | ; @noindex 2 | [files] 3 | sfx_tag_data_file=ratings-custom-tags.ini 4 | keywords_csv_file=keywords_custom_tags.csv 5 | [gui] 6 | ; Visual settings 7 | default_theme=imgui ; default theme, options: default, imgui, n0ne (设置主题, 可选项: default, imgui, n0ne) 8 | default_font=Calibri ; default font, options: Calibri, Microsoft YaHei, SimSun, STSong, STFangsong, ... (默认字体, 可选项: Calibri, 微软雅黑, SimSun, 华文宋体, 华文仿宋, ...) 9 | default_font_size=18 ; default font size (默认字体大小) 10 | font_size_adjustment=5 ; baseline offset for font size (字体大小的基线偏移) 11 | max_results=0 ; total number of results in the list, 0=unlimited (列表中结果的总数 0=不限) 12 | window_width=300 13 | window_height=600 14 | window_x=100 15 | window_y=100 16 | window_dock_state=0 17 | gui_size=20 ; The size ot the text, everything will scale accordingly (控件单位大小, 所有控件大小以此为基准) 18 | window_save_state=true ; remeber where the window was last time (关闭时记住窗口位置) 19 | cursor_focus_style=1 ; 0=Border 1=Fill (0=边框 1=填充) 20 | [color] 21 | ; Set highlight color for categories (为分类设置高亮颜色) 22 | color_row_highlight_01=null ; Grayish (霾蓝) 23 | color_row_highlight_02=null ; Yellowish (柳黄) 24 | color_row_highlight_03=null ; Blueish (碧蓝) 25 | color_row_highlight_04=null ; Greenish (苔绿) 26 | color_row_highlight_05=null ; Reddish (梅红) 27 | color_row_highlight_06=null ; Purplish (藤紫) 28 | color_row_highlight_07=null ; Tealish (鸭绿) 29 | color_row_highlight_08=null ; Rosish (蔷薇) 30 | color_row_highlight_09=null ; Orangish (橘红) 31 | color_row_highlight_10=null ; Brownish (褐黄) 32 | [misc] 33 | filter_name=true ; filter by name (是否过滤名称) 34 | filter_alias=true ; filter by alias (是否过滤别名) 35 | filter_category=false ; filter by category (是否过滤类别) 36 | english_first=false ; english list first (是否英文优先) 37 | update_ratings=false ; use rankings (是否使用排行) 38 | [tag] 39 | show_tag_alias=false 40 | [keywords] 41 | ; Whether to include the parent directory of the file when extracting keywords. Not enabled by default 42 | ; 在提取关键词时, 是否包括文件的父目录. 默认不启用 43 | include_parent_directories=false 44 | [exclude_db_enable] 45 | excluded_database_enable=true 46 | [exclude_db] 47 | excluded_database=DB: 10000 48 | ;excluded_database=DB: 10001 49 | [exclude_column_enable] 50 | excluded_column_enable=true 51 | [exclude_column] 52 | ; ; Current columns: Album, Comment, Custom Tags, Description, File, Genre, Keywords 53 | ; 当前列: Album, Comment, Custom Tags, Description, File, Genre, Keywords 54 | excluded_column=Album 55 | excluded_column=Comment 56 | ;excluded_column=Custom Tags 57 | excluded_column=Description 58 | excluded_column=File 59 | excluded_column=Genre 60 | excluded_column=Keywords 61 | -------------------------------------------------------------------------------- /Various/SFX Tag Search/lib/config-ucs-default.ini: -------------------------------------------------------------------------------- 1 | ; @noindex 2 | [files] 3 | sfx_tag_data_file=ratings-ucs.ini 4 | keywords_csv_file=keywords_ucs.csv 5 | [gui] 6 | ; Visual settings 7 | default_theme=imgui ; default theme, options: default, imgui, n0ne (设置主题, 可选项: default, imgui, n0ne) 8 | default_font=Calibri ; default font, options: Calibri, Microsoft YaHei, SimSun, STSong, STFangsong, ... (默认字体, 可选项: Calibri, 微软雅黑, SimSun, 华文宋体, 华文仿宋, ...) 9 | default_font_size=18 ; default font size (默认字体大小) 10 | font_size_adjustment=5 ; baseline offset for font size (字体大小的基线偏移) 11 | max_results=0 ; total number of results in the list, 0=unlimited (列表中结果的总数 0=不限) 12 | window_width=300 13 | window_height=600 14 | window_x=100 15 | window_y=100 16 | window_dock_state=0 17 | gui_size=20 ; The size ot the text, everything will scale accordingly (控件单位大小, 所有控件大小以此为基准) 18 | window_save_state=true ; remeber where the window was last time (关闭时记住窗口位置) 19 | cursor_focus_style=1 ; 0=Border 1=Fill (0=边框 1=填充) 20 | [color] 21 | ; Set highlight color for categories (为分类设置高亮颜色) 22 | color_row_highlight_01=null ; Grayish (霾蓝) 23 | color_row_highlight_02=null ; Yellowish (柳黄) 24 | color_row_highlight_03=null ; Blueish (碧蓝) 25 | color_row_highlight_04=null ; Greenish (苔绿) 26 | color_row_highlight_05=null ; Reddish (梅红) 27 | color_row_highlight_06=null ; Purplish (藤紫) 28 | color_row_highlight_07=null ; Tealish (鸭绿) 29 | color_row_highlight_08=null ; Rosish (蔷薇) 30 | color_row_highlight_09=null ; Orangish (橘红) 31 | color_row_highlight_10=null ; Brownish (褐黄) 32 | [misc] 33 | filter_name=true ; filter by CatID (是否过滤CatID) 34 | filter_alias=true ; filter by SubCategory (是否过滤子类别) 35 | filter_category=true ; filter by Category (是否过滤类别) 36 | english_first=false ; english first (是否英文优先) 37 | update_ratings=false ; use rankings (是否使用排行) 38 | [ucs_language] 39 | ; set the default language for UCS list (设置 UCS 列表的默认语言) 40 | current_language=EN ; EN=英文, ZH=简体中文, TW=繁体中文 41 | [ucs] 42 | ; When UCS user columns are created, the following settings will be effective (press F10 in the script interface to set up user columns) 43 | ; 当创建了 UCS 用户列, 以下设置将生效 (在脚本界面按 F10 可设置用户列) 44 | use_catid=true 45 | use_category_full=false 46 | use_category=false 47 | use_sub_category=false 48 | use_category_full_zh=false 49 | use_category_zh=false 50 | use_sub_category_zh=false 51 | use_category_full_tw=false 52 | use_category_tw=false 53 | use_sub_category_tw=false 54 | [write_delay] 55 | ; Unit: seconds. The processing time between each tag. If you can't write a tag successfully, you need to increase the delay time 56 | ; 单位: 秒. 每个标签之间的处理时间间隔. 如果无法顺利写入标签, 则需要将延迟时间调大 57 | inter_write_delay=0.1 ; seconds (秒) 58 | -------------------------------------------------------------------------------- /Various/SFX Tag Search/req/j_file_functions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | @author n0ne 3 | @version 0.7.0 4 | @noindex 5 | --]] 6 | 7 | function getFilesRecursive(sDir, bSkipRecursive, t) 8 | -- This function gets files and their path (recursivly) from a folder 9 | -- sDirr needs to end with a slash! ("\\") 10 | -- set bSkipRecursive = true to only look in the current folder 11 | -- t can be empty or a table. If t is a table the results from this function will be added to it 12 | -- the result is a table with {filename, path} as elements. 13 | 14 | local t = t or {} 15 | local bSkipRecursive = bSkipRecursive or false 16 | local i = 0 17 | 18 | -- If possbile first go recursivly into all subdirs 19 | if not bSkipRecursive then 20 | local sCurDir = reaper.EnumerateSubdirectories(sDir, i) 21 | while sCurDir do 22 | t = getFilesRecursive(sDir .. sCurDir .. "/", bSkipRecursive, t) -- changed / to \\ and back for mac (why did i have \\?) 23 | 24 | i = i + 1 25 | sCurDir = reaper.EnumerateSubdirectories(sDir, i) 26 | end 27 | end 28 | 29 | -- Now gather files from this dir 30 | i = 0 31 | local sCurFile = reaper.EnumerateFiles(sDir, i) 32 | while sCurFile do 33 | t[#t+1] = {sCurFile, sDir} 34 | 35 | i = i+1 36 | sCurFile = reaper.EnumerateFiles(sDir, i) 37 | end 38 | 39 | return t 40 | end 41 | 42 | function jFilesRemoveExt(fn) 43 | local r = fn:match("(.+)%..+") 44 | return r or fn -- if there is no . in the name return the original 45 | end 46 | 47 | function jFilesGetFilename(path) 48 | return path:match("^.+\\(.+)$") 49 | end 50 | 51 | function jFilesGetPath(path) 52 | return path:match("^(.+)\\.+$") 53 | end 54 | 55 | function jFilesGetFileModifiedTimestamp(path) 56 | -- Be careful with this function as the system's date and time formatting determine the output 57 | local cmd = 'forfiles /P "'.. jFilesGetPath(path) .. '" /M "'.. jFilesGetFilename(path) ..'" /C "cmd /c echo @fdate @ftime"' 58 | local result = reaper.ExecProcess(cmd, 1000):match("^.+\n(.+)\n.-$") 59 | if not result:match("^%d%d%d%d%-%d%d%-%d%d%s%d%d:%d%d:%d%d") then 60 | -- msg(result) 61 | reaper.ShowConsoleMsg("---\nERROR: Timestamp doesn't have the expected format. This function only works if the system date format is set as: yyyy-MM-dd HH-mm-ss\n-----\n") 62 | return false 63 | else 64 | return result 65 | end 66 | end 67 | 68 | function jFilesCopyFile(source, dest) 69 | local cmd = 'COPY "' .. source .. '" "' .. dest .. '"' 70 | -- msg(cmd) 71 | -- local r = reaper.ExecProcess(cmd, 1000) 72 | local r = os.execute(cmd) 73 | -- msg(r) 74 | end 75 | 76 | -- function GetFileExtension(url) 77 | -- return url:match("^.+(%..+)$") 78 | -- end -------------------------------------------------------------------------------- /Various/SFX Tag Search/lib/config-ucs-synonym-index-default.ini: -------------------------------------------------------------------------------- 1 | ; @noindex 2 | [files] 3 | sfx_tag_data_file=ratings-ucs-synonym-index.ini 4 | keywords_csv_file=keywords_ucs.csv 5 | [gui] 6 | ; Visual settings 7 | default_theme=imgui ; default theme, options: default, imgui, n0ne (设置主题, 可选项: default, imgui, n0ne) 8 | default_font=Calibri ; default font, options: Calibri, Microsoft YaHei, SimSun, STSong, STFangsong, ... (默认字体, 可选项: Calibri, 微软雅黑, SimSun, 华文宋体, 华文仿宋, ...) 9 | default_font_size=18 ; default font size (默认字体大小) 10 | font_size_adjustment=5 ; baseline offset for font size (字体大小的基线偏移) 11 | max_results=0 ; total number of results in the list, 0=unlimited (列表中结果的总数 0=不限) 12 | window_width=300 13 | window_height=600 14 | window_x=100 15 | window_y=100 16 | window_dock_state=0 17 | gui_size=20 ; The size ot the text, everything will scale accordingly (控件单位大小, 所有控件大小以此为基准) 18 | window_save_state=true ; remeber where the window was last time (关闭时记住窗口位置) 19 | cursor_focus_style=1 ; 0=Border 1=Fill (0=边框 1=填充) 20 | [color] 21 | ; Set highlight color for categories (为分类设置高亮颜色) 22 | color_row_highlight_01=null ; Grayish (霾蓝) 23 | color_row_highlight_02=null ; Yellowish (柳黄) 24 | color_row_highlight_03=null ; Blueish (碧蓝) 25 | color_row_highlight_04=null ; Greenish (苔绿) 26 | color_row_highlight_05=null ; Reddish (梅红) 27 | color_row_highlight_06=null ; Purplish (藤紫) 28 | color_row_highlight_07=null ; Tealish (鸭绿) 29 | color_row_highlight_08=null ; Rosish (蔷薇) 30 | color_row_highlight_09=null ; Orangish (橘红) 31 | color_row_highlight_10=null ; Brownish (褐黄) 32 | [misc] 33 | filter_name=true ; filter by Synonyms (是否过滤同义词) 34 | filter_alias=true ; filter by CatID & Category (是否过滤CatID和类别) 35 | filter_category=true ; filter by SubCategory (是否过滤子类别) 36 | english_first=false ; english first (是否英文优先) 37 | update_ratings=false ; use rankings (是否使用排行) 38 | [ucs_language] 39 | ; set the default language for UCS list (设置 UCS 列表的默认语言) 40 | current_language=EN ; EN=英文, ZH=简体中文, TW=繁体中文 41 | [ucs] 42 | ; When UCS user columns are created, the following settings will be effective (press F10 in the script interface to set up user columns) 43 | ; 当创建了 UCS 用户列, 以下设置将生效 (在脚本界面按 F10 可设置用户列) 44 | use_catid=true 45 | use_category_full=false 46 | use_category=false 47 | use_sub_category=false 48 | use_category_full_zh=false 49 | use_category_zh=false 50 | use_sub_category_zh=false 51 | use_category_full_tw=false 52 | use_category_tw=false 53 | use_sub_category_tw=false 54 | [write_delay] 55 | ; Unit: seconds. The processing time between each tag. If you can't write a tag successfully, you need to increase the delay time 56 | ; 单位: 秒. 每个标签之间的处理时间间隔. 如果无法顺利写入标签, 则需要将延迟时间调大 57 | inter_write_delay=0.1 ; seconds (秒) 58 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Random Velocity (Limit Range).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random Velocity (Limit Range) 3 | * Version: 1.5 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2019-12-12) 14 | + Initial release 15 | --]] 16 | 17 | function Main() 18 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 19 | _, notecnt, _, _ = reaper.MIDI_CountEvts(take) 20 | 21 | local min_val = reaper.GetExtState("RandVeloLimit", "Min") 22 | if (min_val == "") then min_val = "1" end 23 | local max_val = reaper.GetExtState("RandVeloLimit", "Max") 24 | if (max_val == "") then max_val = "127" end 25 | 26 | user_ok, user_input_csv = reaper.GetUserInputs("Random Velocity", 2, "Min Value,Max Value", min_val ..','.. max_val) 27 | if not user_ok then return reaper.SN_FocusMIDIEditor() end 28 | min_val, max_val = user_input_csv:match("(.*),(.*)") 29 | if not tonumber(min_val) or not tonumber(max_val) then return reaper.SN_FocusMIDIEditor() end 30 | min_val, max_val = tonumber(min_val), tonumber(max_val) 31 | 32 | reaper.SetExtState("RandVeloLimit", "Min", min_val, false) 33 | reaper.SetExtState("RandVeloLimit", "Max", max_val, false) 34 | 35 | if min_val > 127 then 36 | min_val = 127 37 | elseif 38 | min_val < 1 then 39 | min_val = 1 40 | elseif 41 | max_val > 127 then 42 | max_val = 127 43 | elseif 44 | max_val < 1 then 45 | max_val = 1 46 | elseif 47 | min_val > max_val then 48 | local t = max_val 49 | max_val = min_val 50 | min_val = t 51 | end 52 | 53 | if min_val == max_val then 54 | return reaper.MB("Random interval is empty, please re-enter", "Error", 0), 55 | reaper.SN_FocusMIDIEditor() 56 | end 57 | 58 | local diff = max_val - min_val 59 | reaper.MIDI_DisableSort(take) 60 | for i = 0, notecnt-1 do 61 | retval, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 62 | if selected == true then 63 | vel = tonumber(min_val + math.random(diff)) 64 | reaper.MIDI_SetNote(take, i, selected, muted, startppqpos, endppqpos, chan, pitch, vel, false) 65 | end 66 | i=i+1 67 | end 68 | reaper.UpdateArrange() 69 | reaper.MIDI_Sort(take) 70 | end 71 | 72 | script_title = "Random Velocity (Limit Range)" 73 | reaper.Undo_BeginBlock() 74 | Main() 75 | reaper.Undo_EndBlock(script_title, 0) 76 | reaper.SN_FocusMIDIEditor() 77 | -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Select Top Notes In Chord (Leave Single Notes Selected).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Select Top Notes In Chord (Leave Single Notes Selected) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * Reference: https://forum.cockos.com/showpost.php?p=1684673&postcount=5 (gofer) 10 | * REAPER: 6.0 11 | * Donation: http://www.paypal.me/zaibuyidao 12 | --]] 13 | 14 | --[[ 15 | * Changelog: 16 | * v1.0 (2020-2-25) 17 | + Initial release 18 | --]] 19 | 20 | function SelectTopNotes() 21 | local function max(t) 22 | local mn = nil 23 | for k, v in pairs(t) do 24 | if (mn == nil) then mn = v end 25 | if mn < v then mn = v end 26 | end 27 | return mn 28 | end 29 | 30 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 31 | local _, notecnt, _, _ = reaper.MIDI_CountEvts(take) 32 | local chord_pitch = {} 33 | local chord_prop = {} 34 | local chord_none = 0 35 | local time = {0.0, 0.0} 36 | 37 | if notecnt ~= 0 then 38 | sel = reaper.MIDI_EnumSelNotes(take, -1) 39 | while sel ~= -1 do 40 | local retval, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, sel) 41 | local note_prop = {sel, selected, muted, startppqpos, endppqpos, chan, pitch, vel} 42 | if startppqpos > time[2] - 120 then 43 | time = {startppqpos, endppqpos} 44 | chord_pitch = {} 45 | table.insert(chord_pitch, pitch) -- chord_pitch[#chord_pitch + 1] = pitch 46 | chord_prop = {} 47 | table.insert(chord_prop, note_prop) 48 | if chord_none == 0 then 49 | chord_none = chord_none + 1 50 | end 51 | elseif startppqpos <= time[2] - 120 then 52 | chord_none = 0 53 | table.insert(chord_pitch, pitch) 54 | table.insert(chord_prop, note_prop) 55 | if endppqpos > time[2] then 56 | time = {time[1], endppqpos} 57 | end 58 | end 59 | for k = 1, #chord_prop do 60 | if chord_pitch[k] < max(chord_pitch) then 61 | reaper.MIDI_SetNote(take, chord_prop[k][1], false, chord_prop[k][3], chord_prop[k][4], chord_prop[k][5], chord_prop[k][6], chord_prop[k][7], chord_prop[k][8], true) 62 | end 63 | end 64 | sel = reaper.MIDI_EnumSelNotes(take, sel) 65 | end 66 | reaper.MIDI_Sort(take) 67 | end 68 | end 69 | 70 | reaper.Undo_BeginBlock() 71 | SelectTopNotes() 72 | reaper.Undo_EndBlock("Select Top Notes In Chord (Leave Single Notes Selected)", 0) 73 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Select Bottom Notes In Chord (Leave Single Notes Selected).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Select Bottom Notes In Chord (Leave Single Notes Selected) 3 | * Instructions: Open a MIDI take in MIDI Editor. Select Notes. Run. 4 | * Version: 1.0 5 | * Author: zaibuyidao 6 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 7 | * Repository: GitHub > zaibuyidao > ReaScripts 8 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 9 | * Reference: https://forum.cockos.com/showpost.php?p=1684673&postcount=5 (gofer) 10 | * REAPER: 6.0 11 | * Donation: http://www.paypal.me/zaibuyidao 12 | --]] 13 | 14 | --[[ 15 | * Changelog: 16 | * v1.0 (2020-2-25) 17 | + Initial release 18 | --]] 19 | 20 | function SelectBottomNotes() 21 | local function min(t) 22 | local mn = nil 23 | for k, v in pairs(t) do 24 | if (mn == nil) then mn = v end 25 | if mn > v then mn = v end 26 | end 27 | return mn 28 | end 29 | 30 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 31 | local _, notecnt, _, _ = reaper.MIDI_CountEvts(take) 32 | local chord_pitch = {} 33 | local chord_prop = {} 34 | local chord_none = 0 35 | local time = {0.0, 0.0} 36 | 37 | if notecnt ~= 0 then 38 | sel = reaper.MIDI_EnumSelNotes(take, -1) 39 | while sel ~= -1 do 40 | local retval, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, sel) 41 | local note_prop = {sel, selected, muted, startppqpos, endppqpos, chan, pitch, vel} 42 | if startppqpos > time[2] - 120 then 43 | time = {startppqpos, endppqpos} 44 | chord_pitch = {} 45 | table.insert(chord_pitch, pitch) -- chord_pitch[#chord_pitch + 1] = pitch 46 | chord_prop = {} 47 | table.insert(chord_prop, note_prop) 48 | if chord_none == 0 then 49 | chord_none = chord_none + 1 50 | end 51 | elseif startppqpos <= time[2] - 120 then 52 | chord_none = 0 53 | table.insert(chord_pitch, pitch) 54 | table.insert(chord_prop, note_prop) 55 | if endppqpos > time[2] then 56 | time = {time[1], endppqpos} 57 | end 58 | end 59 | for k = 1, #chord_prop do 60 | if chord_pitch[k] > min(chord_pitch) then 61 | reaper.MIDI_SetNote(take, chord_prop[k][1], false, chord_prop[k][3], chord_prop[k][4], chord_prop[k][5], chord_prop[k][6], chord_prop[k][7], chord_prop[k][8], true) 62 | end 63 | end 64 | sel = reaper.MIDI_EnumSelNotes(take, sel) 65 | end 66 | reaper.MIDI_Sort(take) 67 | end 68 | end 69 | 70 | reaper.Undo_BeginBlock() 71 | SelectBottomNotes() 72 | reaper.Undo_EndBlock("Select Bottom Notes In Chord (Leave Single Notes Selected)", 0) 73 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Random Velocity.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Random Velocity 3 | * Version: 1.6 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | * provides: [main=main,midi_editor,midi_inlineeditor] . 11 | --]] 12 | 13 | --[[ 14 | * Changelog: 15 | * v1.0 (2019-12-12) 16 | + Initial release 17 | --]] 18 | 19 | function Msg(param) reaper.ShowConsoleMsg(tostring(param) .. "\n") end 20 | function main() 21 | local window, _, _ = reaper.BR_GetMouseCursorContext() 22 | local _, inline_editor, _, _, _, _ = reaper.BR_GetMouseCursorContext_MIDI() 23 | local diff = 127 24 | if window == "midi_editor" then 25 | if not inline_editor then 26 | take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 27 | else 28 | take = reaper.BR_GetMouseCursorContext_Take() 29 | end 30 | reaper.MIDI_DisableSort(take) 31 | _, notecnt, _, _ = reaper.MIDI_CountEvts(take) 32 | for i = 1, notecnt do 33 | _, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i - 1) 34 | vel = tonumber(math.random(diff)) 35 | if selected == true then 36 | reaper.MIDI_SetNote(take, i - 1, selected, muted, startppqpos, endppqpos, chan, pitch, vel, false) 37 | end 38 | end 39 | if not inline_editor then reaper.SN_FocusMIDIEditor() end 40 | reaper.MIDI_Sort(take) 41 | else 42 | count_sel_items = reaper.CountSelectedMediaItems(0) 43 | if count_sel_items == 0 then return end 44 | for i = 1, count_sel_items do 45 | item = reaper.GetSelectedMediaItem(0, i - 1) 46 | take = reaper.GetTake(item, 0) 47 | reaper.MIDI_DisableSort(take) 48 | if reaper.TakeIsMIDI(take) then 49 | _, notecnt, _, _ = reaper.MIDI_CountEvts(take) 50 | for i = 1, notecnt do 51 | _, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i - 1) 52 | vel = tonumber(math.random(diff)) 53 | reaper.MIDI_SetNote(take, i - 1, selected, muted, startppqpos, endppqpos, chan, pitch, vel, false) 54 | end 55 | end 56 | reaper.MIDI_Sort(take) 57 | end 58 | end 59 | end 60 | reaper.Undo_BeginBlock() 61 | main() 62 | reaper.Undo_EndBlock("Random Velocity", 0) 63 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Utility/zaibuyidao_Mouse Modifiers - Toggle Razor Editing.lua: -------------------------------------------------------------------------------- 1 | -- @description Mouse Modifiers - Toggle Razor Editing 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | local ZBYDFuncPath = reaper.GetResourcePath() .. '/Scripts/zaibuyidao Scripts/Utility/zaibuyidao_Functions.lua' 13 | if reaper.file_exists(ZBYDFuncPath) then 14 | dofile(ZBYDFuncPath) 15 | if not checkSWSExtension() or not checkJSAPIExtension() then return end 16 | else 17 | local errorMsg = "Error - Missing Script (错误 - 缺失脚本)\n\n" .. 18 | "[English]\nThe required 'zaibuyidao Functions' script file was not found. Please ensure the file is correctly placed at:\n" .. 19 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\nIf the file is missing, you can install it via ReaPack by searching for 'zaibuyidao Functions' in the ReaPack package browser.\n\n" .. 20 | "[中文]\n必需的 'zaibuyidao Functions' 脚本文件未找到。请确保文件正确放置在以下位置:\n" .. 21 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\n如果文件缺失,您可以通过 ReaPack 包浏览器搜索并安装 'zaibuyidao Functions'。\n" 22 | 23 | reaper.MB(errorMsg, "Missing Script Error/脚本文件缺失错误", 0) 24 | 25 | if reaper.APIExists('ReaPack_BrowsePackages') then 26 | reaper.ReaPack_BrowsePackages('zaibuyidao Functions') 27 | else 28 | local reapackErrorMsg = "Error - ReaPack Not Found (错误 - 未找到 ReaPack)\n\n" .. 29 | "[English]\nThe ReaPack extension is not found. Please install ReaPack to manage and install REAPER scripts and extensions easily. Visit https://reapack.com for installation instructions.\n\n" .. 30 | "[中文]\n未找到 ReaPack 扩展。请安装 ReaPack 来便捷地管理和安装 REAPER 脚本及扩展。访问 https://reapack.com 获取安装指南。\n" 31 | 32 | reaper.MB(reapackErrorMsg, "ReaPack Not Found/未找到 ReaPack", 0) 33 | end 34 | return 35 | end 36 | 37 | local marquee_selection = reaper.NamedCommandLookup('_RSe26d413e28a889ec8384d643aeb592b204e5e7e9') 38 | local time_selection = reaper.NamedCommandLookup('_RSa7b6a0054a56c6f5822b24ee2b398cd4488b449c') 39 | local razor_editing = reaper.NamedCommandLookup('_RS310aee702b4cc146de8699ea241a41e0c3d46b3d') 40 | local is_new_value, filename, sectionID, cmdID,mode, resolution, val = reaper.get_action_context() 41 | reaper.SetToggleCommandState(sectionID, marquee_selection, 0) 42 | reaper.SetToggleCommandState(sectionID, time_selection, 0) 43 | reaper.SetToggleCommandState(sectionID, razor_editing, 1) 44 | reaper.RefreshToolbar2(sectionID, cmdID) 45 | 46 | reaper.SetMouseModifier('MM_CTX_TRACK',0,'25 m') -- Select razor edit area 47 | reaper.SetMouseModifier('MM_CTX_ITEM',0,'62 m') -- Select razor edit area -------------------------------------------------------------------------------- /Utility/zaibuyidao_Mouse Modifiers - Toggle Time Selection.lua: -------------------------------------------------------------------------------- 1 | -- @description Mouse Modifiers - Toggle Time Selection 2 | -- @version 1.0.2 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | local ZBYDFuncPath = reaper.GetResourcePath() .. '/Scripts/zaibuyidao Scripts/Utility/zaibuyidao_Functions.lua' 13 | if reaper.file_exists(ZBYDFuncPath) then 14 | dofile(ZBYDFuncPath) 15 | if not checkSWSExtension() or not checkJSAPIExtension() then return end 16 | else 17 | local errorMsg = "Error - Missing Script (错误 - 缺失脚本)\n\n" .. 18 | "[English]\nThe required 'zaibuyidao Functions' script file was not found. Please ensure the file is correctly placed at:\n" .. 19 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\nIf the file is missing, you can install it via ReaPack by searching for 'zaibuyidao Functions' in the ReaPack package browser.\n\n" .. 20 | "[中文]\n必需的 'zaibuyidao Functions' 脚本文件未找到。请确保文件正确放置在以下位置:\n" .. 21 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\n如果文件缺失,您可以通过 ReaPack 包浏览器搜索并安装 'zaibuyidao Functions'。\n" 22 | 23 | reaper.MB(errorMsg, "Missing Script Error/脚本文件缺失错误", 0) 24 | 25 | if reaper.APIExists('ReaPack_BrowsePackages') then 26 | reaper.ReaPack_BrowsePackages('zaibuyidao Functions') 27 | else 28 | local reapackErrorMsg = "Error - ReaPack Not Found (错误 - 未找到 ReaPack)\n\n" .. 29 | "[English]\nThe ReaPack extension is not found. Please install ReaPack to manage and install REAPER scripts and extensions easily. Visit https://reapack.com for installation instructions.\n\n" .. 30 | "[中文]\n未找到 ReaPack 扩展。请安装 ReaPack 来便捷地管理和安装 REAPER 脚本及扩展。访问 https://reapack.com 获取安装指南。\n" 31 | 32 | reaper.MB(reapackErrorMsg, "ReaPack Not Found/未找到 ReaPack", 0) 33 | end 34 | return 35 | end 36 | 37 | local marquee_selection = reaper.NamedCommandLookup('_RSe26d413e28a889ec8384d643aeb592b204e5e7e9') 38 | local time_selection = reaper.NamedCommandLookup('_RSa7b6a0054a56c6f5822b24ee2b398cd4488b449c') 39 | local razor_editing = reaper.NamedCommandLookup('_RS310aee702b4cc146de8699ea241a41e0c3d46b3d') 40 | local is_new_value, filename, sectionID, cmdID,mode, resolution, val = reaper.get_action_context() 41 | reaper.SetToggleCommandState(sectionID, marquee_selection, 0) 42 | reaper.SetToggleCommandState(sectionID, time_selection, 1) 43 | reaper.SetToggleCommandState(sectionID, razor_editing, 0) 44 | reaper.RefreshToolbar2(sectionID, cmdID) 45 | 46 | reaper.SetMouseModifier('MM_CTX_ITEM',0,'13 m') -- Move item ignoring time selection 47 | reaper.SetMouseModifier('MM_CTX_TRACK',0,'7 m') -- Select time -------------------------------------------------------------------------------- /Utility/zaibuyidao_Cakewalk Style Cursor Follow (Main Or MIDI Editor).lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Cakewalk Style Cursor Follow (Main Or MIDI Editor) 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 7 | * Donation: http://www.paypal.me/zaibuyidao 8 | * provides: [main=main,midi_editor,midi_inlineeditor] . 9 | --]] 10 | 11 | --[[ 12 | * Changelog: 13 | * v1.0 (2022-6-30) 14 | + Initial release 15 | --]] 16 | 17 | function print(string) 18 | reaper.ShowConsoleMsg(tostring(string)..'\n') 19 | end 20 | 21 | flag = false 22 | 23 | function main() 24 | isPlay = reaper.GetPlayState() 25 | HWND = reaper.MIDIEditor_GetActive() 26 | if isPlay == 0 then 27 | if flag == false then 28 | reaper.MIDIEditor_OnCommand(HWND, 39705) -- Set default mouse modifier action for "MIDI piano roll left click" to "Deselect all notes and move edit cursor" (factory default) 29 | reaper.MIDIEditor_OnCommand(HWND, 39674) -- Set default mouse modifier action for "MIDI note left click" to "Select note and move edit cursor" (factory default) 30 | reaper.Main_OnCommand(39513, 0) -- Set default mouse modifier action for "Media item left click" to "Select item and move edit cursor" (factory default) 31 | reaper.Main_OnCommand(39577, 0) -- Set default mouse modifier action for "Track left click" to "Deselect all items and move edit cursor" (factory default) 32 | flag = true 33 | end 34 | elseif isPlay == 1 then 35 | if flag == true then 36 | reaper.MIDIEditor_OnCommand(HWND, 39707) -- Set default mouse modifier action for "MIDI piano roll left click" to "Deselect all notes" 37 | reaper.MIDIEditor_OnCommand(HWND, 39673) -- Set default mouse modifier action for "MIDI note left click" to "Select note" 38 | reaper.Main_OnCommand(39579, 0) -- Set default mouse modifier action for "Track left click" to "Deselect all items" 39 | reaper.Main_OnCommand(39515, 0) -- Set default mouse modifier action for "Media item left click" to "Select item" 40 | flag = false 41 | end 42 | end 43 | reaper.defer(main) 44 | end 45 | 46 | local _, _, sectionId, cmdId = reaper.get_action_context() 47 | if sectionId ~= -1 then 48 | reaper.SetToggleCommandState(sectionId, cmdId, 1) 49 | reaper.RefreshToolbar2(sectionId, cmdId) 50 | main() 51 | reaper.atexit(function() 52 | reaper.SetToggleCommandState(sectionId, cmdId, 0) 53 | reaper.RefreshToolbar2(sectionId, cmdId) 54 | end) 55 | end 56 | 57 | reaper.defer(function() end) -------------------------------------------------------------------------------- /Utility/zaibuyidao_Mouse Modifiers - Toggle Marquee Selection.lua: -------------------------------------------------------------------------------- 1 | -- @description Mouse Modifiers - Toggle Marquee Selection 2 | -- @version 1.0.1 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | local ZBYDFuncPath = reaper.GetResourcePath() .. '/Scripts/zaibuyidao Scripts/Utility/zaibuyidao_Functions.lua' 13 | if reaper.file_exists(ZBYDFuncPath) then 14 | dofile(ZBYDFuncPath) 15 | if not checkSWSExtension() or not checkJSAPIExtension() then return end 16 | else 17 | local errorMsg = "Error - Missing Script (错误 - 缺失脚本)\n\n" .. 18 | "[English]\nThe required 'zaibuyidao Functions' script file was not found. Please ensure the file is correctly placed at:\n" .. 19 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\nIf the file is missing, you can install it via ReaPack by searching for 'zaibuyidao Functions' in the ReaPack package browser.\n\n" .. 20 | "[中文]\n必需的 'zaibuyidao Functions' 脚本文件未找到。请确保文件正确放置在以下位置:\n" .. 21 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\n如果文件缺失,您可以通过 ReaPack 包浏览器搜索并安装 'zaibuyidao Functions'。\n" 22 | 23 | reaper.MB(errorMsg, "Missing Script Error/脚本文件缺失错误", 0) 24 | 25 | if reaper.APIExists('ReaPack_BrowsePackages') then 26 | reaper.ReaPack_BrowsePackages('zaibuyidao Functions') 27 | else 28 | local reapackErrorMsg = "Error - ReaPack Not Found (错误 - 未找到 ReaPack)\n\n" .. 29 | "[English]\nThe ReaPack extension is not found. Please install ReaPack to manage and install REAPER scripts and extensions easily. Visit https://reapack.com for installation instructions.\n\n" .. 30 | "[中文]\n未找到 ReaPack 扩展。请安装 ReaPack 来便捷地管理和安装 REAPER 脚本及扩展。访问 https://reapack.com 获取安装指南。\n" 31 | 32 | reaper.MB(reapackErrorMsg, "ReaPack Not Found/未找到 ReaPack", 0) 33 | end 34 | return 35 | end 36 | 37 | local marquee_selection = reaper.NamedCommandLookup('_RSe26d413e28a889ec8384d643aeb592b204e5e7e9') 38 | local time_selection = reaper.NamedCommandLookup('_RSa7b6a0054a56c6f5822b24ee2b398cd4488b449c') 39 | local razor_editing = reaper.NamedCommandLookup('_RS310aee702b4cc146de8699ea241a41e0c3d46b3d') 40 | local is_new_value, filename, sectionID, cmdID,mode, resolution, val = reaper.get_action_context() 41 | reaper.SetToggleCommandState(sectionID, marquee_selection, 1) 42 | reaper.SetToggleCommandState(sectionID, time_selection, 0) 43 | reaper.SetToggleCommandState(sectionID, razor_editing, 0) 44 | reaper.RefreshToolbar2(sectionID, cmdID) 45 | 46 | reaper.SetMouseModifier('MM_CTX_ITEM',0,'13 m') -- Move item ignoring time selection 47 | reaper.SetMouseModifier('MM_CTX_TRACK',0,'9 m') -- Marquee select items -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Duplicate CC.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Duplicate CC 3 | * Version: 1.0.2 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-6-12) 15 | + Initial release 16 | --]] 17 | 18 | function Msg(param) 19 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 20 | end 21 | 22 | if not reaper.SN_FocusMIDIEditor then 23 | local retval = reaper.ShowMessageBox("This script requires the SWS extension, would you like to download it now?\n這個脚本需要SWS擴展,你想現在就下載它嗎?", "Warning", 1) 24 | if retval == 1 then 25 | Open_URL("http://www.sws-extension.org/download/pre-release/") 26 | end 27 | end 28 | 29 | function main() 30 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 31 | if not take or not reaper.TakeIsMIDI(take) then return end 32 | local _, _, ccevtcnt, _ = reaper.MIDI_CountEvts(take) 33 | 34 | local source = reaper.GetExtState("DuplicateCC", "Source") 35 | if (source == "") then source = "1" end 36 | local target = reaper.GetExtState("DuplicateCC", "Target") 37 | if (target == "") then target = "11" end 38 | 39 | local retval, retvals_csv = reaper.GetUserInputs('Duplicate CC', 2, 'Source CC,Target CC', source ..','.. target) 40 | source, target = retvals_csv:match("(.*),(.*)") 41 | if not retval or not tonumber(source) or not tonumber(target) then return reaper.SN_FocusMIDIEditor() end 42 | source, target = tonumber(source), tonumber(target) 43 | 44 | if source > 127 or source < 0 or target > 127 or target < 0 then 45 | return 46 | reaper.MB("請輸入從0到127的數值", "錯誤", 0), 47 | reaper.SN_FocusMIDIEditor() 48 | end 49 | 50 | reaper.SetExtState("DuplicateCC", "Source", source, false) 51 | reaper.SetExtState("DuplicateCC", "Target", target, false) 52 | 53 | reaper.Undo_BeginBlock() 54 | reaper.MIDI_DisableSort(take) 55 | for i = 0, ccevtcnt - 1 do 56 | local _, selected, muted, ppqpos, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 57 | local _, shape, beztension = reaper.MIDI_GetCCShape(take, i) 58 | 59 | if msg2 == source then 60 | ccevtcnt = ccevtcnt + 1 61 | reaper.MIDI_InsertCC(take, selected, muted, ppqpos, chanmsg, chan, target, msg3) 62 | reaper.MIDI_SetCCShape(take, ccevtcnt - 1, shape, beztension, false) 63 | end 64 | end 65 | reaper.MIDI_Sort(take) 66 | reaper.Undo_EndBlock("Duplicate CC", -1) 67 | reaper.UpdateArrange() 68 | end 69 | 70 | main() 71 | reaper.SN_FocusMIDIEditor() -------------------------------------------------------------------------------- /Various/UCS/lib/ucs.lua: -------------------------------------------------------------------------------- 1 | -- NoIndex: true 2 | --[[ 3 | { 4 | { 5 | name = { en = "AIR", zh = "气体" }, 6 | children = { 7 | { 8 | name = { en = "BLOW", zh = "吹" }, 9 | cat_id = "AIRBlow", 10 | synonyms = { 11 | en = {"compressed air", "depressurise", "release", "puff", "sputter", "flutter"}, 12 | zh = {"压缩空气","减压","释放","吹气","溅射","颤动"} 13 | } 14 | } 15 | } 16 | } 17 | } 18 | ]] 19 | 20 | LocaleData = {__meta = {__index = {}}} 21 | setmetatable(LocaleData, { 22 | __call = function (cls, tab) 23 | tab = tab or {} 24 | setmetatable(tab, LocaleData.__meta) 25 | return tab 26 | end 27 | }) 28 | function LocaleData.__meta.__index:get(locale) 29 | if locale == nil then 30 | for _, v in pairs(self) do 31 | return v 32 | end 33 | end 34 | if self[locale] then 35 | return self[locale] 36 | end 37 | for _, v in pairs(self) do 38 | return v 39 | end 40 | end 41 | 42 | usc = {} 43 | 44 | function usc.read_from_csv(filename, result) 45 | result = result or {} 46 | 47 | local data = csv.read(filename) 48 | if #data < 2 then return end 49 | 50 | local category_map = {} 51 | local function get_category_index(name) 52 | if category_map[name] then return category_map[name] end 53 | table.insert(result, { 54 | name = LocaleData { en = name }, 55 | children = {} 56 | }) 57 | category_map[name] = #result 58 | return category_map[name] 59 | end 60 | local column_names = data[1] 61 | for i = 2, #data do 62 | local index = get_category_index(data[i][1]) 63 | result[index].name.zh = data[i][6] 64 | result[index].name.tw = data[i][9] 65 | result[index].name.ja = data[i][12] 66 | result[index].name.cat_short = data[i][4] 67 | result[index].name.cat_egory = data[i][1] 68 | table.insert(result[index].children, { 69 | name = LocaleData { 70 | en = data[i][2], 71 | zh = data[i][7], 72 | tw = data[i][10], 73 | ja = data[i][13], 74 | }, 75 | cat_id = data[i][3], 76 | synonyms = LocaleData { 77 | en = table.map(string.split(data[i][5], ","), string.trim), 78 | zh = table.map(string.split(data[i][8], ","), string.trim), 79 | tw = table.map(string.split(data[i][11], ","), string.trim), 80 | ja = table.map(string.split(data[i][14], ","), string.trim) 81 | } 82 | }) 83 | end 84 | return result 85 | end -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_List Names of Selected Items and Their Source Files.lua: -------------------------------------------------------------------------------- 1 | -- @description List Names of Selected Items and Their Source Files 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | local function Msg(str) 13 | reaper.ShowConsoleMsg(tostring(str).."\n") 14 | end 15 | 16 | reaper.PreventUIRefresh(1) 17 | count_sel_items = reaper.CountSelectedMediaItems(0) 18 | reaper.ClearConsole() 19 | 20 | local startEvents = {} 21 | 22 | for i = 0, count_sel_items - 1 do 23 | local item = reaper.GetSelectedMediaItem(0, i) 24 | local track = reaper.GetMediaItem_Track(item) 25 | local pitch = reaper.GetMediaTrackInfo_Value(track, 'IP_TRACKNUMBER') 26 | local startPos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") 27 | local take = reaper.GetActiveTake(item) 28 | if not reaper.TakeIsMIDI(take) then 29 | local takeName = reaper.GetTakeName(take) 30 | if startEvents[startPos] == nil then startEvents[startPos] = {} end 31 | local event = { 32 | ["startPos"]=startPos, 33 | ["pitch"]=pitch, 34 | ["takeName"]=takeName, 35 | ["item"]=item 36 | } 37 | 38 | table.insert(startEvents[startPos], event) 39 | end 40 | end 41 | 42 | local tempEvents = {} 43 | for i in pairs(startEvents) do 44 | table.insert(tempEvents,i) 45 | end 46 | table.sort(tempEvents,function(a,b)return (tonumber(a) < tonumber(b)) end) -- 對key進行升序 47 | 48 | local result = {} 49 | for i,v in pairs(tempEvents) do 50 | table.insert(result,startEvents[v]) 51 | end 52 | 53 | function get_file_name(dir) -- 获取文件名 54 | local os = reaper.GetOS() 55 | if os ~= "Win32" and os ~= "Win64" then 56 | return dir:match('.+/([^/]*%.%w+)$') -- osx 57 | else 58 | return dir:match('.+\\([^\\]*%.%w+)$') -- win 59 | end 60 | end 61 | 62 | local taketake = {} 63 | local j = 0 64 | for _, list in pairs(result) do 65 | for i = 1, #list do 66 | j = j + 1 67 | take = reaper.GetActiveTake(list[i].item) 68 | name = reaper.GetTakeName(take) 69 | scr = reaper.GetMediaItemTake_Source(take) 70 | filename_scr = reaper.GetMediaSourceFileName(scr) 71 | filename = get_file_name(filename_scr) 72 | table.insert(taketake, {take_name = name, flie_name = filename}) 73 | end 74 | end 75 | 76 | k = tostring(#taketake) 77 | k = #k 78 | for i, v in ipairs(taketake) do 79 | idx = i 80 | idx = string.format("%0" .. k .. "d", idx) 81 | Msg('['..idx..'] '..v.take_name..' <--> '..v.flie_name) 82 | end 83 | 84 | Msg('') 85 | Msg('Total: '..#taketake) 86 | reaper.PreventUIRefresh(-1) 87 | reaper.UpdateArrange() 88 | reaper.defer(function() end) -------------------------------------------------------------------------------- /Various/Articulation Map/banks/66-60 Spitfire Albion 2 (UACC-32).reabank: -------------------------------------------------------------------------------- 1 | //Set the Mode of Articulation-Map-JSFX to Keyswitch CC (UACC) and set the number of Keyswitch CC to 32. 2 | //---------------------------------------------------------------------------- 3 | Bank 66 60 Albion 2 - Recorder 4 | //! 66-60-40=66-32-40 5 | 40 short 6 | //! 66-60-1=66-32-1 7 | 1 long 8 | //! 66-60-20=66-32-20 9 | 20 legato 10 | 11 | 12 | //---------------------------------------------------------------------------- 13 | Bank 66 61 Albion 2 - HornEuph 14 | //! 66-61-40=66-32-40 15 | 40 short 16 | //! 66-61-42=66-32-42 17 | 42 very short 18 | //! 66-61-1=66-32-1 19 | 1 long 20 | //! 66-61-20=66-32-20 21 | 20 legato 22 | 23 | 24 | //---------------------------------------------------------------------------- 25 | Bank 66 62 Albion 2 - Sackbutt Hi 26 | //! 66-62-40=66-32-40 27 | 40 short 28 | //! 66-62-42=66-32-42 29 | 42 very short 30 | //! 66-62-52=66-32-52 31 | 52 marcato(short) 32 | //! 66-62-55=66-32-55 33 | 55 marcato(long) 34 | //! 66-62-1=66-32-1 35 | 1 long 36 | //! 66-62-20=66-32-20 37 | 20 legato 38 | 39 | 40 | //---------------------------------------------------------------------------- 41 | Bank 66 63 Albion 2 - Sackbutt Lo 42 | //! 66-63-40=66-32-40 43 | 40 short 44 | //! 66-63-42=66-32-42 45 | 42 very short 46 | //! 66-63-1=66-32-1 47 | 1 long 48 | //! 66-63-20=66-32-20 49 | 20 legato 50 | 51 | 52 | //---------------------------------------------------------------------------- 53 | Bank 66 64 Albion 2 - String Hi 54 | //! 66-64-40=66-32-40 55 | 40 short 56 | //! 66-64-47=66-32-47 57 | 47 short cs 58 | //! 66-64-56=66-32-56 59 | 56 pizzicato 60 | //! 66-64-58=66-32-58 61 | 58 col legno 62 | //! 66-64-1=66-32-1 63 | 1 long 64 | //! 66-64-5=66-32-5 65 | 5 long (half) 66 | //! 66-64-7=66-32-7 67 | 7 long cs 68 | //! 66-64-20=66-32-20 69 | 20 legato 70 | //! 66-64-24=66-32-24 71 | 24 legato (half) 72 | //! 66-64-11=66-32-11 73 | 11 tremolo 74 | //! 66-64-10=66-32-10 75 | 10 long harmonics 76 | //! 66-64-70=66-32-70 77 | 70 trill (minor) 78 | //! 66-64-71=66-32-71 79 | 71 trill (major) 80 | //! 66-64-8=66-32-8 81 | 8 long flautando 82 | 83 | 84 | //---------------------------------------------------------------------------- 85 | Bank 66 65 Albion 2 - String Lo 86 | //! 66-65-40=66-32-40 87 | 40 short 88 | //! 66-65-47=66-32-47 89 | 47 short cs (quiet) 90 | //! 66-65-44=66-32-44 91 | 44 short cs (longer) 92 | //! 66-65-56=66-32-56 93 | 56 pizzicato 94 | //! 66-65-58=66-32-58 95 | 58 col legno 96 | //! 66-65-1=66-32-1 97 | 1 long 98 | //! 66-65-5=66-32-5 99 | 5 long (half) 100 | //! 66-65-7=66-32-7 101 | 7 long cs 102 | //! 66-65-20=66-32-20 103 | 20 legato 104 | //! 66-65-24=66-32-24 105 | 24 legato (half) 106 | //! 66-65-11=66-32-11 107 | 11 tremolo 108 | //! 66-65-8=66-32-8 109 | 8 long flautando -------------------------------------------------------------------------------- /Items Editing/zaibuyidao_Scale Item Volume.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Scale Item Volume 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2021-5-22) 15 | + Initial release 16 | --]] 17 | 18 | reaper.PreventUIRefresh(1) 19 | reaper.Undo_BeginBlock() 20 | 21 | function Msg(param) 22 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 23 | end 24 | 25 | local count_item = reaper.CountSelectedMediaItems(0) 26 | if count_item == 0 then return end 27 | 28 | local item_t, pos = {}, {} 29 | for i = 0, count_item - 1 do 30 | item_t[i] = reaper.GetSelectedMediaItem(0, i) 31 | pos[i] = reaper.GetMediaItemInfo_Value(item_t[i], "D_POSITION") 32 | end 33 | 34 | local log10 = function(x) return math.log(x, 10) end 35 | local a = 20*log10(reaper.GetMediaItemInfo_Value(item_t[0], 'D_VOL')) 36 | local z = 20*log10(reaper.GetMediaItemInfo_Value(item_t[#item_t], 'D_VOL')) 37 | local n = reaper.GetExtState("ScaleItemVolume", "Toggle") 38 | if (n == "") then n = "0" end 39 | local cur_range = tostring(a)..','..tostring(z)..','..tostring(n) 40 | local retval, userInputsCSV = reaper.GetUserInputs("Scale Item Volume", 3, "Begin dB,End dB,Toggle (0=Absolute 1=Relative),extrawidth=60", cur_range) 41 | if not retval then return end 42 | local begin_db, end_db, toggle = userInputsCSV:match("(.*),(.*),(.*)") 43 | n = toggle 44 | reaper.SetExtState("ScaleItemVolume", "Toggle", n, false) 45 | local offset_0 = (end_db - begin_db) / (pos[#pos] - pos[0]) 46 | local offset_1 = (end_db - begin_db) / count_item 47 | 48 | for i = 0, count_item - 1 do 49 | local item = reaper.GetSelectedMediaItem(0, i) 50 | local item_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") 51 | local item_vol = reaper.GetMediaItemInfo_Value(item, 'D_VOL') 52 | local item_db = 20*log10(item_vol) 53 | if toggle == '0' then 54 | local new_db = (item_pos - pos[0]) * offset_0 + begin_db 55 | local delta_db = new_db - item_db 56 | reaper.SetMediaItemInfo_Value(item, 'D_VOL', item_vol*10^(0.05*delta_db)) 57 | elseif toggle == '1' then 58 | local delta_db = begin_db - item_db 59 | reaper.SetMediaItemInfo_Value(item, 'D_VOL', item_vol*10^(0.05*delta_db)) 60 | begin_db = offset_1 + begin_db 61 | if i == count_item - 1 then -- 補償最後一個數 62 | delta_db = end_db - item_db 63 | reaper.SetMediaItemInfo_Value(item, 'D_VOL', item_vol*10^(0.05*delta_db)) 64 | end 65 | end 66 | end 67 | 68 | reaper.Undo_EndBlock('Scale Item Volume', -1) 69 | reaper.PreventUIRefresh(-1) 70 | reaper.UpdateArrange() -------------------------------------------------------------------------------- /Various/Articulation Map/banks/66-50 Spitfire Masse (UACC-32).reabank: -------------------------------------------------------------------------------- 1 | //Set the Mode of Articulation-Map-JSFX to Keyswitch CC (UACC) and set the number of Keyswitch CC to 32. 2 | //---------------------------------------------------------------------------- 3 | Bank 66 50 Masse - Tutti 4 | //! 66-50-1=66-32-1 5 | 1 long 6 | //! 66-50-40=66-32-40 7 | 40 staccato 8 | //! 66-50-9=66-32-9 9 | 9 beast long 10 | //! 66-50-54=66-32-54 11 | 54 beast short 12 | //! 66-50-3=66-32-3 13 | 3 brass/string choir long 14 | //! 66-50-4=66-32-4 15 | 4 brass/string choir short 16 | //! 66-50-6=66-32-6 17 | 6 low brass string stab 18 | //! 66-50-7=66-32-7 19 | 7 low wood string stab 20 | //! 66-50-8=66-32-8 21 | 8 nutcracker 22 | //! 66-50-10=66-32-10 23 | 10 woods/string 1 long 24 | //! 66-50-11=66-32-11 25 | 11 woods/string 1 short 26 | //! 66-50-12=66-32-12 27 | 12 woods/string 2 long 28 | //! 66-50-13=66-32-13 29 | 13 woods/string 2 short 30 | 31 | 32 | //---------------------------------------------------------------------------- 33 | Bank 66 51 Masse - Strings 34 | //! 66-51-1=66-32-1 35 | 1 cool strings 1 36 | //! 66-51-2=66-32-2 37 | 2 cool strings 2 38 | //! 66-51-3=66-32-3 39 | 3 cool strings 3 40 | //! 66-51-4=66-32-4 41 | 4 cool strings 4 42 | //! 66-51-5=66-32-5 43 | 5 giant epic long 44 | //! 66-51-42=66-32-42 45 | 42 giant epic short 46 | //! 66-51-8=66-32-8 47 | 8 ligeti strings 48 | //! 66-51-56=66-32-56 49 | 56 mondo plucks 50 | //! 66-51-13=66-32-13 51 | 13 slow strings 1 52 | //! 66-51-14=66-32-14 53 | 14 slow strings 2 54 | //! 66-51-15=66-32-15 55 | 15 super slow strings 1 56 | //! 66-51-16=66-32-16 57 | 16 super slow strings 2 58 | //! 66-51-9=66-32-9 59 | 9 super cool strings 1 60 | //! 66-51-10=66-32-10 61 | 10 super cool strings 2 62 | //! 66-51-11=66-32-11 63 | 11 super cool strings 3 64 | //! 66-51-12=66-32-12 65 | 12 super cool strings 4 66 | 67 | 68 | //---------------------------------------------------------------------------- 69 | Bank 66 52 Masse - Brass 70 | //! 66-52-1=66-32-1 71 | 1 beast long 72 | //! 66-52-42=66-32-42 73 | 42 beast short 74 | //! 66-52-3=66-32-3 75 | 3 choir long 76 | //! 66-52-4=66-32-4 77 | 4 choir short 78 | //! 66-52-9=66-32-9 79 | 9 power long 80 | //! 66-52-8=66-32-8 81 | 8 super choir long 82 | //! 66-52-48=66-32-48 83 | 48 super choir short 84 | //! 66-52-6=66-32-6 85 | 6 slow choir long 86 | //! 66-52-7=66-32-7 87 | 7 super slow choir 88 | 89 | 90 | //---------------------------------------------------------------------------- 91 | Bank 66 53 Masse - Woodwinds 92 | //! 66-53-1=66-32-1 93 | 1 beast long 94 | //! 66-53-42=66-32-42 95 | 42 beast short 96 | //! 66-53-3=66-32-3 97 | 3 chorus long 98 | //! 66-53-4=66-32-4 99 | 4 chorus short 100 | //! 66-53-5=66-32-5 101 | 5 light short 102 | //! 66-53-6=66-32-6 103 | 6 orchestrator long 104 | //! 66-53-7=66-32-7 105 | 7 orchestrator shorts 106 | //! 66-53-8=66-32-8 107 | 8 slow chorus long 108 | //! 66-53-9=66-32-9 109 | 9 slow orchestrator -------------------------------------------------------------------------------- /Utility/zaibuyidao_Auto-Load VSTi for MIDI Playback (Settings).lua: -------------------------------------------------------------------------------- 1 | -- @description Auto-Load VSTi for MIDI Playback (Settings) 2 | -- @version 1.0 3 | -- @author zaibuyidao 4 | -- @changelog 5 | -- New Script 6 | -- @links 7 | -- https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 8 | -- https://github.com/zaibuyidao/ReaScripts 9 | -- @donate http://www.paypal.me/zaibuyidao 10 | -- @about Requires JS_ReaScriptAPI & SWS Extension 11 | 12 | local ZBYDFuncPath = reaper.GetResourcePath() .. '/Scripts/zaibuyidao Scripts/Utility/zaibuyidao_Functions.lua' 13 | if reaper.file_exists(ZBYDFuncPath) then 14 | dofile(ZBYDFuncPath) 15 | if not checkSWSExtension() or not checkJSAPIExtension() then return end 16 | else 17 | local errorMsg = "Error - Missing Script (错误 - 缺失脚本)\n\n" .. 18 | "[English]\nThe required 'zaibuyidao Functions' script file was not found. Please ensure the file is correctly placed at:\n" .. 19 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\nIf the file is missing, you can install it via ReaPack by searching for 'zaibuyidao Functions' in the ReaPack package browser.\n\n" .. 20 | "[中文]\n必需的 'zaibuyidao Functions' 脚本文件未找到。请确保文件正确放置在以下位置:\n" .. 21 | ZBYDFuncPath:gsub('%\\', '/') .. "\n\n如果文件缺失,您可以通过 ReaPack 包浏览器搜索并安装 'zaibuyidao Functions'。\n" 22 | 23 | reaper.MB(errorMsg, "Missing Script Error/脚本文件缺失错误", 0) 24 | 25 | if reaper.APIExists('ReaPack_BrowsePackages') then 26 | reaper.ReaPack_BrowsePackages('zaibuyidao Functions') 27 | else 28 | local reapackErrorMsg = "Error - ReaPack Not Found (错误 - 未找到 ReaPack)\n\n" .. 29 | "[English]\nThe ReaPack extension is not found. Please install ReaPack to manage and install REAPER scripts and extensions easily. Visit https://reapack.com for installation instructions.\n\n" .. 30 | "[中文]\n未找到 ReaPack 扩展。请安装 ReaPack 来便捷地管理和安装 REAPER 脚本及扩展。访问 https://reapack.com 获取安装指南。\n" 31 | 32 | reaper.MB(reapackErrorMsg, "ReaPack Not Found/未找到 ReaPack", 0) 33 | end 34 | return 35 | end 36 | 37 | local language = getSystemLanguage() 38 | 39 | reaper.Undo_BeginBlock() -- 撤销块开始 40 | 41 | local section = "AutoLoadVSTiForMIDIPlayback" 42 | local key = "VSTiName" 43 | 44 | if language == "简体中文" then 45 | title = "自动加载 VSTi 以进行 MIDI 回放(设置)" 46 | ip_title = "VSTi 设置" 47 | ip_caption = "输入 VSTi 名称:,extrawidth=150" 48 | elseif language == "繁體中文" then 49 | title = "自動加載 VSTi 以進行 MIDI 回放(設置)" 50 | ip_title = "VSTi 設置" 51 | ip_caption = "輸入 VSTi 名稱:extrawidth=150" 52 | else 53 | title = "Auto-Load VSTi for MIDI Playback (Settings)" 54 | ip_title = "VSTi Settings" 55 | ip_caption = "Enter VSTi name:extrawidth=150" 56 | end 57 | 58 | -- 尝试获取已保存的 VSTi 名称 59 | local savedVSTiName = reaper.GetExtState(section, key) 60 | if not savedVSTiName then savedVSTiName = "SOUND Canvas VA" end 61 | 62 | -- 获取用户输入的 VSTi 名称,显示已保存的名称作为默认值 63 | local retval, vstiName = reaper.GetUserInputs(ip_title, 1, ip_caption, savedVSTiName) 64 | 65 | if retval then 66 | -- 保存用户输入的 VSTi 名称为扩展状态 67 | reaper.SetExtState(section, key, vstiName, true) 68 | end 69 | 70 | reaper.Undo_EndBlock(title, -1) -- 撤销块结束 -------------------------------------------------------------------------------- /MIDI Editor/zaibuyidao_Move Events Left 10ms.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | * ReaScript Name: Move Events Left 10ms 3 | * Version: 1.0 4 | * Author: zaibuyidao 5 | * Author URI: https://www.soundengine.cn/user/%E5%86%8D%E8%A3%9C%E4%B8%80%E5%88%80 6 | * Repository: GitHub > zaibuyidao > ReaScripts 7 | * Repository URI: https://github.com/zaibuyidao/ReaScripts 8 | * REAPER: 6.0 or newer recommended 9 | * Donation: http://www.paypal.me/zaibuyidao 10 | --]] 11 | 12 | --[[ 13 | * Changelog: 14 | * v1.0 (2022-3-24) 15 | + Initial release 16 | --]] 17 | 18 | ms = -10 19 | 20 | function msg(param) 21 | reaper.ShowConsoleMsg(tostring(param) .. "\n") 22 | end 23 | 24 | if not reaper.SN_FocusMIDIEditor then 25 | local retval = reaper.ShowMessageBox("這個脚本需要SWS擴展,你想現在就下載它嗎?", "Warning", 1) 26 | if retval == 1 then 27 | Open_URL("http://www.sws-extension.org/download/pre-release/") 28 | end 29 | end 30 | 31 | local take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()) 32 | if not take or not reaper.TakeIsMIDI(take) then return end 33 | _, notes, ccs, sysex = reaper.MIDI_CountEvts(take) 34 | 35 | ms = ms / 1000 36 | 37 | function NOTES() -- 音符事件 38 | for i = 0, notes - 1 do 39 | local retval, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote(take, i) 40 | if selected == true then 41 | pro_start = (reaper.MIDI_GetProjTimeFromPPQPos(take, startppqpos)) + ms 42 | qqq_pro_start = reaper.MIDI_GetPPQPosFromProjTime(take, pro_start) 43 | pro_end = (reaper.MIDI_GetProjTimeFromPPQPos(take, endppqpos)) + ms 44 | qqq_pro_end = reaper.MIDI_GetPPQPosFromProjTime(take, pro_end) 45 | reaper.MIDI_SetNote(take, i, selected, muted, qqq_pro_start, qqq_pro_end, chan, pitch, vel, false) 46 | end 47 | end 48 | end 49 | 50 | function CCS() -- CC事件 51 | for i = 0, ccs - 1 do 52 | local retval, selected, muted, ppqpos, chanmsg, chan, msg2, msg3 = reaper.MIDI_GetCC(take, i) 53 | if selected == true then 54 | pro_ccstart = (reaper.MIDI_GetProjTimeFromPPQPos(take, ppqpos)) + ms 55 | qqq_pro_ccstart = reaper.MIDI_GetPPQPosFromProjTime(take, pro_ccstart) 56 | reaper.MIDI_SetCC(take, i, selected, muted, qqq_pro_ccstart, chanmsgIn, chanIn, msg2In, msg3In, false) 57 | end 58 | end 59 | end 60 | 61 | function SYSEX() -- Sysex事件 62 | for i = 0, sysex - 1 do 63 | local retval, selected, muted, ppqpos, types, msg = reaper.MIDI_GetTextSysexEvt(take, i) 64 | if selected == true then 65 | pro_sysstart = (reaper.MIDI_GetProjTimeFromPPQPos(take, ppqpos)) + ms 66 | qqq_pro_sysstart = reaper.MIDI_GetPPQPosFromProjTime(take, pro_sysstart) 67 | reaper.MIDI_SetTextSysexEvt(take, i, selected, muted, qqq_pro_sysstart, types, msg, false) 68 | end 69 | end 70 | end 71 | 72 | reaper.Undo_BeginBlock() 73 | reaper.MIDI_DisableSort(take) 74 | NOTES() 75 | CCS() 76 | SYSEX() 77 | reaper.MIDI_Sort(take) 78 | reaper.Undo_EndBlock("Move Events Left 10ms", -1) 79 | reaper.UpdateArrange() 80 | reaper.SN_FocusMIDIEditor() --------------------------------------------------------------------------------