Skip to content

Commit

Permalink
New: Get Item Timecodes for Tracklist, Enhanced: Adjust Start Offset,…
Browse files Browse the repository at this point in the history
… MMC CLCR > 20 bugfix
  • Loading branch information
junh1024 committed Oct 4, 2024
1 parent 774fc5f commit 43b17dc
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Converters/Multi Mix Convert (L).txt
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ mode_in==17?
mode_out==2?
(
//faster than a loop
spl0+=(spl2*0.71)+spl4+spl6+spl8+spl10+spl12+spl14+spl16+spl18*0.71+spl19*0.4;
spl1+=(spl2*0.71)+spl5+spl7+spl9+spl11+spl13+spl15+spl17+spl19*0.71+spl18*0.4;
spl0+=(spl2*0.71)+spl4+spl6+spl8+spl10+spl12+spl14+spl16+spl18*0.9+spl19*0.4;
spl1+=(spl2*0.71)+spl5+spl7+spl9+spl11+spl13+spl15+spl17+spl19*0.9+spl18*0.4;

// i=4;

Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Mac:

- HOMEFOLDER/Library/Application Support/REAPER/Effects

It is advised to ENABLE **"options > show in FX list > JSFX filename"** in your FX browser, as I refer to them by name. Bugs/suggestions? File an [issue](https://github.com/junh1024/Reaper-Surround/issues) , or contact me on [twitter](https://twitter.com/junh1024/) .
Bugs/suggestions? File an [issue](https://github.com/junh1024/Reaper-Surround/issues) , or contact me on [twitter](https://twitter.com/junh1024/) .

Alternatively, [this video](https://www.youtube.com/watch?v=9EegrN-gF5o) shows how to install JSFX.

Expand Down Expand Up @@ -109,7 +109,8 @@ Upmixers are considered experimental, based on matrix or FFT.
- 2.0 to 3.0 Upmix (C).txt (manual upmixer, all the others are automatic)
- 2.0 to 5.0 Upmix V2 (L).txt: 80% feature-complete DPL1-like surround upmixer with 0 audio latency, but a behavioral latency [Note 1](#note-1) . It works best as LCR upmixer [Note 2](#note-2), and that's the new default as of 2024.
- 2.0 to 5.0 Upmix V3 (S).txt: Upmix based on FFT for maximum separation. [see FFT Notes](#fft-notes) for controls & explanation. It's Competitive with commercial upmixers. Features:
- Basic image controls
- Basic image controls (Width & Depth)
- Diffusion (to descrase artefacts)
- Doesn't lie about PDC
- Doesn't have an incorrect/downmix-incompatible bass level (bass is not moved/copied to LFE. It's blank.)
- CPU optimized (CPU use depends on channel output)
Expand Down Expand Up @@ -276,12 +277,14 @@ outputs=8 ; number of audio outputs (0-64)

### Mac/VST3 users

You will need to use [**YSFX**](https://github.com/JoepVanlier/ysfx/releases/tag/v0.0.2) and extract the VST3 into:
You will need to use YSFX. Unfortunately, YSFX has [FFT issues](https://github.com/jpcima/ysfx/issues/66) so it rules out most of the interesting ones, and has trouble finding dependencies. I've made a small archive of a few interesting FX & their dependancies for YSFX users below. Includes a small selection incl V2 & V3 upmix. More plugins are possible, as long as YSFX can see dependancies (dependancies in same folder, or subfolder of JSFX)

- Windows: C:\Program Files\Common Files\VST3
- Mac: Library\Audio\Plug-ins\VST

Unfortunately, YSFX has [FFT issues](https://github.com/jpcima/ysfx/issues/66) so it rules out most of the interesting ones, and has trouble finding dependencies. I've made a small archive of 2 interesting FX & their dependancies for YSFX users [**here**](https://github.com/junh1024/Reaper-Surround/releases/download/0.2105/Reaper-Surround-YSFX.zip) .
1. Install [**YSFX**](https://github.com/JoepVanlier/ysfx/releases) (see *Assets*) and extract the AU &/ VST3 into:
- Mac VST3: Library\Audio\Plug-ins\VST
- Mac AU: Library\Audio\Plug-ins\Components
- Windows VST3: C:\Program Files\Common Files\VST3
2. Extract ALL files from [**here**](https://github.com/junh1024/Reaper-Surround/releases/download/0.2105/YSFX-FX.zip) into a folder.
3. Open your DAW, insert YSFX-S FX, and load the effects in YSFX.

### AAX Compatibility
AAX Compatibility for Pro Tools Windows is limited due to the FILM order for channels and limited options for channel count. I haven't tested this.
Expand Down
26 changes: 19 additions & 7 deletions Scripts/Adjust Start Offset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
desc=""
desc="Adjust item start offset"
by="junh1024"

from reaper_python import *
Expand All @@ -23,18 +23,30 @@ def msg(m):
with undoable(desc):
# RPR_ShowConsoleMsg(BPM_proj)

#get file BPM
dialogstring="amount"
theoffset = RPR_GetUserInputs("Adjust take by how much secs",1,dialogstring,"",64)[4]
multiply=None

#get desired offset
ds="Adjust by secs (* to multiply)"
theoffset = RPR_GetUserInputs("Adjust Start Offset",1,ds,"",64)[4]

#account for multiply, and trim off star
if theoffset[0]=='*':
multiply=True
theoffset=theoffset[1:]
theoffset = float(theoffset.strip())
# RPR_ShowConsoleMsg(new_gain_bits)


#get items
for i in range (RPR_CountSelectedMediaItems( 0)):
MI=RPR_GetSelectedMediaItem(0,i)

# set gain
# get original offset
take=RPR_GetActiveTake(MI)
original=RPR_GetMediaItemTakeInfo_Value( take, "D_STARTOFFS" )
RPR_SetMediaItemTakeInfo_Value( take, "D_STARTOFFS", original+ theoffset )

# could use reflection, but more insecure
if multiply:
RPR_SetMediaItemTakeInfo_Value( take, "D_STARTOFFS", original* theoffset )
else:
RPR_SetMediaItemTakeInfo_Value( take, "D_STARTOFFS", original+ theoffset )

93 changes: 93 additions & 0 deletions Scripts/Get Item Timecodes for Tracklist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
desc="Get item start timecodes for mix tracklist"
by="junh1024"

from reaper_python import *
from contextlib import contextmanager

# fast string building https://waymoot.org/home/python_string/
from io import StringIO
file_str = StringIO()

# https://stackoverflow.com/a/24507708 convert seconds to HMS
from time import strftime, gmtime

# https://stackoverflow.com/a/44144136 get filename w/o ext

@contextmanager
def undoable(message):
RPR_Undo_BeginBlock2(0)
try:
yield
finally:
RPR_Undo_EndBlock2(0, message, -1)

debug = True

def msg(m):
if 'debug' in globals():
RPR_ShowConsoleMsg(m)

# msg(RPR_CountSelectedMediaItems(0))

with undoable(desc):

my_dict = {}

for i in range (RPR_CountSelectedMediaItems( 0)):
MI=RPR_GetSelectedMediaItem(0,i)

take_name = None
item_pos = None
item_pos_in_my_dict = None
item_pos = RPR_GetMediaItemInfo_Value(MI, "D_POSITION")

# set start time for songs almost at the start to 0
if item_pos <=5:
item_pos = 0

try:
take=RPR_GetActiveTake(MI)
take_name=RPR_GetTakeName( take ).rsplit('.', maxsplit=1)[0] # w/o ext
except:
# not a media
continue

# if not muted
if (RPR_GetMediaItemInfo_Value( MI, "B_MUTE"))== True :
continue

# check if take is MIDI https://forums.cockos.com/showthread.php?t=254697
# skip MIDI takes
# if "MIDI" in take_name:
# continue
if RPR_TakeIsMIDI(take):
continue

# if song not in my_dict
if take_name not in my_dict:
# RPR_ShowConsoleMsg("can add")
my_dict.update({take_name:item_pos})
continue


# if current item pos is earlier than one in my_dict, update it
item_pos_in_my_dict=my_dict.get(take_name)
if item_pos<item_pos_in_my_dict :
my_dict.update({take_name:item_pos})

# sort songs by start time with python 3.7
# https://stackoverflow.com/questions/613183/how-do-i-sort-a-my_dictionary-by-value
my_dict=dict(sorted(my_dict.items(), key=lambda item: item[1]))

# set time of 1st song to 0
# my_dict.update({my_dict.items()[0][0]:0})

# put timecodes & filenames into string

n=1
for name, time in my_dict.items():
# file_str.write(str(n)+'. '+strftime("%M:%S", gmtime(time)) +' '+name+'\r\n')
file_str.write(strftime("%M:%S", gmtime(time)) +' '+name+'\r\n')
n+=1

RPR_ShowConsoleMsg(file_str.getvalue())

0 comments on commit 43b17dc

Please sign in to comment.