|
|
|
11-16-2021, 09:25 AM
|
#1
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
MX Tuner
A simple utility for the media explorer to determine the key of samples.
Quickly determine what key your sample is in
... on a neat little dockable keyboard.
Tune samples to a key of your choice (lock pitch)
Left-click on the keyboard to lock all samples to a specific key. While going through samples. the pitch dial will be adjusted accordingly.
Right-click to open settings menu
Note: I wrote my own pitch detection algorithm, which was quite the daunting task. It works quite well for the material I tested it on, and is fairly fast so that it can run in lua. I also included a simple FFT-based approach which might work better on some material. But there's definitely more sophisticated algorithms out there. If somebody wants to contribute an algorithm, send me the code and I'll gladly add it to the script as an option
Credit to the user Daodan for the idea and inspiration
All of my scripts are available on GitHub or ReaPack:
Extensions > ReaPack > Import a repository
Code:
https://raw.githubusercontent.com/iliaspoulakis/Reaper-Tools/master/index.xml
If you like my scripts please consider sending me all your money here
Last edited by FeedTheCat; 04-24-2022 at 03:28 AM.
|
|
|
11-16-2021, 12:16 PM
|
#2
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
|
To me FFT seems verx viable. I used FFT for JSFXes in eel2 language. Here it is rather easy to use and very fast. Is am FFT system function provided for LUA ?
-Michael
|
|
|
11-16-2021, 01:16 PM
|
#3
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by mschnell
To me FFT seems verx viable. I used FFT for JSFXes in eel2 language. Here it is rather easy to use and very fast. Is am FFT system function provided for LUA ?
-Michael
|
Yes, the same FFT functions are also available for lua.
|
|
|
11-16-2021, 02:33 PM
|
#4
|
Human being with feelings
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,797
|
This is very useful, thx a lot
|
|
|
11-16-2021, 10:24 PM
|
#5
|
Human being with feelings
Join Date: Jun 2020
Posts: 656
|
I can't seem to be able to run it on my system Os Mojave R v6.40, it doesn't show a message or anything, it just doesn't run but it did go on another computer with m1 chip and latest os.. I tried reinstalling but nothing, any way I can know what could be causing this?
|
|
|
11-17-2021, 12:46 AM
|
#6
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by tonalstates
I can't seem to be able to run it on my system Os Mojave R v6.40, it doesn't show a message or anything, it just doesn't run but it did go on another computer with m1 chip and latest os.. I tried reinstalling but nothing, any way I can know what could be causing this?
|
Hi tonalstates,
thx for reporting. Does it work when you run the script through the main section of the action list? The media explorer section currently has a few issues with scripts and custom actions.
|
|
|
11-17-2021, 10:10 AM
|
#7
|
Human being with feelings
Join Date: Sep 2018
Location: HH
Posts: 916
|
Interesting idea. Thanks
|
|
|
11-17-2021, 11:16 AM
|
#8
|
Human being with feelings
Join Date: Jun 2020
Posts: 656
|
Quote:
Originally Posted by FeedTheCat
Does it work when you run the script through the main section of the action list?
|
No, that's pretty much what I did from the start, I didn't even try the MX section o: I'll try it on MX section when I get home to see if anything goes different. Thank you.
|
|
|
11-17-2021, 01:33 PM
|
#9
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by tonalstates
No, that's pretty much what I did from the start, I didn't even try the MX section o: I'll try it on MX section when I get home to see if anything goes different. Thank you.
|
Hmmm, that's unlikely to change anything... I can't really think of something that would cause this though. I'm assuming other scripts with GUIs work fine on that install?
Quote:
Originally Posted by tonalstates
any way I can know what could be causing this?
|
If you're comfortable touching some code you could try to add the following to line 621 (above reaper.defer(Main)):
Code:
reaper.ShowConsoleMsg("I'm running\n")
gfx.update()
That would at least confirm that the script is actually running.
|
|
|
11-17-2021, 01:56 PM
|
#10
|
Human being with feelings
Join Date: Jun 2020
Posts: 656
|
@FeedTheCat
Yeah, everything else, even your other scripts, run just fine.
Ok, I'll try that, thanks for helping out.
|
|
|
11-17-2021, 05:24 PM
|
#11
|
Human being with feelings
Join Date: Jun 2020
Posts: 656
|
Ok... so I don't know what I did, because I didn't do anything really but now it works! hahaha why? I will never know. But yay! Still, thanks for your help and this nifty script.
|
|
|
11-18-2021, 02:56 AM
|
#12
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by tonalstates
Ok... so I don't know what I did, because I didn't do anything really but now it works! hahaha why? I will never know. But yay! Still, thanks for your help and this nifty script.
|
Sure np, glad it works
|
|
|
11-18-2021, 07:01 AM
|
#13
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
Interesting!
I would say that Yin algorithm is a must have for pitch detection :P (or even pYin)
This is what I use in combination with aubiopitch. It is quite good for most signal which (monophonic single note)
There are several code version of it if you don't want to use dependency, I think there is one in JS cookdsp, maybe in pitch tracking JS, and in various libraries on github in other language.
(note: this is not a FR, I rarely use single note sample these days, but maybe it can interest you or users of this script :P)
|
|
|
11-18-2021, 10:15 AM
|
#14
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
running the script gives me this :
MX Tuner.lua:354: bad argument #2 to '__index' (index out of range)
|
|
|
11-18-2021, 02:26 PM
|
#15
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
@X-Raym
Yeah, something like Yin would indeed be nice. I started writing a cross-correlation based algorithm in lua, but it was so painfully slow that I gave up on it. The best solution is probably something like MPL did for his PitchEditor, running the algorithm in eel and then sending the result to lua. I might look into that in the future. I'm rather curious to find out how well my algorithm is doing in comparison.
@permeke
Oops, should be fixed now
|
|
|
11-18-2021, 03:27 PM
|
#16
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
Quote:
Originally Posted by FeedTheCat
@X-Raym
Yeah, something like Yin would indeed be nice. I started writing a cross-correlation based algorithm in lua, but it was so painfully slow that I gave up on it. The best solution is probably something like MPL did for his PitchEditor, running the algorithm in eel and then sending the result to lua. I might look into that in the future. I'm rather curious to find out how well my algorithm is doing in comparison.
@permeke
Oops, should be fixed now
|
Ok, I can load it now but still behaving weird. I can't dock it although docking is selected and I don't see the menus, only the keyboard.
I'm on OSX Catalina
|
|
|
11-18-2021, 04:01 PM
|
#17
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by permeke
Ok, I can load it now but still behaving weird. I can't dock it although docking is selected and I don't see the menus, only the keyboard.
I'm on OSX Catalina
|
Not sure I understand, the menu doesn't open when you right click? How are you docking it without the menu?
|
|
|
11-18-2021, 04:40 PM
|
#18
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
Quote:
Originally Posted by FeedTheCat
Not sure I understand, the menu doesn't open when you right click? How are you docking it without the menu?
|
I meant the icons below the keyboard. They don't show up.
I can right click, it shows the menu. Docking is activated but nothing happens
|
|
|
11-19-2021, 03:23 AM
|
#19
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by permeke
I meant the icons below the keyboard. They don't show up.
I can right click, it shows the menu. Docking is activated but nothing happens
|
The items below the keyboard are my toolbars. Might be a bit confusing because of how it looks on Linux. I open the script by pressing on a toolbar button in the first script
I just pushed a small change to the docking behavior. Let me know if it changes anything.
Here's how docking should look on Catalina:
|
|
|
11-19-2021, 03:39 AM
|
#20
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
Quote:
Originally Posted by FeedTheCat
The items below the keyboard are my toolbars. Might be a bit confusing because of how it looks on Linux. I open the script by pressing on a toolbar button in the first script
ah oh OK, understood. Neat solution.
I just pushed a small change to the docking behavior. Let me know if it changes anything.
Here's how docking should look on Catalina:
|
Docking doesn't work for me here. I'll will try to reinstall the script.
|
|
|
11-19-2021, 03:39 AM
|
#21
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
Quote:
Originally Posted by FeedTheCat
The items below the keyboard are my toolbars. Might be a bit confusing because of how it looks on Linux. I open the script by pressing on a toolbar button in the first script
I just pushed a small change to the docking behavior. Let me know if it changes anything.
Here's how docking should look on Catalina:
|
neat !
|
|
|
11-19-2021, 05:33 AM
|
#22
|
Human being with feelings
Join Date: Jan 2011
Posts: 1,167
|
Awesome!
|
|
|
11-19-2021, 08:37 AM
|
#23
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
V1.02 installed.
No docking possible.
|
|
|
11-19-2021, 09:53 AM
|
#24
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
@permeke
I just pushed v1.1 with more changes to docking, hopefully this does the trick.
If not, are there any other scripts you are using where docking works?
@all
In v1.1 the keyboard colors are now taken from the active reaper theme.
|
|
|
11-19-2021, 10:15 AM
|
#25
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
did the V1.1 install.
Same issue. activating / deactivating doesn't make it dockable here.
if this helps > when I resize the window and change docking state it goes back to it's previous size.
No theme colouring also.
yes I have various docked scripts working
But it works so that is cool.
|
|
|
11-19-2021, 11:33 AM
|
#26
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by permeke
No theme colouring also.
|
Most themes have a very similar black/white color scheme for keys, so it isn't always obvious.
Quote:
Originally Posted by permeke
if this helps > when I resize the window and change docking state it goes back to it's previous size.
|
That's a byproduct of the latest fix attempt... I reverted the changes in v1.1.1.
Just thought of something though... Maybe the crash you had before corrupted some internal values. Check out v1.1.2.
Edit: Nvm, v1.1.2. is unlikely to solve the issue if what I'm thinking is correct.
Last edited by FeedTheCat; 11-19-2021 at 12:00 PM.
|
|
|
11-19-2021, 12:25 PM
|
#27
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
I'm sorry still nothing. Let me know if you need any assistance.
btw, the resize thingy is solved
|
|
|
11-19-2021, 01:00 PM
|
#28
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by permeke
I'm sorry still nothing. Let me know if you need any assistance.
btw, the resize thingy is solved
|
Hopefully v1.1.3 does the trick!
|
|
|
11-19-2021, 01:10 PM
|
#29
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
Quote:
Originally Posted by FeedTheCat
Hopefully v1.1.3 does the trick!
|
YES !!!!!
thank you
|
|
|
11-20-2021, 02:05 AM
|
#30
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by permeke
YES !!!!!
thank you
|
Awesome! Thanks for the help
|
|
|
11-20-2021, 08:10 AM
|
#31
|
Human being with feelings
Join Date: Dec 2019
Posts: 588
|
your theme looks nice . what is it ?
|
|
|
11-20-2021, 03:25 PM
|
#32
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by permeke
your theme looks nice . what is it ?
|
Echolot with a few tweaks.
|
|
|
11-21-2021, 03:46 AM
|
#33
|
Human being with feelings
Join Date: Nov 2006
Posts: 855
|
Hi,
Love this thanks!
Would it be possible for the sample to keep playing after clicking the Tuner keyboard?
I know this may well be a limitation out of your hands, but it would be rather wonderful,
Thanks
Michael
|
|
|
11-21-2021, 08:06 AM
|
#34
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
@todd_r
Check out v1.2, think it should work now.
|
|
|
11-21-2021, 06:59 PM
|
#35
|
Human being with feelings
Join Date: Nov 2006
Posts: 855
|
Wow thanks for the quick response! Perfect
|
|
|
11-21-2021, 07:13 PM
|
#36
|
Human being with feelings
Join Date: Nov 2006
Posts: 855
|
Made an action to open it with Media Explorer, it's now a default part or Media Explorer for me
|
|
|
11-21-2021, 09:58 PM
|
#37
|
Human being with feelings
Join Date: Dec 2017
Location: Sunny Siberian Islands
Posts: 957
|
Very cool! Thanks!
Can the script read file names? I noticed that sometimes the script is wrong with the key, although the name of the note is written in the file name. This may be an idea for further upgrades: the script can first of all check the file name and, if there is no note name, only then start the FFT analysis. In theory, this will improve accuracy and reduce processing time.
But I immediately see one difficulty: how to determine the name of the note from the title. I think the mask in the form of " E " (with spaces), "_E_", "-E-", as well as the addition of sharps and flats, will help to highlight the notes from the full name.
/
|
|
|
11-22-2021, 04:53 AM
|
#38
|
Human being with feelings
Join Date: May 2019
Location: Berlin
Posts: 2,164
|
Quote:
Originally Posted by todd_r
Made an action to open it with Media Explorer, it's now a default part or Media Explorer for me
|
Nice, glad you like it!
Quote:
Originally Posted by cool
Very cool! Thanks!
Can the script read file names? I noticed that sometimes the script is wrong with the key, although the name of the note is written in the file name. This may be an idea for further upgrades: the script can first of all check the file name and, if there is no note name, only then start the FFT analysis. In theory, this will improve accuracy and reduce processing time.
But I immediately see one difficulty: how to determine the name of the note from the title. I think the mask in the form of " E " (with spaces), "_E_", "-E-", as well as the addition of sharps and flats, will help to highlight the notes from the full name.
/
|
It doesn't parse file names atm, but it's a good idea. I was already planning to check file metadata for the "KEY" tag, then I'll just include file names as well.
|
|
|
11-24-2021, 07:11 AM
|
#39
|
Human being with feelings
Join Date: Feb 2015
Posts: 753
|
Wow!!!
This is a great addition to Reaper for the 2021!
Now all Reaper needs is a Chord Track.
|
|
|
12-09-2021, 07:28 PM
|
#40
|
Human being with feelings
Join Date: Feb 2015
Posts: 753
|
Ok, I've notice that the reaper.new_array() has a limited size.
What's is the max sample length that this can analyze. I know it's somewhere under a minute.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:26 PM.
|