Old 02-27-2019, 05:16 PM   #1
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default 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.






Last edited by MusoBob; 03-04-2019 at 05:18 PM.
MusoBob is offline   Reply With Quote
Old 03-04-2019, 05:15 PM   #2
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

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):





MusoBob is offline   Reply With Quote
Old 03-10-2019, 11:18 PM   #3
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,335
Default

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)

__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate

Last edited by mpl; 03-11-2019 at 12:21 AM.
mpl is offline   Reply With Quote
Old 03-11-2019, 03:56 AM   #4
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

Thanks Awesome !!!

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

MusoBob is offline   Reply With Quote
Old 03-11-2019, 12:39 PM   #5
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,335
Default

Quote:
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.

Quote:
5. chord editor color same as region color
done

I also moved script to 'Regions' folder.
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote
Old 03-11-2019, 12:45 PM   #6
Jason Brian Merrill
Human being with feelings
 
Jason Brian Merrill's Avatar
 
Join Date: Jun 2006
Location: Northeastern PA, USA
Posts: 20,735
Default

very cool - i assume there's no way to make other regions overlapping these? or am I wrong
__________________
Beliefs do not require respect. People do.
Jason Brian Merrill is offline   Reply With Quote
Old 03-11-2019, 03:19 PM   #7
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

Thanks !
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"

can you move cursor to start and get current measure > -1.1.00

if current measure = -1.1.00 then start measure = -1

-1 . . . . 0 . . . . (new line)
1 C . . . 2 . . . . 3 G . . . 4 . . . .
5 C . . . 6 F . . . 7 G . . . 8 . . . .


...........


if current measure = 1 then start measure = 1

1 C . . . 2 . . . . 3 G . . . 4 . . . .
5 C . . . 6 F . . . 7 G . . . 8 . . . .




-1 & 0 are for count-in: -1 0ne Two 0 one two three four




...
MusoBob is offline   Reply With Quote
Old 03-11-2019, 03:23 PM   #8
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

Quote:
Originally Posted by Jason Brian Merrill View Post
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 ?
MusoBob is offline   Reply With Quote
Old 03-11-2019, 04:18 PM   #9
Jason Brian Merrill
Human being with feelings
 
Jason Brian Merrill's Avatar
 
Join Date: Jun 2006
Location: Northeastern PA, USA
Posts: 20,735
Default

Quote:
Originally Posted by MusoBob View Post
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
__________________
Beliefs do not require respect. People do.
Jason Brian Merrill is offline   Reply With Quote
Old 03-11-2019, 08:34 PM   #10
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

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 ?




Last edited by MusoBob; 03-11-2019 at 09:06 PM.
MusoBob is offline   Reply With Quote
Old 03-11-2019, 08:54 PM   #11
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

Quote:
Originally Posted by Jason Brian Merrill View Post
thats a fantastic idea.

Would be great if "render regions" would also exclude those... but maybe that would be only a corner case issue

You should be able to script that up, there's Script: X-Raym_Add all regions to render queue individually.lua you could modify to ignore "@" regions

or modify X-Raym_Export regions as file.lua to export only "@" regions
then merge the "@" regions back after render.


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


I think this had more region render options
Ultraschall-API - a 800 Lua-functions-library for Reaper (beta 2.73 - 9. March 2019)




...
MusoBob is offline   Reply With Quote
Old 03-11-2019, 09:52 PM   #12
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,335
Default

Please share your project (.RPP) you testing my script with.
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate

Last edited by mpl; 03-11-2019 at 11:07 PM.
mpl is offline   Reply With Quote
Old 03-11-2019, 10:11 PM   #13
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

Here's the region csv


Code:
#,Name,Start,End,Length,Color
R1,C,1.1.00,3.1.00,2.0.00,FF80C0
R2,C,3.1.00,3.2.00,0.1.00,1127AE
R3,G,3.2.00,3.3.00,0.1.00,1127AE
R4,F,3.3.00,3.4.00,0.1.00,1127AE
R5,C,3.4.00,4.1.00,0.1.00,1127AE
R6,Am,4.1.00,5.1.00,1.0.00,3776EB
R7,C,5.1.00,6.1.00,1.0.00,3776EB
R8,G,6.1.00,9.1.00,3.0.00,3776EB
R9,C,9.1.00,10.1.00,1.0.00,3776EB
R10,C,10.1.00,11.1.00,1.0.00,71BEF1
R11,C,11.1.00,12.1.00,1.0.00,1127AE
R12,G,12.1.00,13.1.00,1.0.00,3776EB
R13,C,13.1.00,16.1.00,3.0.00,3776EB
R14,G,16.1.00,17.1.00,1.0.00,3776EB
R15,C,17.1.00,18.1.00,1.0.00,3776EB
R16,C,18.1.00,19.1.00,1.0.00,71BEF1
R17,Am,19.1.00,20.1.00,1.0.00,0B7427
R18,Am,20.1.00,21.1.00,1.0.00,11AE3B
R19,G,21.1.00,23.1.00,2.0.00,11AE3B
R20,Am,23.1.00,25.1.00,2.0.00,11AE3B
R21,F,25.1.00,26.1.00,1.0.00,11AE3B
R22,F,26.1.00,27.1.00,1.0.00,50ED7B
R23,Dm,27.1.00,28.1.00,1.0.00,0B7427
R24,G,28.1.00,29.1.00,1.0.00,11AE3B
R25,Am,29.1.00,30.1.00,1.0.00,11AE3B
R26,F,30.1.00,31.1.00,1.0.00,11AE3B
R27,Dm,31.1.00,32.1.00,1.0.00,11AE3B
R28,F,32.1.00,33.1.00,1.0.00,11AE3B
R29,C,33.1.00,34.1.00,1.0.00,11AE3B
R30,G,34.1.00,35.1.00,1.0.00,50ED7B
R31,C,35.1.00,36.1.00,1.0.00,1127AE
R32,G,36.1.00,37.1.00,1.0.00,3776EB
R33,C,37.1.00,40.1.00,3.0.00,3776EB
R34,G,40.1.00,41.1.00,1.0.00,3776EB
R35,C,41.1.00,42.1.00,1.0.00,3776EB
R36,C,42.1.00,43.1.00,1.0.00,71BEF1
R37,C,43.1.00,44.1.00,1.0.00,1127AE
R38,G,44.1.00,45.1.00,1.0.00,3776EB
R39,C,45.1.00,48.1.00,3.0.00,3776EB
R40,G,48.1.00,49.1.00,1.0.00,3776EB
R41,C,49.1.00,50.1.00,1.0.00,3776EB
R42,C,50.1.00,51.1.00,1.0.00,71BEF1
R43,Am,51.1.00,52.1.00,1.0.00,0B7427
R44,Am,52.1.00,53.1.00,1.0.00,11AE3B
R45,G,53.1.00,55.1.00,2.0.00,11AE3B
R46,Am,55.1.00,57.1.00,2.0.00,11AE3B
R47,F,57.1.00,58.1.00,1.0.00,11AE3B
R48,F,58.1.00,59.1.00,1.0.00,50ED7B
R49,Dm,59.1.00,60.1.00,1.0.00,0B7427
R50,G,60.1.00,61.1.00,1.0.00,11AE3B
R51,Am,61.1.00,62.1.00,1.0.00,11AE3B
R52,F,62.1.00,63.1.00,1.0.00,11AE3B
R53,Dm,63.1.00,64.1.00,1.0.00,11AE3B
R54,F,64.1.00,65.1.00,1.0.00,11AE3B
R55,C,65.1.00,66.1.00,1.0.00,11AE3B
R56,G,66.1.00,67.1.00,1.0.00,50ED7B
R57,C,67.1.00,68.1.00,1.0.00,1127AE
R58,G,68.1.00,69.1.00,1.0.00,3776EB
R59,C,69.1.00,72.1.00,3.0.00,3776EB
R60,G,72.1.00,73.1.00,1.0.00,3776EB
R61,C,73.1.00,74.1.00,1.0.00,3776EB
R62,C,74.1.00,75.1.00,1.0.00,71BEF1
R63,C,75.1.00,76.1.00,1.0.00,1127AE
R64,G,76.1.00,77.1.00,1.0.00,3776EB
R65,C,77.1.00,80.1.00,3.0.00,3776EB
R66,G,80.1.00,81.1.00,1.0.00,3776EB
R67,C,81.1.00,82.1.00,1.0.00,3776EB
R68,C,82.1.00,83.1.00,1.0.00,71BEF1
R69,Am,83.1.00,84.1.00,1.0.00,1127AE
R70,Am,84.1.00,85.1.00,1.0.00,3776EB
R71,G,85.1.00,87.1.00,2.0.00,3776EB
R72,Am,87.1.00,89.1.00,2.0.00,3776EB
R73,F,89.1.00,90.1.00,1.0.00,3776EB
R74,F,90.1.00,91.1.00,1.0.00,71BEF1
R75,Dm,91.1.00,92.1.00,1.0.00,0B7427
R76,G,92.1.00,93.1.00,1.0.00,11AE3B
R77,Am,93.1.00,94.1.00,1.0.00,11AE3B
R78,F,94.1.00,95.1.00,1.0.00,11AE3B
R79,Dm,95.1.00,96.1.00,1.0.00,11AE3B
R80,F,96.1.00,97.1.00,1.0.00,11AE3B
R81,C,97.1.00,98.1.00,1.0.00,11AE3B
R82,G,98.1.00,99.1.00,1.0.00,50ED7B
R83,C,99.1.00,103.1.00,4.0.00,97D0FE
MusoBob is offline   Reply With Quote
Old 03-12-2019, 03:45 PM   #14
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

I can upload the RPP but I was just using these csv, the 6-8.csv is 6/8 time signature

https://www.reatrak.com/downloads/test_files/templates/
MusoBob is offline   Reply With Quote
Old 03-12-2019, 05:47 PM   #15
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

Thanks again I will send you more donation !

You could make it bigger and have less lines per page.
This would give room to fit the progress bar at the top of the cells.




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.

MusoBob is offline   Reply With Quote
Old 03-12-2019, 10:11 PM   #16
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,335
Default

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 View Post
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) ?
Missed this one, try to change line 918
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate

Last edited by mpl; 03-12-2019 at 10:53 PM.
mpl is offline   Reply With Quote
Old 03-13-2019, 12:51 AM   #17
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

Brilliant !!!
That seems to work great now.

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.


Just those will make it ready to go.
Thanks !





MusoBob is offline   Reply With Quote
Old 03-13-2019, 01:39 AM   #18
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

Another issue is long chord names, maybe it could adjust the font size automatically depending on number of characters in region name ??





Here's some chord name lengths, the longest would be like C#13sus#5#9#11, but would not worry too much
as most would only be a few characters.


Last edited by MusoBob; 03-13-2019 at 01:46 AM.
MusoBob is offline   Reply With Quote
Old 03-14-2019, 07:00 PM   #19
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

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.



Last edited by MusoBob; 03-15-2019 at 01:43 AM.
MusoBob is offline   Reply With Quote
Old 03-15-2019, 05:36 AM   #20
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

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,
Big Pic



When the bars are edited they should stay the same color like this



maybe the font size can scale down with the GUI.


Last edited by MusoBob; 03-15-2019 at 03:09 PM.
MusoBob is offline   Reply With Quote
Old 03-15-2019, 09:17 PM   #21
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

Quote:
Originally Posted by Jason Brian Merrill View Post
thats a fantastic idea.

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.



MusoBob is offline   Reply With Quote
Old 03-15-2019, 09:51 PM   #22
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

In 1.03 the @ ignored regions are black:


MusoBob is offline   Reply With Quote
Old 03-17-2019, 05:21 PM   #23
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 539
Default

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.
MusoBob is offline   Reply With Quote
Old 03-17-2019, 08:25 PM   #24
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,335
Default

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).

Measure offset, font size and new region color behaviour options will be added later today as lines of code in the script header.
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl 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:58 PM.


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