I found another strange thing with RS5K. When I add RS5K to track and set parameters of them by only using ReaScript without any moments of focusing RS5K, if I play it, I cannot hear any sounds from it.
Here is simplified my code.
Code:
local title = reaper.JS_Localize("Media Explorer", "common")
local hwnd = reaper.JS_Window_Find(title, true)
if not hwnd then return end
local container = reaper.JS_Window_FindChildByID(hwnd, 0)
local listview = reaper.JS_Window_FindChildByID(container, 1000)
local count_si, idx_si = reaper.JS_ListView_ListAllSelItems(listview)
if count_si == 0 then return end
local combo = reaper.JS_Window_FindChildByID(hwnd, 1002)
local edit = reaper.JS_Window_FindChildByID(combo, 1001)
local dir = reaper.JS_Window_GetTitle(edit, "", 1024)
local path = {}
local count_si = 0
for idx in string.gmatch(idx_si, "[^,]+") do
local filetype = reaper.JS_ListView_GetItemText(listview, tonumber(idx), 3)
if filetype == "wav" then
local filename = reaper.JS_ListView_GetItemText(listview, tonumber(idx), 0)
count_si = count_si + 1
path[count_si] = dir .. "\\" .. filename
end
end
local track = reaper.GetSelectedTrack(0, 0)
if not track then return end
for i = 1, count_si do
local fxidx = reaper.TrackFX_AddByName(track, "ReaSamplOmatic5000 (Cockos)", false, -1)
reaper.TrackFX_SetNamedConfigParm(track, fxidx, "FILE0", path[i])
reaper.TrackFX_SetParamNormalized(track, fxidx, 2, 0) -- gain for minimum velocity
reaper.TrackFX_SetParamNormalized(track, fxidx, 3, (48 + i) / 127) -- note range start
reaper.TrackFX_SetParamNormalized(track, fxidx, 4, (48 + i) / 127) -- note range end
reaper.TrackFX_SetParamNormalized(track, fxidx, 8, 0) -- max voices
reaper.TrackFX_SetParamNormalized(track, fxidx, 9, 0) -- attack
end
And... here are the steps to reproduce this issue.
1. Make a track and select it.
2. Open media explorer.
3. Select a item or items
4. Run this script.
5. Create a MIDI item and insert notes.
6. And play it. You cannot hear any sounds from RS5K.
And... these steps are a temporary solution.
1. Open FX chain window.
2. Click each of the RS5Ks.