ssb22 / jianpu-ly

Jianpu in Lilypond
http://ssb22.user.srcf.net/mwrhome/jianpu-ly.html
Apache License 2.0
70 stars 18 forks source link

[Feature] Guitar chords in jianpu-ly #44

Closed suntong closed 8 months ago

suntong commented 11 months ago

Similar to #36, this time it is the above note:

image

| c3 ^"C" - c5 | c2' ^"G7" - - | c1' ^"C" - c5 | c4 ^"F" - -
| c3 ^"C" - c3 |
ssb22 commented 11 months ago

The correct way to do guitar chords in Lilypond is with \chordmode:

LP: << {
:LP
c3 - c5 | c2' - - | c1' - c5 | c4 - - | c3 - c3 |
LP: } \new ChordNames { \chordmode { c2. g:7 c f c } } >>
:LP

Maybe we should do something to make this more automatic.

^"" is not a good choice for chord names because it's meant for instructions like "faster" and it will put each one at a different height (and also the MIDI output doesn't understand it; doing chord names properly means you get the chords in the midi as well)

suntong commented 11 months ago

Wow, that looks ... really ... complicated.

Maybe we should do something to make this more automatic.

Yes please think of a better way of authoring it. Otherwise, I think I'll be completely ignoring it as it is just way too difficult to do. Just as a reference, here is how simple to do guitar chords in ABC:

|: "C"E2G | "G7"d3 | "C"c2G | "F"F3 | "C"E2E | EFG | "Dm"A3 | "G7"G3 |
| "C"E2G | "G7"d3 | "C"c2G | "F"F3 | "C"E2G | "G7"GAB | "C"c3- | c3 ||
||"G7"d z/G/ G | BAG | "C"E2G | c3 | "F"A2c | "D"d2c | "G"B3 | G3 |
| "C"E2G | "G7"d3 | "C"c2G | "F"F3 | "C"E2G | "G7"GAB "C"c3 | c3 :|

(Taken from here.)

Also, if possible, design the guitar chords implementation similar to ABC please, i.e., the guitar chords before the note, instead like above note, which follows the music note instead.

I'll leave this open for you to close.

Thanks

suntong commented 7 months ago

Bravo!

I finally got around to test today, but just realized that I literally know nothing about the Guitar chords.

So given the above ABC notation of the Guitar chords, how to translate them into jianpu counter-notes pls? What's the rule to transcode from ABC notation of the Guitar chords into jianpu's? thx.

suntong commented 7 months ago

NVM, the question should be what's the rule to transcode from ABC notation of the Guitar chords into Lilypond's, and I'll try to find that answer myself...

suntong commented 7 months ago

Found one https://github.com/lilypond/lilypond/blob/master/scripts/abc2ly.py, but it's super difficult to figure out the rules for the transcode...

ssb22 commented 7 months ago

so Lilypond needs to know the duration of each chord: 4 for one beat, 2 for two beats, 2. for three beats, 1 for four beats. Default is the same duration as the previous chord, so usually you need to set this up only at the beginning.

For a 7th chord, add :7 (after the duration, if any).

For a "power chord" add :5 (I don't think you'll be doing power chords in this sort of music though)

For minor, it's :m

For minor 7th, it's :m7

Augmented is :aug and diminished is :dim

Sharp is is and flat is es (sorry this is all Lilypond code, there's no extra layer of translation right now)

Lilypond also has a function to draw the fingering diagrams for the chords; maybe we should make that an option

SilverRainZ commented 6 months ago

wow, I want this function very much, thank you :D

B.T.W. Jianpu usually does not pay much attention to the absolute pitch. Is it possible for us to only label the "level" (I II III IV V VI VII) of the chord rather than the absolute note (A B C D E F G) ?

suntong commented 5 months ago

Jianpu usually does not pay much attention to the absolute pitch. Is it possible for us to only label the "level" (I II III IV V VI VII) of the chord rather than the absolute note (A B C D E F G) ?

I had no idea what the comment meant by then, but having read/watch a lot about it, I think I now know. But still, I now also know why chords are done in absolute note, as there's reason behind it. Even the ABC notation is like that, for the same reason I believe.

ssb22 commented 3 weeks ago

Chord names as numbers is now being discussed in #55