Old 10-11-2019, 08:57 PM   #1
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default Snap Notes to Number or Reascale

I don't mind making a donation for this.
I need a better way of snapping selected midi notes to note numbers or a reascale.

From the region name I can get the root and chord then calculate the notes and reascale:
root ="C"
notenums = "0,4,7" -- 0 being root
reascale = "100030050000"

so I can get those no problem but then I just need to move the existing notes to those,
I have been using mpl snap selected notes to scale but I get notes over the top of each other, only 2 notes in a triad and the notes transposed too much.
You can see below in before and after, the lighter notes are the chord snap guide track notes that they should snap to, green being the root.

Before After wrong


Should be like this


or like this
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

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

In the pic below I can do it manually by dragging, so I need it to work that same way with a script. If we had MIDI_SetScale as well as MIDI_GetScale.
I can
reaper.MIDIEditor_SetSetting_int( midieditor, setting_desc, setting )
scale_enabled: set 0-1
scale_root: set 0-12 (0=C)

and
retval, buf = reaper.MIDIEditor_GetSetting_str( midieditor, setting_desc, buf )
scale: returns the scale record, for example "102034050607"

where's MIDIEditor_SetSetting_str ????

https://forum.cockos.com/showthread.php?p=2149282
Quote:
Originally Posted by mpl View Post
...
MIDI Editor:
MIDIEditor_SetSetting_str( midieditor, setting_desc, buf ), setting_desc = 'scale'
....
https://forum.cockos.com/showpost.ph...7&postcount=67

07-17-2013, 06:13 AM
Quote:
Originally Posted by spk77 View Post
This would be nice - set MIDI editor "snap scale": RPR_MIDIEditor_SetSnapScale(root, scalename, scale)


f.ex. Set MIDI editor snap scale to "C major triad":
RPR_MIDIEditor_SetSnapScale("C", "Major Triad", "0, 4, 7") (0 = root, 4 = 4 semitones from root, 7 = 7 semitones from root etc.)

or maybe the "scale" argument should be a list:
RPR_MIDIEditor_SetSnapScale("C", "Major Triad", [0, 4, 7])

or using ReaScale format for the "scale":
RPR_MIDIEditor_SetSnapScale("C", "Major Triad", "100030050000")
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 10-12-2019, 03:25 PM   #3
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

If I use
Edit: Move notes up/down one semitone
(and not Edit: Move notes up/dowm one semitone ignoring scale/key)
it won't work the same as moving up/down with the mouse.

Full Screen
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 10-12-2019, 06:27 PM   #4
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Look how well it snaps manually dragging !
Even with the notes close together it will spread them over the chord notes.
If the Reaper programmers could upload that routine as a Lua script, WOO HOO !

__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob 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 01:14 PM.


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