Old 10-08-2018, 02:54 PM   #1
mrfloat
Human being with feelings
 
Join Date: Feb 2016
Posts: 5
Default Key snap setting for a project

So the midi editor has the key snap option where you can set root note and scale. Is there a way to get this note using API?
mrfloat is offline   Reply With Quote
Old 10-09-2018, 05:59 AM   #2
Ozman
Human being with feelings
 
Join Date: Feb 2015
Posts: 475
Default

I know that Lokasenna's Theory Helper can detect the chosen key, but that's from within the MIDI editor.
Ozman is offline   Reply With Quote
Old 10-09-2018, 06:20 AM   #3
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,294
Default

Code:
editor = reaper.MIDIEditor_GetActive()
reaper.MIDIEditor_GetSetting_int(editor, 'snap_enabled')
reaper.MIDIEditor_GetSetting_int(editor, 'scale_root')
reaper.MIDIEditor_GetSetting_str(editor, 'scale', '')
cfillion is online now   Reply With Quote
Old 12-06-2018, 10:38 AM   #4
michaeltonight
Human being with feelings
 
Join Date: Jun 2010
Location: Texas
Posts: 241
Default

I'm feeling a bit dense; it seems that MIDIEditor_GetSetting_int(midieditor, "snap_enabled") returns "1" whether or not key snap is disabled in the midieditor. I'm not sure if it's a bug or if it's a mistake on my part. Here's my little test script if anyone is curious:

Code:
reaper.ShowConsoleMsg("")
function msg(param)
	reaper.ShowConsoleMsg(tostring(param).."\n")
end

function main()	

--access the active MIDI editor
editor =  reaper.MIDIEditor_GetActive()

--is key snap enabled?
check_snap =  reaper.MIDIEditor_GetSetting_int(editor, "snap_enabled")
msg(check_snap)
end

main()
michaeltonight 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 12:11 PM.


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