top of page
- Script Code -

dofile(reaper.AZ_GetLuaInitPath()) 

require("reaper_AZSTOKE_BRONZE")

require("reaper_AZSTOKE_SILVER") 

require("reaper_AZSTOKE_GOLD") 


reaper.AZ_DeleteAllRegion(0)


itemList = reaper.AZ_GetSelectedMediaItemList(0)

color = reaper.AZ_GetRandomColor() 


--Region setting

for i, item in pairs(itemList) do

    startPos = reaper.AZ_GetMediaItemStartTimeSeconds(item)

    endPos = reaper.AZ_GetMediaItemEndTime(item)

    name = reaper.AZ_GetMediaItemName(item)

    reaper.AZ_AddRegionMarker(0, startPos, endPos, name, 0, color)

end


--render setting

path = reaper.AZ_SetProjectPathFolder("Rec", 3)

render = {

    OutputDir = path,

    Channels = 1,

    FileName = "$region",

    RenderingRangeType = 5,

}

   

--render

fileList = reaper.AZ_RenderToAudioFile(0, render)


if reaper.AZ_Wwise_Connect("127.0.0.1",  8080) then

   parentPath = "\\Actor-Mixer Hierarchy\\Default Work Unit"

   workunit = reaper.AZ_Wwise_CreateWorkUnit(parentPath,  "PL0000", true)

   mixer = reaper.AZ_Wwise_CreateActorMixer(workunit["Path"], "pl0000", true)

   container = reaper.AZ_Wwise_CreateContainer(mixer["ID"], reaper.AZ_Wwise_ContainerType_Blend(), "pl0000_az", true)

   

   for i, filePath in pairs(fileList) do

       fileName = reaper.AZ_GetPathInfo(filePath)["FileNameWithoutExtension"]

       wwiseObj = reaper.AZ_Wwise_CreateSoundSFX(container["ID"], filePath, fileName, "PL0000", true)

   end

   

   parentPath = "\\Events"

   workunit = reaper.AZ_Wwise_CreateWorkUnit(parentPath,  "PL0000", true)

   

   reaper.AZ_Wwise_DeleteObject(workunit["Path"] .. "\\" .. container["Name"])


   event = reaper.AZ_Wwise_CreateEvent(workunit["ID"], container["Name"], 2, container["ID"])

   

   reaper.AZ_Wwise_AddActionToEvent(event["ID"], 1, container["ID"])


   

   parentPath = "\\SoundBanks\\Default Work Unit"

   soundBank = reaper.AZ_Wwise_CreateObject(parentPath, "AZ_Bank", "SoundBank", true)

   

   reaper.AZ_Wwise_AddObjectToSoundBank(soundBank["ID"], workunit["ID"])

   

   reaper.AZ_Wwise_GenerateSoundBank({soundBank["Name"]}, {"Windows"}, {"Japanese"})

   

   reaper.AZ_Wwise_Disconnect()

end

- Warm Up -

  1. Arrange the files you want to export within the Reaper project

- Script Detail -

dofile(reaper.AZ_GetLuaInitPath()) 

require("reaper_AZSTOKE_BRONZE")

require("reaper_AZSTOKE_SILVER") 

require("reaper_AZSTOKE_GOLD") 


・Import RIGDOCKS


reaper.AZ_DeleteAllRegion(0)


・Delete all current regions


itemList = reaper.AZ_GetSelectedMediaItemList(0)


・Get the selected media items as an array


color = reaper.AZ_GetRandomColor() 


・Get a color at random


--Region setting

for i, item in pairs(itemList) do


・Process each selected waveform


    startPos = reaper.AZ_GetMediaItemStartTimeSeconds(item)


・Get the media start position


    endPos = reaper.AZ_GetMediaItemEndTime(item)


・Get the media end position


    name = reaper.AZ_GetMediaItemName(item)


・Get the media name


    reaper.AZ_AddRegionMarker(0, startPos, endPos, name, 0, color)


・Set a region per media using the retrieved info


end


--render setting

path = reaper.AZ_SetProjectPathFolder("Rec", 3)


・Set the export destination folder in the project file


render = {

    OutputDir = path,

    Channels = 1,

    FileName = "$region",

    RenderingRangeType = 5,

}


・Configure the render settings

   

--render

fileList = reaper.AZ_RenderToAudioFile(0, render)


・Run rendering and get the path info


if reaper.AZ_Wwise_Connect("127.0.0.1",  8080) then


・Connect to Wwise


   parentPath = "\\Actor-Mixer Hierarchy\\Default Work Unit"


・Set the parent path where you want to create the work unit


   workunit = reaper.AZ_Wwise_CreateWorkUnit(parentPath,  "PL0000", true)


・Generate the PL0000 work unit


   mixer = reaper.AZ_Wwise_CreateActorMixer(workunit["Path"], "pl0000", true)


・Generate the pl0000 Actor-Mixer


   container = reaper.AZ_Wwise_CreateContainer(mixer["ID"], reaper.AZ_Wwise_ContainerType_Blend(), "pl0000_az", true)


・Generate the pl0000_az Blend Container


   for i, filePath in pairs(fileList) do


・Run for each file exported from Reaper


       fileName = reaper.AZ_GetPathInfo(filePath)["FileNameWithoutExtension"]


・Get the file name


       wwiseObj = reaper.AZ_Wwise_CreateSoundSFX(container["ID"], filePath, fileName, "PL0000", true)


・Create a Sound SFX object with the same name as the file


   end

   

   parentPath = "\\Events"


・Set the parent path for Event generation


   workunit = reaper.AZ_Wwise_CreateWorkUnit(parentPath,  "PL0000", true)


・Generate the PL0000 work unit


   reaper.AZ_Wwise_DeleteObject(workunit["Path"] .. "\\" .. container["Name"])


・Delete an event with the same name if it exists

   

   event = reaper.AZ_Wwise_CreateEvent(workunit["ID"], container["Name"], 2, container["ID"])


・Generate an Event under the work unit and set the Blend Container's Stop action

   

   reaper.AZ_Wwise_AddActionToEvent(event["ID"], 1, container["ID"])


・Add the Blend Container's Play action to the added event

   

   parentPath = "\\SoundBanks\\Default Work Unit"


・Set the SoundBank path


   soundBank = reaper.AZ_Wwise_CreateObject(parentPath, "AZ_Bank", "SoundBank", true)


・Generate the [AZ_Bank] bank

   

   reaper.AZ_Wwise_AddObjectToSoundBank(soundBank["ID"], workunit["ID"])


・Add the event's parent work unit to the bank

   

   reaper.AZ_Wwise_GenerateSoundBank({soundBank["Name"]}, {"Windows"}, {"Japanese"})


・Generate the SoundBank

   

   reaper.AZ_Wwise_Disconnect()

   

・Disconnect from Wwise


end


- API LINK -
- API LINK -

Wwise

AZSTOKE_Wwise_FullAuto_Bank_5

Automate SoundBank Generate - improved version 4 -

01_BRONZE_ss_edited.png
01_SILVER_edited_edited.png
03_GOLD_edited_edited.png
bottom of page