Old 12-14-2019, 01:13 AM   #1921
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Put the Msg("notes_in_num "..notes_in_num)
under
if notes_in_num > 0 and play_state == 0 then

then it will only print when it gets a note.

EDIT: You seem to have it set on all midi all channels can you just set it to the keyboard ?
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-14-2019, 01:58 AM   #1922
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

This is updated to insert the track and FX:

midi input start record.lua
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-14-2019, 01:24 PM   #1923
LarrySeyer
Human being with feelings
 
LarrySeyer's Avatar
 
Join Date: Sep 2006
Location: Bastrop, Tx
Posts: 169
Default

Quote:
Originally Posted by MusoBob View Post
This is updated to insert the track and FX:

midi input start record.lua
Thank you. This is an improvement for sure.

It was a very nice try. And it sort of works. But it is not really doing what it needs to do.

For instance, when you run the plugin it forces you to create a new track. If you don't, it gets stuck in an endless loop asking you to select a track or create a new one. That shouldn't be part of the process at all. But I understand this is necessary to try to get Reaper to behave as intended. Although the endless loop is probably not what you were intending.

Creating a new track doesn't really work properly because the Virtual instrument is already created on another track. I need to record on the track I've already created - not create a new one that doesn't have my instrument on it already.

Also, about 50% of the time, this function needs to work while I'm inside of the MIDI editor. This script forces me to work in the arrangement window - on a new track that has no instrument on it. Not ideal obviously.

I don't want to sound ungrateful, because I am very grateful for your help!

I'm learning a ton from your code. But the script is not doing what it needs to do.

Here is what SHOULD happen with a 'wait on MIDI note' scenerio:

The user depresses a button (or hits a keystroke) and the TRANSPORT goes into a record wait mode with a visual indicator that it is armed and waiting.... It is armed but doesn't start moving/recording until a MIDI event is heard. (note, sustain pedal, whatever)

When a MIDI event is played (either from a physical keyboard or from the virtual keyboard), the transport should go into record. It doesn't matter if you're in the arrangement window or the MIDI editor. The first note is placed exactly where the cursor was placed.

If you're frustrated with this and want to give up, I'll totally understand. I'll keep screwing around with this and see if I can make it perform like it should perform, but I really really think this is something that needs to be coded from the Reaper Transport native code. There needs to be a 'wait for MIDI note to start recording' button ON the transport.

But I would really appreciate your help in getting something that does what I need it to do.

You have been very helpful and I am grateful for all of your help. Perhaps I could help you in the future with something I am an expert in.

In the meantime, I will continue 'hacking' along and see if I can hack something that does what I need it to do. Unless, you have something else to try.

All the very best to you!

Larry
LarrySeyer is offline   Reply With Quote
Old 12-14-2019, 03:27 PM   #1924
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

If you give me a example of the work flow, are you playing an audio track then punch in the midi parts ?
How do you stop record ?
Maybe if you do a video or gif in DP.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-14-2019, 06:48 PM   #1925
LarrySeyer
Human being with feelings
 
LarrySeyer's Avatar
 
Join Date: Sep 2006
Location: Bastrop, Tx
Posts: 169
Default

Quote:
Originally Posted by MusoBob View Post
If you give me a example of the work flow, are you playing an audio track then punch in the midi parts ?
How do you stop record ?
Maybe if you do a video or gif in DP.
This feature is also available in ProTools... Perhaps a page explaining how it works in ProTools could help me explain to you how it is used and why it is needed:

https://www.pro-tools-expert.com/hom...only-two-hands

Fruity Loop has a similar feature... here is their explanation page:

https://fl-studio-help.github.io/ja/..._transport.htm

In Digital Performer it is exactly the same... but I don't have DP on this computer so I can't make an example video for you. But it works just the same as the ProTools 'Wait for MIDI Note' feature works.

I hope this helps with the explanation.

BTW, 'wait for midi to start recording' can be enabled in the arrangement window OR in the MIDI event editor. The window you are currently using has no affect on the ability to 'wait for MIDI' to start recording MIDI.

Thanks again for your help.

Larry
LarrySeyer is offline   Reply With Quote
Old 12-14-2019, 07:52 PM   #1926
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Yes that's how I set it up to work. But have you got to have the first note recorded or can you just hit any key to start record then play ? There maybe a way to record those first notes with the script then add them into the start of the midi item with the script.
I found this https://forums.cockos.com/showthread...99#post1860399
but I thinks it's much the same as I made.
To download the script click the link then right click on RAW and save link Record - toggle wait for MIDI note

I also made it start record while playing by adding

Code:
if notes_in_num > -1 and play_state == 0 or play_state == 1 then
The current script should ask if you want to insert a track.
But to take that out remove the code between the 2 functions

function create_midi_input_track()
....
end

all code here remove

local function btn_click()
....
end
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

Last edited by MusoBob; 12-14-2019 at 08:05 PM.
MusoBob is offline   Reply With Quote
Old 12-14-2019, 08:26 PM   #1927
LarrySeyer
Human being with feelings
 
LarrySeyer's Avatar
 
Join Date: Sep 2006
Location: Bastrop, Tx
Posts: 169
Default

Quote:
Originally Posted by MusoBob View Post
But have you got to have the first note recorded or can you just hit any key to start record then play ?
Absolutely!

Ideally, you just play what you want to hear and the system records what you play... no need to hit any special key to start recording. Having to hit a key to start recording would defeat the whole purpose of a 'wait for MIDI note' to record.

The whole idea is to start playing your instrument and the DAW starts recording when you start playing.


Quote:
Originally Posted by MusoBob View Post
There maybe a way to record those first notes with the script then add them into the start of the midi item with the script.
I found this https://forums.cockos.com/showthread...99#post1860399
but I thinks it's much the same as I made.
To download the script click the link then right click on RAW and save link Record - toggle wait for MIDI note
OK, I'll give that a try.

Quote:
Originally Posted by MusoBob View Post

I also made it start record while playing by adding

Code:
if notes_in_num > -1 and play_state == 0 or play_state == 1 then
The current script should ask if you want to insert a track.
But to take that out remove the code between the 2 functions

function create_midi_input_track()
....
end

all code here remove

local function btn_click()
....
end
OK, I'll try that too.

Thank you again!

Larry
LarrySeyer is offline   Reply With Quote
Old 12-14-2019, 08:48 PM   #1928
LarrySeyer
Human being with feelings
 
LarrySeyer's Avatar
 
Join Date: Sep 2006
Location: Bastrop, Tx
Posts: 169
Default

The "me2beats" lua script works exactly as it should EXCEPT...

It doesn't record the first note.

That is very important.

Any ideas how to get that first note in there?

(I'll try your modified script with your suggestions also)

Last edited by LarrySeyer; 12-15-2019 at 12:01 AM.
LarrySeyer is offline   Reply With Quote
Old 12-15-2019, 12:25 AM   #1929
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

I had a look at that script it works much the same it just uses JS: MIDI Examiner to get any notes played that triggers record.
I think a way you could do it is use note-counter.jsfx to get the note/s being played (as it may be a chord) and the velocity with midi_examine though individual velocities for each note would be better (I will look more into it)
so note-counter.jsfx as FX1
C = reaper.TrackFX_GetParam(track, 0, 0) -- 0=FX 1, 0=C note number
Cs = reaper.TrackFX_GetParam(track, 0, 1) -- 0=FX 1, 1=Cs note number
D = reaper.TrackFX_GetParam(track, 0, 2) -- 0=FX 1, 2=D note number
....
....

and midi_examine as FX2
velocity = reaper.TrackFX_GetParam(track, 1, 3) -- 1=FX 2, 3=Data Byte 2

get the project time with cursor position when the note/s was hit and cursor pos when the notes were let go
reaper.MIDI_GetPPQPosFromProjTime( take, cursor_pos )

then these notes are inserted into the current item
reaper.MIDI_InsertNote( take, selected, muted, startppqpos, endppqpos, chan, pitch, vel, noSortIn )

Maybe someone will come in with a better way, but until then....

If this is going to be a long back n forth post maybe start a new post in the ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum ?
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-15-2019, 03:05 AM   #1930
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 853
Default Child tracks colour auto gradient from custom colour 'X' to next custom colour ?

I feel like this might exist already, and this seems like the place to ask -

Set parent track to custom colour no 'X', and gradient colour all child tracks from colour 'X' to the next numbered custom colour in the custom colour list. So if I assign the parent to custom colour 4, the child tracks gradient from custom colour 4 to custom colour 5.

Assuming you have your custom colours organised in a logical order, then this would be a quick way to colour your parent tracks and children, keeping child tracks following the parent colour, but still with a gradient to the child tracks so you can easily differentiate them.

There's a thread here - https://forum.cockos.com/showthread.php?t=191502 in which a few of us are looking for this script. If it doesn't exist and someone wants to craft it from scratch then I'm happy to make a donation.
Joe90 is offline   Reply With Quote
Old 12-24-2019, 01:04 PM   #1931
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Thought i'd try my luck with request as well

Dreaming of a script to randomize Arrange grid settings using predefined (might be within the code) list of settings.
And also to randomize the action Move cursor right/left by grid division which would force the cursor to move to and fro by grid at steps of random size


That's for looping up samples at random increments as a creativity enhancer in search for interesting combinations/sequence of slices.

Last edited by Buy One; 12-25-2019 at 08:04 AM.
Buy One is offline   Reply With Quote
Old 12-25-2019, 07:50 AM   #1932
cool
Human being with feelings
 
Join Date: Dec 2017
Location: Sunny Siberian Islands
Posts: 957
Default

Hi guys, Merry Christmas!

I could not find a script to select all the midi items only, ignoring the audio items in the project. This is real?
cool is offline   Reply With Quote
Old 12-25-2019, 08:08 AM   #1933
jrengmusic
Human being with feelings
 
jrengmusic's Avatar
 
Join Date: Jun 2015
Location: Indonesia Raya
Posts: 684
Default

Quote:
Originally Posted by cool View Post
Hi guys, Merry Christmas!

I could not find a script to select all the midi items only, ignoring the audio items in the project. This is real?
No script, but there's SWS action
Code:
SWS/BR: Select all MIDI items
__________________
JRENG! | M E T R I C
jrengmusic is offline   Reply With Quote
Old 12-25-2019, 09:44 AM   #1934
cool
Human being with feelings
 
Join Date: Dec 2017
Location: Sunny Siberian Islands
Posts: 957
Default

Quote:
Originally Posted by jrengmusic View Post
No script, but there's SWS action
Code:
SWS/BR: Select all MIDI items
Oh, thank you!
cool is offline   Reply With Quote
Old 12-27-2019, 03:02 PM   #1935
gorelik11
Human being with feelings
 
Join Date: Feb 2018
Posts: 17
Default Render specified channels

Hi,guys and Merry Christmas. I have a question. Is it possible to write a script, which Renders only specified channels of a track. For example 7+8.
gorelik11 is offline   Reply With Quote
Old 01-04-2020, 09:16 AM   #1936
krahosk
Human being with feelings
 
Join Date: Jul 2009
Location: Canada
Posts: 2,372
Default

Happy new year to everyone!

Is it possible to write a script that assigns notes or MIDI CC to music XML values upon import?
krahosk is offline   Reply With Quote
Old 01-04-2020, 11:47 AM   #1937
Michael Firmont
Human being with feelings
 
Join Date: Nov 2018
Posts: 29
Default

Hey guys and a happy new year! :-)

I have a (paid) Scripting request but I am not sure, if it's possible. At the very end, it should be combined with b0ses "Smooth V6" theme (my fav atm)

I would love to switch to Reaper but there are a few things that still make me kinda stuck to Cubase.... but I think it shouldn't be too difficult or impossible to change this and the Smooth V6 theme looks perfect (to me) to do this.

1. Full collapsable folders without any other use than the overview/aesthetics. As a film composer I have several hundred midi tracks on my screen. Without the folder function from Cubase (or Logic....) it would be horrible to work with this amount of tracks. Is it possible to create a "real folder track" that can collapse completely, like Cubase but without affecting the routing? You can solo/mute and create a group edit, like Cubase but you don't change the routing, it shouldn't be a "folder and bus". THIS would be awesome

2. Routing overall:
I thought I could handle it, but I really hate the routing within Reaper. In all the other DAWs you have an Output field for each track. You click it, then all possible tracks will show up and you click the track you want as the "target track".
I would love to see such an option (within this awesome Smooth V6 Them)

Idea: create an "Output Drop Down" Menu which you can find on each track like in Cubase/PT (in the track inspector and the Mix View) but without the Option of changing any "send percentage". It's 100% of the signal being send to this channel.
As a standard you will the the Master track in this little Output field. And when you choose another track, a little script will automatically disconnect the line to the Master track and you just have one connection as an output from this one track to the Target Track. I think there are already scripts doing something similar...

It would be really awesome if this would work out and I would be able to pay $200 for it... I really have no clue of scripting so I don't know if this is a rude request. If so, I am sorry and I will delete it! Still have to save up some bugs for the additional designs needed to implement..

Thanks so much!

Michael :-)
Michael Firmont is offline   Reply With Quote
Old 01-04-2020, 12:44 PM   #1938
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 853
Default

Micheal - former Cubase user here -

For your first request - You can set up an action to hide child tracks in a folder instead of collapsing them, this will give you the Cubase look of fully collapsed tracks. However, if there are other hidden tracks in that folder which you wish to stay hidden, they'll reappear when you open the folder (because you are unhiding all tracks inside it every time). You can also edit the theme so that supercollapsed tracks are 0 pixels high, which has the same visual effect, but those invisible tracks are still editable even though you can't see them, so I would not recommend that!
If you want inert (non-bus) folders then you can just place all the tracks inside the folder and turn off the parent send on all those tracks, and route them directly to the master (or wherever else you desire). I'm pretty sure there is a script for this already, perhaps someone will chime in on that.

If you want the folder track editability while collapsed like Cubase, there are scripts for this, but I haven't found one that works smoothly like the native Cubase/S1 method -

https://forum.cockos.com/showthread.php?t=175388

https://forum.cockos.com/showthread.php?t=205731

For your second request. The link between routing and track position seems core to the way Reaper was built, so I'd be very surprised if changing that is scriptable, and I'd be equally surprised if the devs decided to change it any time soon. I suspect it's the reason we don't have actions like 'move selected track to directly above/below previously selected track', because the relationship between track position and folder hierarchy makes it so complicated.

Also, just FYI, neither of those request are really theme specific. If they're doable in one theme, they are doable in pretty much any other.
Joe90 is offline   Reply With Quote
Old 01-04-2020, 03:20 PM   #1939
bayvan
Human being with feelings
 
Join Date: Sep 2009
Posts: 4
Default

Hello and a happy new year!

Script request : can someone please make a script for a selected track that is not muted to send MIDI CC for example - channel 1 CC19 value 127 and mute the track. If the track is muted then does the opposite - unmutes the track and sends MIDI CC - channel 1 CC19 value 0.

Thank you in advance.
bayvan is offline   Reply With Quote
Old 01-05-2020, 02:42 AM   #1940
Michael Firmont
Human being with feelings
 
Join Date: Nov 2018
Posts: 29
Default

Dear Joe90,

thanks for your kind answer! :-)

For the first request, this sounds like a bunch of good ideas.... would be perfect to have kind of a smooth version then, also with the looks! :-)

Second request: I think I wasn't clear enough :-D It is not about changing the routing system of Reaper, sadly I am sure about this not going to change, as you already said.

My idea is more of a "fake output". It's a normal send, but just without the option of sending more or less than 100% of the signal. And with an added script when using this "Output Dropdown" that it will automatically disconnect from the master and ONLY to the chosen target track.

Better to understand or was it clear before and still not doable xD

Thank for your input!
Michael Firmont is offline   Reply With Quote
Old 01-08-2020, 12:55 PM   #1941
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default Color time selection background when repeat is active

Hello, today I had the idea to color the time selection background when repeat is active for a better and more direct graphical representation.
Unfortunately you cannot color theme elements like that with custom actions.


REPEAT ON = color time selection background to custom color
REPEAT OFF= reapply old color to time selection background

Is that maybe possible with scripting?
Eraz is offline   Reply With Quote
Old 01-08-2020, 01:11 PM   #1942
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,180
Default

Quote:
Originally Posted by Eraz View Post
Hello, today I had the idea to color the time selection background when repeat is active for a better and more direct graphical representation.
Unfortunately you cannot color theme elements like that with custom actions.


REPEAT ON = color time selection background to custom color
REPEAT OFF= reapply old color to time selection background

Is that maybe possible with scripting?
Yes but you need to make two themes and get the script to select that theme and select repeat.
I'll dig it out for you..
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is online now   Reply With Quote
Old 01-08-2020, 02:09 PM   #1943
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by Triode View Post
Yes but you need to make two themes and get the script to select that theme and select repeat.
I'll dig it out for you..
Wow thanks! hoped it would be easier for you guys though. Something direct like "set timesel.background.color [x x x]" #butwhatdoiknow

Edit: When changing the theme isn't there also done a complete GUI refresh?

Last edited by Eraz; 01-08-2020 at 02:23 PM.
Eraz is offline   Reply With Quote
Old 01-08-2020, 04:18 PM   #1944
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,180
Default

The script I use now for this is below.
Note that you need SWS installed and you also need to set copies of your theme with the change you want via the resources themes window (search "resources theme" in the action list)
The reason I have four variations is because I denote preroll by colouring things differently also:



I also set this code in a custom action that is my Custom Startup (SWS) for projects (an action that occurs as part of opening a project.) It's good to have this as a custom macro as new projects will adopt any changes you make to this also.
The same with my key command for next project tab.


Code:
loopState = reaper.GetToggleCommandStateEx(0, 1068)
prerollState = reaper.GetToggleCommandStateEx(0, 41818)


if loopState == 0 and prerollState == 0 then -- if both off, then

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME1'),0)

end

if loopState == 1 and prerollState == 0 then 

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME2'),0)

end

if loopState == 0 and prerollState == 1 then 

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME3'),0)

end

if loopState == 1 and prerollState == 1 then 

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME4'),0)

end
Any more experienced coders might want to chime in to improve on this
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is online now   Reply With Quote
Old 01-08-2020, 05:27 PM   #1945
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by Triode View Post
The script I use now for this is below.
Note that you need SWS installed and you also need to set copies of your theme with the change you want via the resources themes window (search "resources theme" in the action list)
The reason I have four variations is because I denote preroll by colouring things differently also:



I also set this code in a custom action that is my Custom Startup (SWS) for projects (an action that occurs as part of opening a project.) It's good to have this as a custom macro as new projects will adopt any changes you make to this also.
The same with my key command for next project tab.


Code:
loopState = reaper.GetToggleCommandStateEx(0, 1068)
prerollState = reaper.GetToggleCommandStateEx(0, 41818)


if loopState == 0 and prerollState == 0 then -- if both off, then

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME1'),0)

end

if loopState == 1 and prerollState == 0 then 

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME2'),0)

end

if loopState == 0 and prerollState == 1 then 

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME3'),0)

end

if loopState == 1 and prerollState == 1 then 

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME4'),0)

end
Any more experienced coders might want to chime in to improve on this
Awesome, much appreciated! Thank you very much
Eraz is offline   Reply With Quote
Old 01-08-2020, 06:29 PM   #1946
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 853
Default

Are there scripts out there for 'select every other item'?

Also - 'select every other note' for use in the midi editor, that will also work on chords (so if you have four chords, each with notes that start together, it will just select the 2nd and 4th chord, or vice versa?

Ideally these would just run - not needing a GUI or input.
Joe90 is offline   Reply With Quote
Old 01-09-2020, 08:53 AM   #1947
Eraz
Human being with feelings
 
Join Date: Nov 2019
Posts: 225
Default

Quote:
Originally Posted by Triode View Post
The script I use now for this is below.
Note that you need SWS installed and you also need to set copies of your theme with the change you want via the resources themes window (search "resources theme" in the action list)
The reason I have four variations is because I denote preroll by colouring things differently also:



I also set this code in a custom action that is my Custom Startup (SWS) for projects (an action that occurs as part of opening a project.) It's good to have this as a custom macro as new projects will adopt any changes you make to this also.
The same with my key command for next project tab.


Code:
loopState = reaper.GetToggleCommandStateEx(0, 1068)
prerollState = reaper.GetToggleCommandStateEx(0, 41818)


if loopState == 0 and prerollState == 0 then -- if both off, then

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME1'),0)

end

if loopState == 1 and prerollState == 0 then 

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME2'),0)

end

if loopState == 0 and prerollState == 1 then 

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME3'),0)

end

if loopState == 1 and prerollState == 1 then 

reaper.Main_OnCommand(reaper.NamedCommandLookup('_S&M_LOAD_THEME4'),0)

end
Any more experienced coders might want to chime in to improve on this
Hey Triode, I would like to add a check if recording mode is set to time selection auto punch. Which command do I need to use to get this information from reaper?

EDIT: Found a way myself with this thread: https://forum.cockos.com/showthread.php?t=224022

Last edited by Eraz; 01-11-2020 at 03:16 AM.
Eraz is offline   Reply With Quote
Old 01-11-2020, 11:57 AM   #1948
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Quote:
Originally Posted by Joe90 View Post
Also - 'select every other note' for use in the midi editor, that will also work on chords (so if you have four chords, each with notes that start together, it will just select the 2nd and 4th chord, or vice versa?

Ideally these would just run - not needing a GUI or input.
spk77_MIDI note selector.eel
mpl_Note selector.lua
Lokasenna_MIDI Note Selector.lua

all have a GUI and require manual labor
not sure if they work for chords, my guess is they don't

me2beats_Select only even notes.lua
me2beats_Select only odd notes.lua
Buy One is offline   Reply With Quote
Old 01-11-2020, 03:24 PM   #1949
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 853
Default

Quote:
Originally Posted by Buy One View Post
me2beats_Select only even notes.lua
me2beats_Select only odd notes.lua
That's the one! I was search for 'every other' or 'every 2nd' and didn't consider that search term. Works a treat, including on chords.

Cheers.

Edit: there's a me2beats action that also works for items in the arrange page too. So that's all solved. Thank you.
Joe90 is offline   Reply With Quote
Old 01-28-2020, 12:01 AM   #1950
cool
Human being with feelings
 
Join Date: Dec 2017
Location: Sunny Siberian Islands
Posts: 957
Default

I’m looking for a script (or something similar for editing): set the pitch of the selected notes by the pitch cursor. At the same time, even if notes of different pitch are selected, all the same, all notes must stand in the pitch cursor.
cool is offline   Reply With Quote
Old 01-28-2020, 01:34 AM   #1951
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Try it should set all selected notes in the midi editor to the pitch at the mouse cursor:
Code:
 window, segment, details = reaper.BR_GetMouseCursorContext()

 retval, inlineEditor, noteRow, ccLane, ccLaneVal, ccLaneId = reaper.BR_GetMouseCursorContext_MIDI()

 ME = reaper.MIDIEditor_GetActive()

 take = reaper.MIDIEditor_GetTake(ME)

 retval, notecnt, ccevtcnt, textsyxevtcnt = reaper.MIDI_CountEvts( take )

 
 for i = 0, notecnt -1 do
   retval, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote( take, i )
   if selected then
      reaper.MIDI_SetNote( take, i  , true, muted, startppqpos, endppqpos, chan, noteRow, vel, true )  
      
   end
 end
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 01-28-2020, 01:53 AM   #1952
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
Default

This is a very handy script, thanks Musobob, works for me !!

EDIT: I built a Custom Action using this script.
This Custom Action transposes selected Notes to the Mouse pointed pitch lane but transposition obeys the set scale/key in MIDI Editor.
Furthermore, Play will start from selected Notes, so you can preview the transposed notes instantly.
Check this snapshot for this Custom Action (the first Action is actually Musobob's script, but i renamed it to my own liking):
https://i.imgur.com/drlkyam.jpg

Hope someone finds this useful !
__________________
Macbook Pro INTEL | Reaper, always latest version | OSX Ventura | Presonus Studio 24c
My Reaper Tips&Tricks YouTube Channel: https://www.youtube.com/user/vanhaze2000/playlists

Last edited by vanhaze; 01-28-2020 at 02:51 AM.
vanhaze is offline   Reply With Quote
Old 01-28-2020, 02:14 AM   #1953
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 853
Default Script: me2beats_Increase active takes pitch linearly (+1 semitone).lua

Anyone fancy amending this script so that it instead of standard pitchshifting, it does resample style pitchshifting (I'm aware this means the length of the items would get progressively shorter, I'm fine with that).

For reference, here is the script -

Code:
-- @description Increase active takes pitch linearly (+1 semitone)
-- @version 1.0
-- @author me2beats
-- @changelog
--  + init

local r = reaper

local items = r.CountSelectedMediaItems()
if items == 0 then return end

local first_take = r.GetActiveTake(r.GetSelectedMediaItem(0,0))
if not first_take then return end

local first_pitch = r.GetMediaItemTakeInfo_Value(first_take, 'D_PITCH')
first_pitch = math.floor(first_pitch+.5)

r.Undo_BeginBlock(); r.PreventUIRefresh(1)

local iter = 0
for i = 1, items-1 do
  local item = r.GetSelectedMediaItem(0,i)
  local take = r.GetActiveTake(item)
  if take then
    iter=iter+1
    local pitch = r.GetMediaItemTakeInfo_Value(take, 'D_PITCH')
    if pitch~= first_pitch+iter then
      r.SetMediaItemTakeInfo_Value(take, 'D_PITCH',first_pitch+iter)
      r.UpdateItemInProject(item)
    end
  end
end

r.PreventUIRefresh(-1); r.Undo_EndBlock('Increase takes pitch (+1)', -1)
Also, I'd love an equivalent version of this for notes the midi editor, so you select a number of notes in a row on one pitch, and it moves through each note in the selection, moving each note up 1 semitone higher than the previous one, until the last selected note, leaving you with a chromatic run of however many notes you selected.
Joe90 is offline   Reply With Quote
Old 01-28-2020, 04:36 AM   #1954
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Quote:
Originally Posted by Joe90 View Post
Also, I'd love an equivalent version of this for notes the midi editor, so you select a number of notes in a row on one pitch, and it moves through each note in the selection, moving each note up 1 semitone higher than the previous one, until the last selected note, leaving you with a chromatic run of however many notes you selected.
I can share a custom action i've built, but it does so not all at once, you'd need to click OK for every next note until the end of the row. And it may not work if notes of other pitches are present because i didn't mean to use it in this setting.

Quote:
Originally Posted by Joe90 View Post
Anyone fancy amending this script so that it instead of standard pitchshifting, it does resample style pitchshifting (I'm aware this means the length of the items would get progressively shorter, I'm fine with that).
You can use these instead

Xenakios/SWS: Resample pitch shift item one semitone down
Xenakios/SWS: Resample pitch shift item one semitone up

Last edited by Buy One; 01-28-2020 at 04:58 AM.
Buy One is offline   Reply With Quote
Old 01-28-2020, 05:15 AM   #1955
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 853
Default

Quote:
Originally Posted by Buy One View Post
I can share a custom action i've built, but it does so not all at once, you'd need to click OK for every next note until the end of the row. And it may not work if notes of other pitches are present because i didn't mean to use it in this setting.



You can use these instead

Xenakios/SWS: Resample pitch shift item one semitone down
Xenakios/SWS: Resample pitch shift item one semitone up
Thanks Buy One, I'm aware of those actions. I'm looking for something that will trigger the same function as the script I posted (increase each item linearly +1 semitone), but using resample pitch shifting.
Joe90 is offline   Reply With Quote
Old 01-28-2020, 05:31 AM   #1956
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@Joe90
I just make a pitch shifter by variation of pitch based on rate change, Script: X-Raym_Set or offset selected takes rate by semitone adjusting item length and fades and clearing preserve pitch.lua,
I think it is closer to what you need though it is not "resampling" as in you input 44100 source and 96000 output, it is pure rate ratio change.
(but I think you just want rate change).


It just dont have the incrementation you are asking.
X-Raym is offline   Reply With Quote
Old 01-28-2020, 08:14 AM   #1957
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 853
Default

Quote:
Originally Posted by X-Raym View Post
@Joe90
I just make a pitch shifter by variation of pitch based on rate change, Script: X-Raym_Set or offset selected takes rate by semitone adjusting item length and fades and clearing preserve pitch.lua,
I think it is closer to what you need though it is not "resampling" as in you input 44100 source and 96000 output, it is pure rate ratio change.
(but I think you just want rate change).


It just dont have the incrementation you are asking.
Thanks X-Raym - I have actually been using a similar native action called - Item properties: Increase item rate by ~6% (one semitone), clear 'preserve pitch'. I believe that's doing roughly the same thing as your script, right? I have your scripts installed from reapack, so I'm curious why I couldn't find that script of yours when I searched. Is it one of your premium scripts?

To be clear, the word 'resample' in the SWS actions doesn't refer to altering the items sample rate, it is that same kind of pure ratio change pitchshifting (sometimes called 'tape style') where time and pitch change together, that you are referring to.

I use it for drum hits or FX, or anything really that doesn't need to be 'in key' as I find it to be the most natural, artifact free form of pitchshifting or timestretching, which makes sense, as the algorithm isn't having to 'fill in' any data.

I was hoping there was a simple tweak that could be made to the me2beats action I posted so that it calls on one of these resample/tape style pitchshifting actions instead of the the normal pitchshift, and acts out the same chromatic pitchshifting function.
Joe90 is offline   Reply With Quote
Old 01-28-2020, 08:18 AM   #1958
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,134
Default

Quote:
Originally Posted by vanhaze View Post
https://i.imgur.com/drlkyam.jpg

Hope someone finds this useful !
Thank you for sharing. By the way you can post custom action contents as text by copying them using its context menu option Copy selected action text
Buy One is offline   Reply With Quote
Old 01-28-2020, 08:22 AM   #1959
cool
Human being with feelings
 
Join Date: Dec 2017
Location: Sunny Siberian Islands
Posts: 957
Default

Quote:
Originally Posted by MusoBob View Post
Try it should set all selected notes in the midi editor to the pitch at the mouse cursor:
[CODE]
Great, thank you!

I modified this code, now it fully matches my requests:

Code:
reaper.Undo_BeginBlock() 
reaper.PreventUIRefresh(1);

ME = reaper.MIDIEditor_GetActive()

take = reaper.MIDIEditor_GetTake(ME)

note_row = reaper.MIDIEditor_GetSetting_int(ME, 'active_note_row')

retval, notecnt, ccevtcnt, textsyxevtcnt = reaper.MIDI_CountEvts( take )

local correct
if reaper.GetToggleCommandStateEx(32060, 40681) == 1 then
   reaper.MIDIEditor_LastFocused_OnCommand(40681,0) --Options: Correct overlapping notes while editing
   correct = 1
end

 
 for i = 0, notecnt -1 do
   retval, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote( take, i )
   if selected then
      reaper.MIDI_SetNote( take, i  , true, muted, startppqpos, endppqpos, chan, note_row, vel, true )  

   end

 end


time_start = reaper.time_precise()

local function Main()

    local elapsed = reaper.time_precise() - time_start  --set slowdown timer
    if elapsed >= 0.2 then  --pause 200ms

if correct then 
   reaper.MIDIEditor_LastFocused_OnCommand(40681,0) --Options: Correct overlapping notes while editing
end

        return
    else
        reaper.defer(Main)
    end
    
end

Main()

reaper.PreventUIRefresh(-1);
reaper.Undo_EndBlock('Pitch Selected Notes to Pitch Row', 0)
cool is offline   Reply With Quote
Old 01-28-2020, 08:49 AM   #1960
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Quote:
Thanks X-Raym - I have actually been using a similar native action called - Item properties: Increase item rate by ~6% (one semitone), clear 'preserve pitch'. I believe that's doing roughly the same thing as your script, right

Mine has some extra consideration. It offset fades, and it is also a SET / OFFSET, where native actions are just an offset (from the actual item state).
This can save a lof of time. :P



Quote:
? I have your scripts installed from reapack, so I'm curious why I couldn't find that script of yours when I searched. Is it one of your premium scripts?
It is public and free : https://github.com/X-Raym/REAPER-Rea...ve%20pitch.lua


Quote:
To be clear, the word 'resample' in the SWS actions doesn't refer to altering the items sample rate,
Another well named action then ^^
X-Raym 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 10:23 AM.


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