|
|
|
08-19-2020, 08:13 AM
|
#41
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Do you have a list of scale patterns, so people can copy'n'paste them directly from the docs to include them into the parameters?
|
|
|
08-19-2020, 08:40 AM
|
#42
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
Quote:
Originally Posted by Meo-Ada Mespotine
Do you have a list of scale patterns, so people can copy'n'paste them directly from the docs to include them into the parameters?
|
some basics scales:
2773- lydian 101010110101
2741- major 101011010101
1717- Mixolydian 101011010110 (don't know if need to put the 0 in the end of a scale that ends with 0, thinking in music theory ( or imagining an piano ) it makes sense tho.)
1709- Dorian 101101010110
1453-Minor 101101011010
1451-Phrygian 110101011010
1387-Locrian 110101101010
4095-Chromatic 111111111111
1365-whole tone 101010101010
etc etc etc...
there can be 4096 scales using 12 division per octave so don't need to list everything hehe this site have many tools for exploring scales ( also give the number that reaper uses when searching scales ) https://ianring.com/musictheory/scales/finder.php
|
|
|
08-19-2020, 08:51 AM
|
#43
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
No problem. Just some basic scales for those beginning is a nice start.
Thanks
|
|
|
08-19-2020, 09:19 AM
|
#44
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Quote:
Originally Posted by daniellumertz
(like 101011010101 major 2741 )
|
Quote:
Originally Posted by daniellumertz
some basics scales:
2773- lydian 101010110101
2741- major 101011010101
1717- Mixolydian 101011010110 (don't know if need to put the 0 in the end of a scale that ends with 0, thinking in music theory ( or imagining an piano ) it makes sense tho.)
1709- Dorian 101101010110
1453-Minor 101101011010
1451-Phrygian 110101011010
1387-Locrian 110101101010
|
Remember that Reaper uses big endian, so they should be written in reverse. You can use the code I posted previously to get them in big endian.
Last edited by amagalma; 08-21-2020 at 04:01 AM.
|
|
|
08-19-2020, 03:27 PM
|
#45
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Quote:
Originally Posted by Meo-Ada Mespotine
Do you have a list of scale patterns, so people can copy'n'paste them directly from the docs to include them into the parameters?
|
There are also some on the stash:
https://stash.reaper.fm/browse.php?q...=th&o=nd&pp=24
|
|
|
08-19-2020, 03:39 PM
|
#46
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
How to change the source channels on a send after creating the send. My track has many sends on it and I know how to create a send and how to change a source channel but it changes the wrong one. How to get the last created send?
https://forum.cockos.com/showthread.php?t=241380
|
|
|
08-19-2020, 03:50 PM
|
#47
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Quote:
Originally Posted by Coachz
How to change the source channels on a send after creating the send. My track has many sends on it and I know how to create a send and how to change a source channel but it changes the wrong one. How to get the last created send?
https://forum.cockos.com/showthread.php?t=241380
|
Haven't used it myself but wouldn't that be
SetTrackSendInfo_Value with 'I_SRCCHAN'?
|
|
|
08-19-2020, 03:53 PM
|
#48
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
Quote:
Originally Posted by nofish
|
You would think that would work but if you check out my previous post you'll see that Reaper seems to be sorting sends and so often the one you just created is not the last one in order necessarily which is causing me to change the wrong send. So it's like I need some pointer or way to get the last created send after I create it
|
|
|
08-19-2020, 04:14 PM
|
#49
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Quote:
Originally Posted by Coachz
You would think that would work but if you check out my previous post you'll see that Reaper seems to be sorting sends and so often the one you just created is not the last one in order necessarily which is causing me to change the wrong send. So it's like I need some pointer or way to get the last created send after I create it
|
I see (missed that in the previous post, sorry).
Are you creating them via API or Reaper GUI?
If the first, CreateTrackSend returns the index of the created send, which you could then use with SetTrackSendInfo_Value?
|
|
|
08-19-2020, 04:43 PM
|
#50
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
Thanks nofish. I'll give that a try. I'm using the API. How did you know it returns the index. All I saw was this and didn't know what integer was returning.
integer reaper.CreateTrackSend(MediaTrack tr, MediaTrack desttrIn)
|
|
|
08-19-2020, 05:21 PM
|
#51
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
It says in the doc.
Quote:
return >=0 on success (== new send/receive index)
|
|
|
|
08-19-2020, 05:26 PM
|
#52
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
Damn I missed that! Thanks so much.
|
|
|
08-19-2020, 06:01 PM
|
#53
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
Quote:
Originally Posted by amagalma
Remember that Reaper uses little endian, so they should be written in reverse. You can use the code I posted previously to get them in little endian.
|
Opss.. That is true, forget that because I made the function switch the order .
coach I made a script (send for a bus for a while) that a part of it is for looking into the sends
if you created the send in the script I think it is the last one or the first not sure (not on my pc right now). But if it was created before and not sure if was the last created, I think I made a loop to see the tracks it was connected .
|
|
|
08-19-2020, 09:50 PM
|
#54
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
If there is a condition to end the script mid it "case of an error" how do you automatically undo what have been changed till that point?
End the undo block and then MainonCommand Undo?
|
|
|
08-20-2020, 04:40 AM
|
#55
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Quote:
Originally Posted by daniellumertz
If there is a condition to end the script mid it "case of an error" how do you automatically undo what have been changed till that point?
End the undo block and then MainonCommand Undo?
|
Mostly yes. There's also a function for undo and even redo.
But better is to check for possible errors first before changing anything. It's less intrusive and as the undo-system if Reaper has its quirks, you may end up with the wrong things undone in rare cases and can't do something about it.
|
|
|
08-20-2020, 08:11 AM
|
#56
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
Quote:
Originally Posted by nofish
It says in the doc.
|
That worked great. Thanks again for helping me fix this. Yay !
|
|
|
08-21-2020, 04:11 AM
|
#57
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Guys, just for not spreading wrong information, the system that Reaper uses to store scales is called big endian. I had confused the terms. Big endian means that the most significant bit is first. For example, take the number 103 (one hundred and three) in decimal. It is written in big endian, which means that first comes the digit that shows hundreds, then the digit that shows tens and last the digit that shows units. I corrected it in my posts above
|
|
|
08-21-2020, 04:57 AM
|
#58
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
Quote:
Originally Posted by daniellumertz
Opss.. That is true, forget that because I made the function switch the order .
coach I made a script (send for a bus for a while) that a part of it is for looking into the sends
if you created the send in the script I think it is the last one or the first not sure (not on my pc right now). But if it was created before and not sure if was the last created, I think I made a loop to see the tracks it was connected .
|
Thank you. I got my script working. Yay
|
|
|
08-22-2020, 09:43 AM
|
#59
|
Human being with feelings
Join Date: Jan 2014
Posts: 923
|
I want to change auto-save path for this action:
SWS/S&M: Resources - Auto-save track template (with items, envelopes)
Is it possible to change this path on the fly?
my code looks like this, but it doesnt work..
Code:
local project_path = reaper.GetProjectPath("")
local reaper_res_path = reaper.GetResourcePath()
local sws_ini_path = reaper_res_path.."\\S&M.ini"
-- boolean reaper.BR_Win32_WritePrivateProfileString(string sectionName, string keyName, string value, string filePath)
-- [BR] Equivalent to win32 API WritePrivateProfileString(). For example, you can use this to write to REAPER.ini
-- change auto save path in S&M.ini file
local ok = reaper.BR_Win32_WritePrivateProfileString(
"Resources", -- section
"AutoSaveDirTrackTemplates",
project_path, -- auto save path
sws_ini_path
)
-- not sure if i need this..
local ok = reaper.BR_Win32_WritePrivateProfileString(
"Resources", -- section
"AutoFillDirTrackTemplates",
project_path, -- auto save path
sws_ini_path
)
-- SWS/S&M: Resources - Auto-save track template (with items, envelopes)
local command_id = reaper.NamedCommandLookup("_S&M_SAVE_TRTEMPLATE_SLOT2")
reaper.Main_OnCommand(command_id, 0) -- run action
|
|
|
08-22-2020, 12:32 PM
|
#60
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
Refresh midi editor window
Is there an equivalent to UpdateArrange for the midi editor window?
|
|
|
08-22-2020, 12:56 PM
|
#61
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Quote:
Originally Posted by Coachz
Is there an equivalent to UpdateArrange for the midi editor window?
|
There's an open FR so looks like the answer is no currently.
https://forum.cockos.com/showthread.php?t=193104
|
|
|
08-22-2020, 01:07 PM
|
#62
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
Quote:
Originally Posted by nofish
|
Ahh, thanks nofish. Let me buy you a trout. :-)
|
|
|
08-22-2020, 01:17 PM
|
#63
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Quote:
Originally Posted by Coachz
Ahh, thanks nofish. Let me buy you a trout. :-)
|
I had to look that up, but err..no thank you lol.
|
|
|
08-22-2020, 01:39 PM
|
#64
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
this thread should be sticky ? maybe call a forum mod?
can names be tagged ?
like @daniellumertz
|
|
|
08-22-2020, 01:52 PM
|
#65
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Quote:
Originally Posted by daniellumertz
this thread should be sticky ? maybe call a forum mod?
|
Agreed. Actually I 'reported' the first post when I created it and asked if it could be stickied but no reaction so far.
Maybe someone else can try also?
Quote:
can names be tagged ?
like @daniellumertz
|
Not that the tagged forum member gets a notification afaik.
|
|
|
08-22-2020, 02:06 PM
|
#66
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
I REPORTED YOU NOFISH!!1!
hahaha
asked over there, let's see if they agree...
|
|
|
08-22-2020, 03:41 PM
|
#67
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Thanks.
|
|
|
08-23-2020, 06:22 PM
|
#68
|
Human being with feelings
Join Date: Mar 2015
Location: Australia
Posts: 453
|
Okay here's one. I've looked through the API and actions list. I don't see a way to do it directly. I don't know if it can be done. Perhaps in a round about way.
Okay so, in the case only a track is selected on the timeline, can you locate the item under the edit cursor of the selected track?
|
|
|
08-23-2020, 07:24 PM
|
#69
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
I think you have to loop the items in that track and get info about where they start and end, then compare to the edit cursor position.
something like:
Code:
cursor_pos = reaper.GetCursorPosition()
track = reaper.GetSelectedTrack( 0, 0 )
n_item = reaper.CountTrackMediaItems( track )
for i = 0 , n_item - 1 do
local loop_item = reaper.GetTrackMediaItem( track, i )
local loop_item_start = reaper.GetMediaItemInfo_Value( loop_item, "D_POSITION" )
local loop_item_len = reaper.GetMediaItemInfo_Value( loop_item, "D_LENGTH" )
local loop_item_end = loop_item_start + loop_item_len
if loop_item_start <= cursor_pos and cursor_pos <= loop_item_end then
item_under_edit_cursor = loop_item
end
end
Edit: oh didn't know about this functions mespotine, cooll!!!
|
|
|
08-23-2020, 08:13 PM
|
#70
|
Human being with feelings
Join Date: Mar 2015
Location: Australia
Posts: 453
|
Quote:
Originally Posted by daniellumertz
I think you have to loop the items in that track and get info about where they start and end, then compare to the edit cursor position.
|
Thanks for the answer. That was fast! I thought it may be something similar. A bit like finding a whole track length.
|
|
|
08-24-2020, 05:54 AM
|
#71
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
So I am using
window, segment, details = reaper.BR_GetMouseCursorContext()
local track = reaper.BR_GetMouseCursorContext_Track()
to get the track under mouse but depending on the zoom level It gets a bit weird and don't return the actual track under mouse. (SWS Beta latest version here)
some other way to do it ? Maybe using GetTrackFromPoint() and some reaper/lua function to get mouse xy?
|
|
|
08-24-2020, 03:11 PM
|
#72
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Quote:
Originally Posted by daniellumertz
Maybe using GetTrackFromPoint() and some reaper/lua function to get mouse xy?
|
Yes, this should do I think (untested):
Code:
tr = reaper.GetTrackFromPoint(reaper.GetMousePosition())
|
|
|
08-24-2020, 03:12 PM
|
#73
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,458
|
Quote:
Originally Posted by daniellumertz
So I am using
window, segment, details = reaper.BR_GetMouseCursorContext()
local track = reaper.BR_GetMouseCursorContext_Track()
to get the track under mouse but depending on the zoom level It gets a bit weird and don't return the actual track under mouse. (SWS Beta latest version here)
some other way to do it ? Maybe using GetTrackFromPoint() and some reaper/lua function to get mouse xy?
|
x, y = reaper.GetMousePosition()
retval, info = reaper.GetTrackFromPoint( x, y )
|
|
|
08-25-2020, 01:15 AM
|
#74
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
thx people! I swear I looked for get mouse in the docs and didn't found hahaha worked better than the SWS actions, for some reason SWS when have multiple tracks with small size it get a bit funky heheh
|
|
|
08-26-2020, 06:42 PM
|
#75
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
is there a way to an script dont create a undo point?
I created this script to change track height using MW but wished it didn't go to my undo history
if anyone wants also
Code:
is_new_value,filename,sectionID,cmdID,mode,resolution,val = reaper.get_action_context()
if is_new_value then
x, y = reaper.GetMousePosition()
track, _ = reaper.GetTrackFromPoint(x,y)
if track then
old_height = reaper.GetMediaTrackInfo_Value(track,"I_TCPH")
if val > 0 then
reaper.SetMediaTrackInfo_Value(track, "I_HEIGHTOVERRIDE", (old_height+15))
else
reaper.SetMediaTrackInfo_Value(track, "I_HEIGHTOVERRIDE", (old_height-15))
end
end
end
reaper.TrackList_AdjustWindows(false)
reaper.UpdateArrange()
|
|
|
08-26-2020, 07:21 PM
|
#76
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
If it doesn't defer, you can add the following line at the end of the script:
This prevents creation of undo-points.
|
|
|
08-27-2020, 07:25 AM
|
#77
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
hmm didn't workk with this script, for some reason it doesent do nothing with defer at the end ...
edit:
one way is
reaper.Undo_DoUndo2( 0 )
at the end of the script with the rest as one undo block, works, but I still find it a little intrusive. Because the user could lost some redo options
Last edited by daniellumertz; 08-27-2020 at 07:37 AM.
|
|
|
08-27-2020, 09:06 AM
|
#78
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
reaper.defer() shall do nothing but it also supresses creation of undo-points. It's a hack, as defer-scripts don't create undo-points, unless explicitly done.
But you can check this only, if you run the script from outside of Reaper's IDE and not from the inside. Means, you need to close the IDE and run it from the actions-list and then you can see, whether undo isn't created or not.
BTW: Which undo-points are created? Can you post a list of the things listed in the undo-list?
|
|
|
08-27-2020, 09:50 AM
|
#79
|
Human being with feelings
Join Date: Dec 2017
Location: Brazil
Posts: 2,011
|
each time i execute the script I posted above ( which is many as I am triggering it using mouse wheel to increase / decrease the track height ) it create a ReaScipt:Run
testing I noticed that the defer works just the first time I execute.
My hypothesis why defer is not working in this case: problem is that after one time running(that goes well) it is now in the background and then I can't execute it more times ( which is how it is supposed to work (see gif posts above)). So I need to exit the script after the defer, what is used to that reaper.atexit() ??
Code with defer
Code:
is_new_value,filename,sectionID,cmdID,mode,resolution,val = reaper.get_action_context()
if is_new_value then
x, y = reaper.GetMousePosition()
track, _ = reaper.GetTrackFromPoint(x,y)
if track then
old_height = reaper.GetMediaTrackInfo_Value(track,"I_TCPH")
if val > 0 then
reaper.SetMediaTrackInfo_Value(track, "I_HEIGHTOVERRIDE", (old_height+15))
else
reaper.SetMediaTrackInfo_Value(track, "I_HEIGHTOVERRIDE", (old_height-15))
end
end
end
reaper.TrackList_AdjustWindows(false)
reaper.UpdateArrange()
reaper.defer()
|
|
|
08-27-2020, 10:00 AM
|
#80
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Hmm..ok this is something I've never experienced so far.
This is probably the right time to post again one of my most popular feature-requests: https://forum.cockos.com/showthread.php?t=215672
|
|
|
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 05:15 PM.
|