Re: guitar chords
[email protected] (Jean-Pierre Vidal) Wed, 22 Dec 2004 21:25:09 +0000
| Newsgroups | perl.midi |
|---|---|
| Message-ID | <[email protected]> |
Le mercredi 22 D=E9cembre 2004 11:22, Joshua N Pritikin a =E9crit=A0: > On Wed, 2004-12-22 at 11:48 +0100, Christian Renz wrote: > > "Chord" can mean two different things: > > - Several notes played together on any instrument. E.g. placing your > > elbow on the piano could be considered playing a chord > > - An abstract concept that music theory has established of a > > collection of notes with a certain function. >=20 > Yah, sorry, I don't know much about this stuff. I generally place my > elbow on the piano. >=20 > > If you want something that sounds like > > a guitarist, you will need a software that plays guitar voicings (and > > also simulates strumming, I guess). >=20 > Yah, I suppose I can simulate strumming simplistically by starting each > note of the chord a fraction of a second after the last. That seems > like it would be pretty easy to code with the Perl MIDI module. >=20 > The hard part, for me, is knowing which 6 notes correspond to Am with > Capodaster on 4e fret (or whatever). >=20 > --=20 > A new cognitive theory of emotion, http://openheartlogic.org >=20 >=20 Hi, Joshua Your original question was: "mapping from stuff like "Em C D B7 Em" into=20 notes?" =20 This is more music than MIDI, but in case this help: =46irst, you have to know what is a major chord (like C, D...), a minor cho= rd=20 (like Em, Bbm...), a seventh (B7, D7...), a major seventh (EM7, DbM7...) an= d=20 so one. You must also understand there are not "guitar chords" which will b= e=20 differents from "piano chords", as said Chritian Rentz: there are "music=20 chords", _played_ in different ways (with different digits positions) on=20 different instruments, and _writen_ in different ways on music sheets. =20 I - We start from the notes suite used in contemporary music: =2E.. F F# G G# A A# B C C# D D# E F F# G G# A A# B C ..= =2E=20 a.l. or equivalent =2E.. F Gb G Ab A Bb B C Db D Eb E F Gb G Ab A Bb B C ..= =2E=20 a.l. In fact, if you consider the note suite as a list, appending a '#' to a not= e=20 increase the list index, appending a 'b' decrease it (modulo:-). In MIDI,=20 this suite is coded from 0 (very low midi C) to 127 (very high midi A). You must know this because: 1) B can be writed as Cb, C as A#, E as Fb, F as E#... (Cb7 =3D=3D B7, E#7 = =3D=3D F7),=20 and you have to interpret e.g. E#7 as a Fb7. 2) some chords will handle 'double-#' or 'double-b' (they are quite uncommo= n,=20 but they exists...). For instance, a GbbM7 is equivalent to a FM7 (Gbb =3D= =3D=20 Gb-1 =3D=3D F) This said (analysis of input Em C D B7 Em), how to construct a: major chord?: base note, base note + 4, base note + 7 (I'll notate this bn+= 4+7=20 later) (C chord is C,E,G; Ab chord is Ab,C,Eb...) minor chord?: basenote, base note + 3, base note + 7 (Cm chord is C,Eb,G; Abm chord is Ab,B,Eb; Am chord is A,C,E...) seventh chord?: bn+4+7+10 (D7 is D,Gb,A,C) minor seventh?: bn+3+7+10 (Ebm7 is Eb,Gb,Bb,Db) major seventh?: bn+4+7+11 (Fmaj7 -or FM7- is F,A,C,E) There are plenty of other chords (eleventh, major eleventh, reduced...), I= =20 don't know where to get them on the net, I think it is posssible.=20 II - Now you start on a guitar, which base notes are (from low to high,=20 without a capodaster) E A D G B E, beginning, as said Noel Raison, on E =3D= =20 midi note 40 ; E =3D 40 A =3D 45 D =3D 50 G =3D 55 B =3D 59 E =3D 64 # which is 40 + 12 + 12 =3D two octaves upper the lower E ( But: ignore the capodaster, just think "if I put it on the first fret, the= =20 base notes of the strings are increased by one, and became" : E# (F) =3D 41 A# (Bb) =3D 46 D# (Eb) =3D 51 G# (Ab) =3D 56 B# (C) =3D 60 E# (F) =3D 65 # which is 41 + 12 + 12 =3D two octaves upper the lower E# (F) ) So an algorithm could be: determine the chord's notes list for each guitar string starting whith the first note (according to the capodaster position) reach the first note (increasing the index of the notes list) which belon= gs=20 to a note of the chord (one fret =3D +1) store it && next string I hope there are no errors in my examples... :-( maybe the address http://www.xguitar.com/help/chords.html can help you (may= be=20 not) You last question was : "The hard part, for me, is knowing which 6 notes=20 correspond to Am with Capodaster on 4e fret (or whatever)." Capodaster on 4e fret give your guitar tuned to (from low to high) E+4 =3D G# =3D Ab =3D 44 A+4 =3D C# =3D Db =3D 49 D+4 =3D F# =3D Gb =3D 54 G+4 =3D B =3D 59 B+4 =3D Eb =3D D# =3D 63 E+4 =3D Ab =3D G# =3D 68 # which is 44 + 12 + 12 =3D two octaves upper the = lower E The notes for Am are A,C,E so the algorithm gives 1st string : +1 (Ab to A) =3D 45 2nd string : +1 (Db to E) =3D 50 3rd string : +3 (Gb to A) =3D 57 4th string : +1 (B to C) =3D 60 5th string : +1 (Eb to E) =3D 64 6th string : +1 (Ab to A) =3D 69 [If we consider a real guitar played by a real musician, it will be better = to=20 put the capodaster on 5th fret, an put only a digit on the 2nd fret above t= he=20 the capodaster, since (+1, +1, +3, +1, +1, +1) become (0, 0, 2, 0, 0, 0)] hth Jean-Pierre