Help Modifying Lyrics Window to Chord Region Sheet
There's a Cockos script Scripts\Cockos\lyrics.lua
I know I always ask too hard stuff but I'm just looking at modifying lyrics.lua to work as a chord/region viewer.
It will have 4 measures across and each beat of that measure can be edited with a chord name that will edit
or insert that region and display that region's color.
It needs to work like the gif under.
I don't mind making a donation if someone would like to help out.
The Editing mode in lyrics.lua lets you edit each beat so you can edit each beat of each measure and that will edit or inset the region/chord name, the measures will be the region color and the current playing measure will be highlighted, it will need bigger fonts maybe use the existing drop downs for font and size so you can use a music chord style font (see bottom pics):
Hi MusoBob, much thanks for such a big donation, really appreciated.
I `m not good at modifing others code, so here is one for you:
update ReaPack (Action list: ReaPack: Synchronize packages) and navigate for mpl_Region chord editor.lua. Also make sure you have installed mpl_Various_Functions package (you can install it also from reapack: ReaPack: Browse packages)
I will send some more donation if you can adjust some things.
1. To ignore a region, something like
if string.match( region_name, "@") then goto skip end -- skip region marked @ ignore
2. start is also measure 1 if Project start measure is -1 , not -1.1.00
3. 4 measures per line
4. only have chord name at start of region C . . . and dot for each beat (edit point)
to add new chord and split region C . G . (chord change to G on beat 3 will split the region,
removing chord will glue region) or 1 C . . . 2 . . . . 3 G . . . 4 . . . . (measure 1 C chord for 2 measures then chord change to G on measure 3 for 2 measures (bars))
5. chord editor color same as region color
4 measure per line, dot "." for edit point on each beat
1. To ignore a region, something like
if string.match( region_name, "@") then goto skip end -- skip region marked @ ignore
any region with @ character is ignored
Quote:
2. start is also measure 1 if Project start measure is -1 , not -1.1.00
there is not way to know measure offset from API afaik
Quote:
3. 4 measures per line
done
Quote:
4. only have chord name at start of region C . . . and dot for each beat (edit point)
to add new chord and split region C . G . (chord change to G on beat 3 will split the region,
removing chord will glue region) or 1 C . . . 2 . . . . 3 G . . . 4 . . . . (measure 1 C chord for 2 measures then chord change to G on measure 3 for 2 measures (bars))
That was slightly complex (see Data_AddChord() function), but seems working now.
very cool - i assume there's no way to make other regions overlapping these? or am I wrong
Do you mean using it to edit regions other than chord regions ?
Maybe you could have a button to switch region display
so it will display only regions with @ prefix ?
Do you mean using it to edit regions other than chord regions ?
Maybe you could have a button to switch region display
so it will display only regions with @ prefix ?
thats a fantastic idea.
Would be great if "render regions" would also exclude those... but maybe that would be only a corner case issue
I just download the new script.
The chord region display is out by 1 beat, the chord is 1 beat late in the editor.
To get full color brightness in the editor can you use a black box background around the white font
so you can still see the white font on the light colored regions ?
Or have duplicate character larger black font behind smaller white font giving an outline font
so there is a black boarder on the font to stand out on light colored regions ?
What do I adjust in the script to scale up the font (so it's a bigger font display) ?
It is looking very good I appreciate your help with this !!!
EDIT: Maybe you could just have a small color progress bar, move the chord name up a bit to same as measure number and have the progress bar at the bottom, Or move the measure number down a bit and have the progress bar on the top of the cell like X-Raym's Region Clock ?
Thanks again. Conratulatulations, you exceeded twice sum of $ donated to me from one person in all times, so I really appreciate and glad my stuff somehow working for you. Unfortunately I can`t help you as much as a theoretically can.
I noticed indeed in some cases region shown up beat further, hopefully fixed it.
Quote:
Originally Posted by MusoBob
Try adding chords then removing,
it should just go back to how it was with one region same color rather than adding another region without a name.
yeah make sense, see a 1.03 for the fix
Quote:
What do I adjust in the script to scale up the font (so it's a bigger font display) ?
1. if i put a new chord in (split region) it needs to be the same color.
2. can you have offset adjust check box for count-in > 2 Bar Count-in (check box)
and font size adjust at top of GUI for user to set ??
if count-in then gui measure number = gui measure number -2
-1 . . . . 0 . . . . (new line)
1 C . . . 2 G . . . 3C . . . 4 . . . .
**if possible measure 1 will show region/chord name when measure -1 is same name.
It would be good if > Edit region name @ beat moves cursor to that beat,
and quick double click Plays song from beat.
I worked out the cell size adjust
Line 771 Chord Cell Height
obj.chord_h = 60 --43
Line 934 Progress Bar Height
h = 15, --10
I can change the Font
Line 777 Chord Font
obj.GUI_font = 'chords' --'Calibri'
Download chords.ttf
Chord Font Size
Line 918 Font Size
fontsz = 30,--obj.GUI_fontsz,
Measure Number Font Size
Line 870 Measure Number Font Size
fontsz = 25 --fontsz = obj.GUI_fontsz4,
not sure how to leave that as Calibri ? if it needs another obj.GUI_font ?
obj.GUI_font2 = 'Calibri'
obj.GUI_font = 'chords'
but not too worried about that.
I did a few rough mods to get it working better.
The region edit needs fixing and the color is changing from original.
Couldn't work out how to get a new line if 2 bar count-in.
Code:
Line 1022 Move cursor to edit point
reaper.SetEditCurPos(pos_start, 1, 0)
Line 824 Vertical Scroll Bar Handle Alpha
alpha_back = 5.04, --0.4,
Line 867 measure number offset for 2 bar Count-in
txt= i-1,--txt= i+1,
Line 904 add Regions Character Length
region_chrs = 40
if string.len(last_reg_name) >= 1 and string.len(last_reg_name) <= 5 then region_chrs = region_chrs +0 end
if string.len(last_reg_name) >= 6 and string.len(last_reg_name) <= 8 then region_chrs = region_chrs -5 end
if string.len(last_reg_name) >= 9 and string.len(last_reg_name) <= 11 then region_chrs = region_chrs -10 end
if string.len(last_reg_name) >= 12 and string.len(last_reg_name) <= 16 then region_chrs = region_chrs -15 end
Line 921
fontsz = region_chrs, --40,--obj.GUI_fontsz,
Would be great if "render regions" would also exclude those... but maybe that would be only a corner case issue
To exclude the @ Regions, in the Region Manager type @ > Export to csv
> delete the @ Regions > render other regions > Import Merge csv to bring the @ Regions back.
I will send you another donation if you can just fix these thanks:
1. if i put a new chord in (split region) it needs to be the same color as the existing region color for the song part (see pic below),
it's also not removing the old region and leaves a bit behind the new. (see above)
2. can you have offset adjust check box for count-in > 2 Bar Count-in (check box) and font size adjust at top of GUI for user to set,
if count-in then gui measure number = gui measure number -2
-1 . . . . 0 . . . . (new line)
1 C . . . 2 G . . . 3C . . . 4 . . . .
If possible measure 1 will show region/chord name when measure -1 is same name. (see above)
3. In 1.03 the @ ignored regions are black, can you skip them from the EnumProjectMarkers3 names ? (see above)
4. Smaller Font size for longer region characters, (though I could do that see above)
5. If possible font size scales as GUI scales down/up in size. (see above)
If you can do these it should be good to go, Thanks !
Region Color needs to stay the same as existing region to match song part.
I refunded last donation since you already sent much and I can't improve it again and again. I made few fixes yesterday including some of mentioned, see changelog (you probably didn't yet synchronize packages before posting).
I got that all working good now, I added a spk77's right click menu.
I got the bar offset to work with
Code:
cur_pos = reaper.GetCursorPosition()
reaper.Main_OnCommand(40042,0) -- Transport: Go to start of project
start_pos = reaper.GetCursorPosition()
buf = reaper.format_timestr_pos(start_pos, "", -1)
if buf == "-1.1.00" then bar_offset = -1
else bar_offset = 1 end
reaper.SetEditCurPos(cur_pos, 1, 0)
Still not sure how to drop bar 1 to a new line or have the two count-in bars
fit to the window width.
I could not see where you changed it from the original 1 bar per line to 4 bars per line.
Then I might be able to set it to 2 bars per line for measure -1 and 0 then go back to 4 bars per line for measure 1 and up.
Thanks again !
seems like it is the best we can currently do in reaper, using regions to show chords... an yet it has some obvious drawbacks... in that regions have a specific purpose and if we move them the items they define are affected...
Clearly and hopefully reaper will get a chord track... at least one, maybe multiples.... and hopefully even better than Cubase...
it would be so much nicer to just be able to have empty, colored items on a track that is moveable where each 'item' showed a chord name and color.
We could sort of do this with a slew of png images [OMFG] used in the notes of each item... but that would be a nightmare to create and also it would not display in a constant enough manner at various zooms...
...using regions to show chords... an yet it has some obvious drawbacks... in that regions have a specific purpose and if we move them the items they define are affected......
If you move the regions or change the project start measure you need to restart the chord sheet script and it will be adjusted.
For those new to Reaper this might be an easier way to install/update ReaTrak.
1. Reaper > Options > Preferences > General > Export Configuration
check all boxes and Save as backup configuration !!!!
OK got that all done in a separate portable of reaper
one thought to mention is that the first toolbar is only for TB 10 but you have no number on it's name... like you do for the others.
So now what? Plz point me to what else I need to get to actually insert chords in the midi items or whatever.