- API -
dofile(reaper.AZ_GetLuaInitPath())
require("reaper_AZSTOKE_SILVER")
retval,inputList = reaper.AZ_GetUserInputList("AZWavList",2,"Path :,Loundness :","D:\\,-21")
if retval then
color = reaper.AZ_GetRandomColor()
fileList = reaper.AZ_GetFilePathList(inputList[1],"wav")
startPos = 0
for i, value in pairs(fileList) do
item = reaper.AZ_InsertMediaTrackIdSecond(0,1,fileList[i],0,startPos)
endPos = reaper.AZ_GetMediaItemEndTime(item)
name = reaper.AZ_GetMediaItemName(item)
reaper.AZ_SetMediaItemHANDAUTOMER(item,2)
reaper.AZ_SetMediaItemLoudnessMaxMomentary(item,tonumber(inputList[2]))
reaper.AZ_AddRegionMarker(0,startPos,endPos,name,i,color)
startPos = endPos + 1
end
end
- API Detail-
Prepare the Wav waveform you want to adjust in a folder
Prepare the track
- SCRIPT -
dofile(reaper.AZ_GetLuaInitPath())
require("reaper_AZSTOKE_SILVER")
・Silver API settings
retval,inputList = reaper.AZ_GetUserInputList("AZWavList",2,"Path :,Loundness :","D:\\,-21")
・Output SimpleUI, enter the folder path and loudness value, and assign it to inputList
if retval then
- Check if OK was pressed in the UI
color = reaper.AZ_GetRandomColor()
・Get a random color and assign it to color
fileList = reaper.AZ_GetFilePathList(inputList[1],"wav")
- Get all file paths in "wav" format in the input folder path and assign them to fileList
startPos = 0
・Set the starting position of the media. Assign "0" to startPos.
for i, value in pairs(fileList) do
・Play fileList in loop
item = reaper.AZ_InsertMediaTrackIdSecond(0,1,fileList[i],0,startPos)
- Specify the track ID and arrange the media according to the path information and startPos (start position) of the fileList.
Assign the inserted media item to item
endPos = reaper.AZ_GetMediaItemEndTime(item)
・Get the end point of the item and assign it to endPos
name = reaper.AZ_GetMediaItemName(item)
-Get the name of the item and assign it to name
reaper.AZ_SetMediaItemHANDAUTOMER(item,2)
・Execute "HANDAUTOMER" with compression type 2 on item
reaper.AZ_SetMediaItemLoudnessMaxMomentary(item,tonumber(inputList[2]))
・Set the loudness value of inputList to item by converting it to a number using toNumber
reaper.AZ_AddRegionMarker(0,startPos,endPos,name,i,color)
-Add a RegionMarker by specifying the start and end positions, name, ID, and color of the item.
startPos = endPos + 1
- Add +1 second to the inserted end position to set the start position
end
end