Ok bob,
Here is may latest offering. I think i have completed everything that I want to do with it now. Including improving the chord shape algorithm. It now tries to put the 7th or the top note any chord with four notes up nearest to the top string. previously it just search for the notes nearest the guitar nut . I have got the + - prefix working on the chords. see:
chordBarreFretNo = 0
if ct.name.startswith('+'):
chordBarreFretNo = 12
if ct.name.startswith('-'):
chordBarreFretNo = -12
produces this
Plectrum +C chord [12, 16, 19]
64 | - - - - - - - - - - - * - - - - - - - 1 76
59 | - - - - - - - - - - - : * - - - - - - 0 72
55 | - - - - - - - - - - - * - - - - - - - 2 67
50 | - - - - - - - - - - - : - * - - - - - 1 64
45 | - - - - - - - - - - - : - - * - - - - 0 60
40 | - - - - - - - - - - - * - - - - - - - 1 52
Plectrum -D chord [-10, -6, -3]
64 : - * - - - - - - - - - | - - - - - - - - - - - - - - - - - - - 1 54
59 : - - * - - - - - - - - | - - - - - - - - - - - - - - - - - - - 0 50
55 : - * - - - - - - - - - | - - - - - - - - - - - - - - - - - - - 2 45
50 * - - - - - - - - - - - | - - - - - - - - - - - - - - - - - - - 0 38
45 * - - - - - - - - - - - | - - - - - - - - - - - - - - - - - - - 2 33
40 : - * - - - - - - - - - | - - - - - - - - - - - - - - - - - - - 1 30
I would still like to have the ability to put in barred guitar codes as my code already handles it. Guitarist often move up the fret board when playing.
Maybe we could use something like "Gmaj:barre5" which is preferable to "^5Gmaj" that I suggested earlier. All your other patterns would ignore the everything after and including the trailing ':'. Please note there is no transposing here it is still a Gmaj chord (but played using a different chord shape further up the neck.)
So my code is finished now the only thing I can thing that I can think of that is outstanding is handling very wide strums values like 150 and so the notes overlap a the next and previous strum. I have tested and it seems to cause no major problems. so it is Ok to merge now. Please make all your suggested changes first to PLECTRUM as I have not done so.
Answering you points Capo and tuning should be stored like everything else in mma. I think I implemented this when I changed pat.py and parse.py.
bob>1. I think that you should honor the Octave setting.
I think this will only add confusion as we can change the pitch with tuning and also the capo settings (
octave can be achieved with a +12 or a -12 capo (yes negative capos are allowed) using the OCTIVE variable should in my opinion print a warning when attempted.
bob> 2. Do you need a strum variable.
No I think the strum variable should be disallowed with plectrum to avoid confusion (print a warning when attempted).
bob> the parser should be able to handle "1.0 +5 90"
Done
Please be a aware that doing a "1.0 +5 90" causes half the notes to be played BEFORE the beat. (I think you send a program change on the beat when starting up a new groove. so the first few notes may be played as a piano sound.)
Finally I think we could drop the trailing \ at the end of each line. I don't think it is needed when the { and } mark the beginning and end of the of the sequence.
By the way I really like that magic-is-the-moonlight-plectrum.mid, it really fills out the whole sound now. It is great hear my code working for real. (By the way perhaps it could do with some "up strums" to sound more natural - unless that was an effect you deliberately intended)
Louis