pinobatch / pently

Scalable music engine for NES games
zlib License
72 stars 4 forks source link

Specify arpeggios using chord names #12

Closed pinobatch closed 7 years ago

pinobatch commented 7 years ago

EN47 isn't very intuitive to those more familiar with common practice notation. While researching LilyPond chord mode, I realized that naming chords might make things easier. I borrow the @ENxxx = notation from MCK guide.

@ENM = 47
@ENaug = 48
@ENdom7 = 49
@ENmaj7 = 4A
@ENm = 37
@ENm7 = 3A
@ENdim = 36
@ENdim7 = 39
@ENsus4 = 57
@ENpower = 7C

Then when chord names are used in music, they expand to the nibble

relative
# Assuming the above definitions, this
ENm a'4 a8 ENM g4. f2.
# does the same as this
EN37 a'4 a8 EN47 g4. f2.

Chord names can have letters or digits. They are case-sensitive to allow distinguishing M for major from m for minor. To avoid confusion with hexadecimal arpeggios, chord names must start with a letter, and one- or two-letter chord names must contain a letter in [G-Zg-z]. But this means the hardcoded "off" behavior can be turned into a predefined name:

@ENOF = 00

(This is the second of at least five chord-related feature requests.)

pinobatch commented 7 years ago

While implementing other arp feature requests, I've added eight predefined chord names. I still plan to add ability to define new chord names in the pitch context of the current scope (pattern, song, or entire score).