Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 08-19-2021, 07:08 PM   #1
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default Script: Link media explorer to active sample player (RS5k)

Hi guys,

here's a script that will hopefully be a quality of life improvement for users of ReaSamplOmatic5000

It creates a link between an instance of ReaSamplomatic and the media explorer. As long as the link is active, all relevant settings of the media explorer will be transferred to that RS5k window:

1. Selected files (Multiple files are added as velocity layers)
2. Time selection
3. Volume (Respects the option "Normalize preview volume if peak volume has been calculated")
4. Pitch

The link will break automatically (and the script will stop running) when the FX window is closed.




While we're at it, here's another goodie for your media explorer toolbar:
(Or at least that was the idea but the media explorer toolbar is currently bugged, so a normal toolbar will have to do for now)

Bonus script: Insert media into sample player on next played note(s)

Usage is simple:

1. Select file in media explorer
2. Run script
3. Play note on your midi controller OR click on piano roll in MIDI editor

When using your MIDI controller the sample player will be inserted on the selected track.
When clicking on the piano roll the sample player will be inserted on the track associated with that MIDI item.

Note 1: You can set a range of notes by adding more notes before releasing the first one.
Note 2: If existing instances of ReaSamplOmatic are assigned to the same note (or conflict with the note range) they will be removed.



You can find all of my scripts on github or download them using ReaPack:
Copy and paste this link into: Extensions > ReaPack > Import a repository
Code:
https://raw.githubusercontent.com/iliaspoulakis/Reaper-Tools/master/index.xml
Donation Link
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 08-19-2021, 10:13 PM   #2
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 1,501
Default

Hmmm... for whatever reason (obviously on my end!), the screen on the RS5K goes black when I run the script. I can see the media being linked, but there's no sound coming out of the track. Turning the script off leaves the RS5K black but dragging a sample returns it back to normal...




What am I doing wrong?
Pink Wool is offline   Reply With Quote
Old 08-19-2021, 11:59 PM   #3
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by Pink Wool View Post
What am I doing wrong?
Ah, found it! You're using a database (shame on you ), so the combobox at the top is not displaying a valid file path. I'll try to think of a good solution for that. Thanks for reporting back!
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 08-20-2021, 01:05 AM   #4
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

I think I found an adequate solution, it should work with DBs now as well. Update is online
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 08-20-2021, 02:03 AM   #5
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 1,501
Default

Works perfectly now! What an amazing script! Thank you FeedTheCat!
Pink Wool is offline   Reply With Quote
Old 08-20-2021, 05:17 AM   #6
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,669
Default

great work, thank you! love this:

Quote:
3. Play note on your midi controller OR click on piano roll in MIDI editor

When using your MIDI controller the sample player will be inserted on the selected track.
i cobbled together something similar last year and it's been really nice to have RS5K instances generated based off of last-touched midi notes. (: your version is a lot nicer)
mccrabney is offline   Reply With Quote
Old 08-20-2021, 07:55 AM   #7
Daodan
Human being with feelings
 
Join Date: Jan 2011
Posts: 1,167
Default

Awersome!
Daodan is offline   Reply With Quote
Old 08-20-2021, 11:59 AM   #8
Daodan
Human being with feelings
 
Join Date: Jan 2011
Posts: 1,167
Default

Unfortunately running script makes reaper laggy. like FPS drops a bit. video demonstration https://youtu.be/rIdkn8ZkLjs
I definitely can live with it, but maybe there is some way to avoid that?
Daodan is offline   Reply With Quote
Old 08-21-2021, 05:41 AM   #9
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by Daodan View Post
Unfortunately running script makes reaper laggy. like FPS drops a bit. video demonstration https://youtu.be/rIdkn8ZkLjs
I definitely can live with it, but maybe there is some way to avoid that?
Try the latest update. Should be much smoother now. Found out that certain operations are a lot slower on Windows than they are on Linux
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 08-21-2021, 07:06 AM   #10
Daodan
Human being with feelings
 
Join Date: Jan 2011
Posts: 1,167
Default

Quote:
Originally Posted by FeedTheCat View Post
Try the latest update. Should be much smoother now. Found out that certain operations are a lot slower on Windows than they are on Linux
You rock! Thanks
Daodan is offline   Reply With Quote
Old 08-21-2021, 08:58 AM   #11
kartalex
Human being with feelings
 
Join Date: Dec 2015
Posts: 172
Default

Awesome!
kartalex is offline   Reply With Quote
Old 08-21-2021, 02:34 PM   #12
Daodan
Human being with feelings
 
Join Date: Jan 2011
Posts: 1,167
Default I did it!

Now you can change samples but stay in the same key! If sample have "KEY" tag. video demo: https://youtu.be/_KxCvv5omUc

Code:
function MediaExplorer_GetSelectedAudioFiles()

    local show_full_path = reaper.GetToggleCommandStateEx(32063, 42026) == 1
    local show_leading_path = reaper.GetToggleCommandStateEx(32063, 42134) == 1
    local forced_full_path = false

    local path_hwnd = reaper.JS_Window_FindChildByID(mx, 1002)
    local path = reaper.JS_Window_GetTitle(path_hwnd)

    local mx_list_view = reaper.JS_Window_FindChildByID(mx, 1001)
    local _, sel_indexes = reaper.JS_ListView_ListAllSelItems(mx_list_view)

    local sep = package.config:sub(1, 1)
    local sel_files = {}
    local peaks = {}

    for index in string.gmatch(sel_indexes, '[^,]+') do
        index = tonumber(index)
        local file_name = reaper.JS_ListView_GetItem(mx_list_view, index, 0)
        
        if IsAudioFile(file_name) then
            -- Check if file_name is valid path itself (for searches and DBs)
            if not reaper.file_exists(file_name) then
                file_name = path .. sep .. file_name
            end

            -- If file does not exist, try enabling option that shows full path
            if not show_full_path and not reaper.file_exists(file_name) then
                show_full_path = true
                forced_full_path = true
                -- Browser: Show full path in databases and searches
                reaper.JS_WindowMessage_Send(mx, 'WM_COMMAND', 42026, 0, 0, 0)
                file_name = reaper.JS_ListView_GetItem(mx_list_view, index, 0)
            end

            -- Check if file_name is valid path itself (for searches and DBs)
            if not reaper.file_exists(file_name) then
                file_name = path .. sep .. file_name
            end
            sel_files[#sel_files + 1] = file_name
            local peak = reaper.JS_ListView_GetItem(mx_list_view, index, 21)
            peaks[#peaks + 1] = tonumber(peak)
            
            --edited start--
            file_name1 = file_name 
            --edited end--
            
        end
    end

    -- Restore previous settings
    if forced_full_path then
        -- Browser: Show full path in databases and searches
        reaper.JS_WindowMessage_Send(mx, 'WM_COMMAND', 42026, 0, 0, 0)

        if show_leading_path then
            -- Browser: Show leading path in databases and searches
            reaper.JS_WindowMessage_Send(mx, 'WM_COMMAND', 42134, 0, 0, 0)
        end
    end

    return sel_files, peaks
end
Code:
-- Update files on change
        if have_files_changed then
            SetNamedConfigParm(container, container_idx, '-FILE*', '')
            for f = 1, file_cnt do
                SetNamedConfigParm(container, container_idx, '+FILE0', files[f])
            end
            SetNamedConfigParm(container, container_idx, 'DONE', '')
            
            --edited start--
            
            --get "Key" tag from source--
            local source1 = reaper.PCM_Source_CreateFromFile(file_name1)
            retval, src_key = reaper.CF_GetMediaSourceMetadata( source1, "KEY", src_key )
            reaper.PCM_Source_Destroy(source1)
            
            --Set pitch start (root note) from "Key" tag--
            
            if src_key == "C"  then root_note = 60
        elseif src_key == "C#" then root_note = 61
        elseif src_key == "D"  then root_note = 62
        elseif src_key == "D#" then root_note = 63
        elseif src_key == "E"  then root_note = 64
        elseif src_key == "F"  then root_note = 65
        elseif src_key == "F#" then root_note = 66
        elseif src_key == "G"  then root_note = 67
        elseif src_key == "G#" then root_note = 68
        elseif src_key == "A"  then root_note = 69
        elseif src_key == "A#" then root_note = 70
        elseif src_key == "B"  then root_note = 71
            end
            
            local st = 0.00625 --One Semitone For PitchStart knob
            if root_note then 
            reaper.TrackFX_SetParamNormalized( container, container_idx, 5, 0.5-root_note*st ) -- Pith@start
            end
            --edited end--
        end
--edited start--
what was added to code
--edited end--

It works but... maybe someone will do better

Last edited by Daodan; 08-21-2021 at 03:05 PM.
Daodan is offline   Reply With Quote
Old 08-21-2021, 03:16 PM   #13
permeke
Human being with feelings
 
Join Date: Dec 2019
Posts: 588
Default

Quote:
Originally Posted by FeedTheCat View Post
Hi guys,

here's a script that will hopefully be a quality of life improvement for users of ReaSamplOmatic5000

It creates a link between an instance of ReaSamplomatic and the media explorer. As long as the link is active, all relevant settings of the media explorer will be transferred to that RS5k window:

1. Selected files (Multiple files are added as velocity layers)
2. Time selection
3. Volume (Respects the option "Normalize preview volume if peak volume has been calculated")
4. Pitch

The link will break automatically (and the script will stop running) when the FX window is closed.




While we're at it, here's another goodie for your media explorer toolbar:
(Or at least that was the idea but the media explorer toolbar is currently bugged, so a normal toolbar will have to do for now)

Bonus script: Insert media into sample player on next played note(s)

Usage is simple:

1. Select file in media explorer
2. Run script
3. Play note on your midi controller OR click on piano roll in MIDI editor

When using your MIDI controller the sample player will be inserted on the selected track.
When clicking on the piano roll the sample player will be inserted on the track associated with that MIDI item.

Note 1: You can set a range of notes by adding more notes before releasing the first one.
Note 2: If existing instances of ReaSamplOmatic are assigned to the same note (or conflict with the note range) they will be removed.



You can find all of my scripts on github or download them using ReaPack:
Copy and paste this link into: Extensions > ReaPack > Import a repository
Code:
https://raw.githubusercontent.com/iliaspoulakis/Reaper-Tools/master/index.xml
Donation Link

Can I ask, what gorgeous theme are you using ?
permeke is offline   Reply With Quote
Old 08-22-2021, 09:16 AM   #14
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by Daodan View Post
Now you can change samples but stay in the same key! If sample have "KEY" tag. video demo: https://youtu.be/_KxCvv5omUc
Wow, great idea! Hmmm, thinking that it would also be pretty cool to have that for the MX directly. Like a "Lock to key" script that adjusts the MX pitchwheel when you change file selection... Not sure that's possible though...

Quote:
Originally Posted by permeke View Post
Can I ask, what gorgeous theme are you using ?
Echolot (with a few tweaks)
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 11-16-2021, 09:30 AM   #15
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

@Daodan

I just posted a script which might be of interest to you. Haven't added support for the KEY metadata tags, but we can surely add that down the line
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 12-24-2021, 09:13 AM   #16
Stevie
Human being with feelings
 
Stevie's Avatar
 
Join Date: Feb 2015
Location: Ukraine, Russia
Posts: 255
Default

Hey @FeedTheCat i try to add yours link to ReaPack and nothing happenes, any idea why is it ?

__________________
Spotify
Stevie is offline   Reply With Quote
Old 12-24-2021, 09:39 AM   #17
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by Stevie View Post
Hey @FeedTheCat i try to add yours link to ReaPack and nothing happenes, any idea why is it ?
Looks like it's already there, 4th from the bottom
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 12-24-2021, 10:07 AM   #18
Stevie
Human being with feelings
 
Stevie's Avatar
 
Join Date: Feb 2015
Location: Ukraine, Russia
Posts: 255
Default

Quote:
Originally Posted by FeedTheCat View Post
Looks like it's already there, 4th from the bottom
Hmm, but Scripts does not appear in actions window
Sorry, i will give a feedback once i figure it out
__________________
Spotify
Stevie is offline   Reply With Quote
Old 12-25-2021, 08:04 PM   #19
tpunk
Human being with feelings
 
Join Date: Dec 2019
Posts: 72
Default

excuse me.
Like the image, neither ON nor OFF is displayed.
Will the script work if I do something?

I forgot to attach the image.
Attached Images
File Type: png link.PNG (3.2 KB, 103 views)
tpunk is offline   Reply With Quote
Old 12-26-2021, 05:28 AM   #20
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by tpunk View Post
excuse me.
Like the image, neither ON nor OFF is displayed.
Will the script work if I do something?

I forgot to attach the image.
I think on/off is not displayed until you run the script once. Is the media explorer open when you run the script? The script does nothing when it is closed.

I just pushed a small update that will warn you if the media explorer is not open etc., maybe that helps.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 12-26-2021, 07:53 AM   #21
Spookye
Human being with feelings
 
Spookye's Avatar
 
Join Date: Jul 2018
Location: Torino, Italia
Posts: 734
Default

Thanks FTC! Works well!
I take this opportunity and I ask you a question ..... (because we are in the conversation ...)
- How do you integrate a toolbar into MeX?
-Is it done in the traditional way? Or has Reaper updated a dedicated method ??
Thanks for your scripts .....
I forgot ......... Happy Holidays.
__________________
Cupboard Home Studio YT
https://www.youtube.com/channel/UCm8...X1912MA260ELzg
Spookye is offline   Reply With Quote
Old 12-26-2021, 09:12 AM   #22
tpunk
Human being with feelings
 
Join Date: Dec 2019
Posts: 72
Default

Thank you for the updates and advice.
However, when I am doing it with both Media Explorer and RS5K open, I get this message.
I doubt myself.

postscript

Is it possible that the translated REAPER will not be recognized?
Attached Images
File Type: png link2.PNG (25.6 KB, 102 views)

Last edited by tpunk; 12-26-2021 at 09:19 AM. Reason: For additional questions
tpunk is offline   Reply With Quote
Old 12-26-2021, 10:08 AM   #23
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by tpunk View Post
Thank you for the updates and advice.
However, when I am doing it with both Media Explorer and RS5K open, I get this message.
I doubt myself.

postscript

Is it possible that the translated REAPER will not be recognized?
Indeed, it seems like JS_Reascript API has an issue with your translation file. Which language pack are you using? (I'd investigate and report to Julian)

I did push another update which now opens the MX if not found by ReascriptAPI, so I think it should work for you now.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 12-26-2021, 10:28 AM   #24
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by Spookye View Post
Thanks FTC! Works well!
I take this opportunity and I ask you a question ..... (because we are in the conversation ...)
- How do you integrate a toolbar into MeX?
-Is it done in the traditional way? Or has Reaper updated a dedicated method ??
Thanks for your scripts .....
I forgot ......... Happy Holidays.
I used to run my scripts from a normal toolbar docked to the bottom of the MX because there were some issues with the media explorer toolbar, but they have been fixed in the latest dev builds.

Now I'm docking the media explorer toolbar at the bottom of the MX and run my scripts from there. In the latest dev builds it's also possible to dock the toolbar inside the MX (at the top), but I don't really like that.



Happy holidays
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 12-26-2021, 01:52 PM   #25
Spookye
Human being with feelings
 
Spookye's Avatar
 
Join Date: Jul 2018
Location: Torino, Italia
Posts: 734
Default

Ah OK! Now it's clearer. Thanks 1000
__________________
Cupboard Home Studio YT
https://www.youtube.com/channel/UCm8...X1912MA260ELzg
Spookye is offline   Reply With Quote
Old 12-26-2021, 02:18 PM   #26
Spookye
Human being with feelings
 
Spookye's Avatar
 
Join Date: Jul 2018
Location: Torino, Italia
Posts: 734
Default

OOh ... wow !! I also tried MX Tuner again now (... at the debut it didn't work smoothly for me ...) .... amazing! Another "small" very useful tool and an integral part of the MX. Thank you so much FTC ...... really cool!
__________________
Cupboard Home Studio YT
https://www.youtube.com/channel/UCm8...X1912MA260ELzg
Spookye is offline   Reply With Quote
Old 12-26-2021, 06:29 PM   #27
tpunk
Human being with feelings
 
Join Date: Dec 2019
Posts: 72
Default

Quote:
Originally Posted by FeedTheCat View Post
Indeed, it seems like JS_Reascript API has an issue with your translation file. Which language pack are you using? (I'd investigate and report to Julian)

I did push another update which now opens the MX if not found by ReascriptAPI, so I think it should work for you now.

Now works with translated REAPER. FeedTheCat Thank you so much for working on this!

I don't know if it's necessary because it has been resolved, but the one available at the following location is the translation file I used.

https://github.com/Phroneris/ReaperJ...neris/releases
tpunk is offline   Reply With Quote
Old 05-16-2022, 05:52 AM   #28
Jonson N.
Human being with feelings
 
Join Date: May 2022
Posts: 17
Default

Quote:
Originally Posted by Daodan View Post
Now you can change samples but stay in the same key! If sample have "KEY" tag. video demo: https://youtu.be/_KxCvv5omUc

Code:
function MediaExplorer_GetSelectedAudioFiles()

    local show_full_path = reaper.GetToggleCommandStateEx(32063, 42026) == 1
    local show_leading_path = reaper.GetToggleCommandStateEx(32063, 42134) == 1
    local forced_full_path = false

    local path_hwnd = reaper.JS_Window_FindChildByID(mx, 1002)
    local path = reaper.JS_Window_GetTitle(path_hwnd)

    local mx_list_view = reaper.JS_Window_FindChildByID(mx, 1001)
    local _, sel_indexes = reaper.JS_ListView_ListAllSelItems(mx_list_view)

    local sep = package.config:sub(1, 1)
    local sel_files = {}
    local peaks = {}

    for index in string.gmatch(sel_indexes, '[^,]+') do
        index = tonumber(index)
        local file_name = reaper.JS_ListView_GetItem(mx_list_view, index, 0)
        
        if IsAudioFile(file_name) then
            -- Check if file_name is valid path itself (for searches and DBs)
            if not reaper.file_exists(file_name) then
                file_name = path .. sep .. file_name
            end

            -- If file does not exist, try enabling option that shows full path
            if not show_full_path and not reaper.file_exists(file_name) then
                show_full_path = true
                forced_full_path = true
                -- Browser: Show full path in databases and searches
                reaper.JS_WindowMessage_Send(mx, 'WM_COMMAND', 42026, 0, 0, 0)
                file_name = reaper.JS_ListView_GetItem(mx_list_view, index, 0)
            end

            -- Check if file_name is valid path itself (for searches and DBs)
            if not reaper.file_exists(file_name) then
                file_name = path .. sep .. file_name
            end
            sel_files[#sel_files + 1] = file_name
            local peak = reaper.JS_ListView_GetItem(mx_list_view, index, 21)
            peaks[#peaks + 1] = tonumber(peak)
            
            --edited start--
            file_name1 = file_name 
            --edited end--
            
        end
    end

    -- Restore previous settings
    if forced_full_path then
        -- Browser: Show full path in databases and searches
        reaper.JS_WindowMessage_Send(mx, 'WM_COMMAND', 42026, 0, 0, 0)

        if show_leading_path then
            -- Browser: Show leading path in databases and searches
            reaper.JS_WindowMessage_Send(mx, 'WM_COMMAND', 42134, 0, 0, 0)
        end
    end

    return sel_files, peaks
end
Code:
-- Update files on change
        if have_files_changed then
            SetNamedConfigParm(container, container_idx, '-FILE*', '')
            for f = 1, file_cnt do
                SetNamedConfigParm(container, container_idx, '+FILE0', files[f])
            end
            SetNamedConfigParm(container, container_idx, 'DONE', '')
            
            --edited start--
            
            --get "Key" tag from source--
            local source1 = reaper.PCM_Source_CreateFromFile(file_name1)
            retval, src_key = reaper.CF_GetMediaSourceMetadata( source1, "KEY", src_key )
            reaper.PCM_Source_Destroy(source1)
            
            --Set pitch start (root note) from "Key" tag--
            
            if src_key == "C"  then root_note = 60
        elseif src_key == "C#" then root_note = 61
        elseif src_key == "D"  then root_note = 62
        elseif src_key == "D#" then root_note = 63
        elseif src_key == "E"  then root_note = 64
        elseif src_key == "F"  then root_note = 65
        elseif src_key == "F#" then root_note = 66
        elseif src_key == "G"  then root_note = 67
        elseif src_key == "G#" then root_note = 68
        elseif src_key == "A"  then root_note = 69
        elseif src_key == "A#" then root_note = 70
        elseif src_key == "B"  then root_note = 71
            end
            
            local st = 0.00625 --One Semitone For PitchStart knob
            if root_note then 
            reaper.TrackFX_SetParamNormalized( container, container_idx, 5, 0.5-root_note*st ) -- Pith@start
            end
            --edited end--
        end
--edited start--
what was added to code
--edited end--

It works but... maybe someone will do better
If someone was able to introduce this modification, please share script. I took many hours to add this code, but I get an error every time. Thank you in advance!
Jonson N. is offline   Reply With Quote
Old 05-16-2022, 08:46 AM   #29
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by Jonson N. View Post
If someone was able to introduce this modification, please share script. I took many hours to add this code, but I get an error every time. Thank you in advance!
You could just use MX Tuner together with the Link script.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 05-16-2022, 12:05 PM   #30
Jonson N.
Human being with feelings
 
Join Date: May 2022
Posts: 17
Default

Quote:
Originally Posted by FeedTheCat View Post
You could just use MX Tuner together with the Link script.
I use it, it's great! if it imports a sample, the key in midi editor does not match. I have to change pitch@start settings all the time. The modification that Daodan made would have solved my problem.
Jonson N. is offline   Reply With Quote
Old 09-19-2022, 03:03 PM   #31
Demian D
Human being with feelings
 
Demian D's Avatar
 
Join Date: Sep 2022
Location: México
Posts: 8
Default

Hi FeedTheCat thank you for this scripts! I made 6 scripts based on your "Insert media into sample player", they are:

- Insert Media File into RS5K instance
- Export Item to RS5K instance
- Export RS5K source to item
- Replace RS5K source with selected media file
- Replace RS5K source with selected item
- Replace Item Source with selected media file

Also they have a prevent undo function so they only leave 1 undo point.
I'm pretty new to programming so it doesn't work with multiple items.

You can find them on my github: https://github.com/DemianDeVante/Rea...%20from%20Main

Hope someone else finds this useful!
Demian D is offline   Reply With Quote
Old 09-20-2022, 02:24 AM   #32
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by Demian D View Post
Hi FeedTheCat thank you for this scripts! I made 6 scripts based on your "Insert media into sample player", they are:

- Insert Media File into RS5K instance
- Export Item to RS5K instance
- Export RS5K source to item
- Replace RS5K source with selected media file
- Replace RS5K source with selected item
- Replace Item Source with selected media file

Also they have a prevent undo function so they only leave 1 undo point.
I'm pretty new to programming so it doesn't work with multiple items.

You can find them on my github: https://github.com/DemianDeVante/Rea...%20from%20Main

Hope someone else finds this useful!
Nice!
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 11-19-2022, 10:39 AM   #33
horneusz
Human being with feelings
 
horneusz's Avatar
 
Join Date: Aug 2013
Location: Poland
Posts: 105
Default

Is it possible to replace the RS5K with other samplers? For example, NI Kontakt or Waves CR8?
horneusz is offline   Reply With Quote
Old 11-19-2022, 02:52 PM   #34
souk21
Human being with feelings
 
souk21's Avatar
 
Join Date: Mar 2021
Posts: 463
Default

Thank you! This is a super cool addition

I had a small issue with the mx volume not being reflected in ReaSamplomatic.
Don't know if it's os related, but on my end the ID used to find the volume refers to the "dB" label.
The actual ID for the volume value seems to be 997 here.
Code:
--line 152
function MediaExplorer_GetVolume()
    -- local vol_hwnd = reaper.JS_Window_FindChildByID(mx, 1047)
    local vol_hwnd = reaper.JS_Window_FindChildByID(mx, 997)
    local vol = reaper.JS_Window_GetTitle(vol_hwnd)
    return tonumber(vol:match('[^%a]+'))
end
Fwiw I'm using v6.68 and macos12.3

edit: ah, I see in your screenshot that the dB label includes the value, which is not the case on macos

souk21 is online now   Reply With Quote
Old 11-20-2022, 08:14 PM   #35
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
Default

Quote:
Originally Posted by horneusz View Post
Is it possible to replace the RS5K with other samplers? For example, NI Kontakt or Waves CR8?
Forget the others, RS5k is best. (Only you might not know it yet.)
TonE is offline   Reply With Quote
Old 11-20-2022, 08:17 PM   #36
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
Default

Quote:
Originally Posted by Demian D View Post
Hi FeedTheCat thank you for this scripts! I made 6 scripts based on your "Insert media into sample player", they are:

- Insert Media File into RS5K instance
- Export Item to RS5K instance
- Export RS5K source to item
- Replace RS5K source with selected media file
- Replace RS5K source with selected item
- Replace Item Source with selected media file[/url]
Thanks for sharing.
A few more variant ideas:
- Replace RS5K source with next media file in same directory
- Replace RS5K source with prev media file in same directory
- Replace RS5K source with random media file in same directory
TonE is offline   Reply With Quote
Old 12-01-2022, 05:06 AM   #37
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by souk21 View Post
Thank you! This is a super cool addition

I had a small issue with the mx volume not being reflected in ReaSamplomatic.
Don't know if it's os related, but on my end the ID used to find the volume refers to the "dB" label.
The actual ID for the volume value seems to be 997 here.
Code:
--line 152
function MediaExplorer_GetVolume()
    -- local vol_hwnd = reaper.JS_Window_FindChildByID(mx, 1047)
    local vol_hwnd = reaper.JS_Window_FindChildByID(mx, 997)
    local vol = reaper.JS_Window_GetTitle(vol_hwnd)
    return tonumber(vol:match('[^%a]+'))
end
Fwiw I'm using v6.68 and macos12.3

edit: ah, I see in your screenshot that the dB label includes the value, which is not the case on macos

Thx, I'll add a MacOS specific fix when I find some time.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 12-01-2022, 05:07 AM   #38
FeedTheCat
Human being with feelings
 
FeedTheCat's Avatar
 
Join Date: May 2019
Location: Berlin
Posts: 2,164
Default

Quote:
Originally Posted by horneusz View Post
Is it possible to replace the RS5K with other samplers? For example, NI Kontakt or Waves CR8?
Highly doubt it.
__________________
Featured scripts: REAPER Update UtilityLil ChordboxGridbox/Adaptive gridMX TunerRS5K LinkMIDI Editor Magic Donate💝: PayPal|ko-fi
FeedTheCat is offline   Reply With Quote
Old 12-08-2022, 11:04 PM   #39
bjclulu
Human being with feelings
 
Join Date: Feb 2016
Posts: 52
Default

Great tool for ReaSamplOmatic5000
thank you
Attached Images
File Type: jpg reverse2.jpg (52.1 KB, 75 views)
bjclulu is offline   Reply With Quote
Old 12-22-2022, 01:08 AM   #40
BenjyO
Human being with feelings
 
Join Date: Nov 2011
Posts: 308
Default

Hi FTC, I stumbled upon a bug (I think) with the Insert media into sample player on next played note(s) script but I can't seem to figure out what exactly is the issue. I have 2 MIDI controllers connected to the computer:
- Korg microKEY Air
- Novation Launchpad X
When I press the note(s) on the Korg keyboard, the script does what is expected. When I do the same on the Launchpad though, the script gets stuck on the "Play a note!" window and doesn't continue. It's like it's not obeying the note-off messages from the controller. It's also weird that it doesn't work when I try to "help" it by pressing the keys on the Korg keyboard (to get it to register note-offs). It remains stuck and I have to manually close the window.
Of course this wouldn't be an issue if I always had both controllers connected but since I sometimes use the Launchpad only, I'd like to see it work too.
I monitored the incoming MIDI messages from the Launchpad with ReaControlMIDI and it's normal. Sometimes (depending on how you press the pads) it sends aftertouch messages but only if you keep pressing the key. Most of the time it sends normal note-on + note-off pairs but as I described above, the script doesn't work in these cases either.
What do you think?
__________________
Check out some of my music
BenjyO is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.