REAPDOCK👇Sort all media in ascending order
[ Python ]REAPDOCK/APIDOCK documentation update notification
Good evening.
This is Nakajima from AZSTOKE Co., Ltd.
Today is the weekly document update Friday - Python edition. "Sort all media (waveforms) in ascending order"
This is the script.
Here are some points to note when creating a script.
The API output values are always in order. Therefore, use [_] to get the items you want to output in the order you want. Example: retval,_,_,mediaList[i]["name"],_= AZ_GetMediaName(0,i,"",1024)
This time, we are using sorted to sort the names in ascending order. Since the array to be sorted must be a normal array, we create a separate sortList and sort the mediaList in ascending order in conjunction with that sortList.
When setting a type such as ["name"] to an array, you can extract the variable by simply using mediaList[i]["name"].
Before studying this script, you need to understand the following documents:
If/for/tabel are essential knowledge, so this document is designed to help those who understand the following four documents take a step forward. *A plan subscription is required to view this document.
*3: [AZ_sorted: Sorts an array based on the elements within the array]
*4: [AZ_if: Conditional testing using if] By using the BRONZE API, this can be achieved with fewer lines of code!
Next episode: 2/28
[REAPDOCK] Set "_NG" to the file name of all selected media: LUA version
LINK
New to Reaper/those considering subscribing to a plan
For detailed documentation of [REAPDOCK]Script, see below.
>Reference materials
[APIDOCK] See below for the APIs used in the script
AZ_GetMediaTypeCount > Count of all media (including the number of specified formats) AZ_GetMediaItemSelect
> Get media (select media acquisition method)
> Get the media name of the specified media ID AZ_GetMediaLength
>Get the length (in seconds) of the specified media
> Set the start time of a specific media item
Comments