Proposed syntaxes for clefs in ABC - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1. The default clef for music printed from ABC is treble, and the default mapping of ABC notes to the staff puts the letters EGBdf on the staff lines. For sound generators, these map to the pitches A=880 and a=1760. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2. How to specify a clef or clef change. The treble, alto and bass clefs may be specified in three places: 2.1 In a key signature line: K: Eminor clef=bass K: Eminor clef=F 2.2 In a voice line: V: 3 name="Viola" clef=alto V: 3 name="Viola" clef=C 2.3 Inline as a "key change" within the music: ... [K:clef=bass] ... In any of these, "clef=" may be omitted before the words "treble", "alto" and "bass". You can also use clef=G, clef=C or clef=F, if you prefer, though with these, the "clef=" may not be omitted, to avoid confusion with keys. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3. Mapping ABC notes to staff notes. With music formatting programs, for which the actual pitch of a note isn't significant, the only effects of a clef are to say which clef is drawn and how ABC letter notes map to staff lines and spaces. 3.1 Which clef is drawn on the staff. An inline change should draw the clef at that point; others should draw it at the start of each staff until it is changed. 3.2 The mapping of ABC notes to the staff. Unless overwritten by options, external commands or the middle= clause described below, the names of the lines of the staff are: clef lines ------ ----- treble EGBdf alto FAceg bass GBdfa Explained differently, here is what the lines and spaces are called for each of the clefs: treble alto bass --f-- --g-- --a-- e f g --d-- --e-- --f-- c d e --B-- --c-- --d-- A B c --G-- --A-- --B-- F G A --E-- --F-- --G-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4. Octave adjustment. The above mapping of letters to staff lines is the default, because it makes for easy typing and reading. But it is often useful, especially in multi-staff music, to use other mappings. Also, the Early Music crowd often puts clefs on different lines. To achieve these mappings, a clef clause may include middle= This gives the ABC note for the middle line of the staff. Thus, the standard three clefs might be written as: clef=G middle=B % treble clef=C middle=c % alto clef=F middle=d % bass These are the mappings implied by "treble", "alto" and "bass" alone. For a piano double staff, you might prefer the notation: V: 1 clef=treble middle=b V: 2 clef=bass middle=D This would map CDEFGAB to the top of the lower staff and cdefgab to the bottom of the upper staff. The effect is to shift the ABC notes down one octave from the usual treble clef. There is ABC generated by some programs that uses the mapping clef=bass middle=D, This is awkward to type, but is useful for people generating sound files, because it gives ABC notes the same pitch with both clefs. For another example, the French violin clef could be indicated by: clef=treble middle=d This is, of course, the same as a bass clef, but a treble clef will be drawn and positioned a line lower than usual. Similarly, the Early Music crowd will recognize the mappings: clef=bass middle=f clef=alto middle=E Older (or sloppy) bass lines may use any of the three above mappings without a middle=clause. A simple way for programs to guess which was intended is to count commas and apostrophes. Any apostrophes at all or few commas implies the "middle=d" mapping. Many double commas means the "middle=D," mapping was used. Any mention of common keyboard instruments in the header lines implies that "middle=D" was probably used. This isn't guaranteed to be correct in all cases, but will usually give the correct mapping. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5. Pitch for ABC players. The ABC notes CDEFGABcdefgab don't inherently have any pitch. This is true of printed music, and it is expected that music will be played at many different pitches on different instruments. Programs that convert ABC to sound should have commands to map the music to a specific pitch. This is outside the purview of ABC itself. However, as with printed music, it is convenient if there is a default assumption of the pitch associated with ABC notes, and a way to hint about the intended pitch. We can give these pitches as the frequency of one specific note: clef=treble A=880 clef=alto a=880 clef=bass A=220 Nothing here should be taken to imply that these are the "right" values, however, and any note might be used as the pitch standard. While 'a' or 'A' would be the usual note, for transposing instruments a different note might be preferred. Thus, a part for Bb bass clarinet might be indicated by: clef=bass B=440 Player programs should have options to override any such pitches in the ABC, so that users may tune the music to their instrument. Music formatter programs will simply ignore any such pitch clauses. It is also a good idea for player programs to look for indications of transposition in V: names, and implement the appropriate pitch shifts by default. Thus, the voice V: 3 name="Bb clarinet I" should imply that the default pitch is B=880. If the voice contains the term 'bass', the default pitch should be B=220. And so on. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6. Octave qualifiers. A clef name may have "+8", "-8", "+15", or "-15" appended. Printed music should show these above or below the clef in the usual form to indicate voices one or two octaves different from the default pitch. Sound generators should use these to adjust the pitch by a factor of two or four in the appropriate direction. For example V: 2 name="Sop. rec." clef=treble+8 would be appropriate for soprano recorder, which is written with treble clef with '8' above it, and pitch A=1760. Similarly, V: 5 name="contrabassoon" clef=bass-8 middle=d A=110 would show a bass clef with '8' below the clef symbol, and the bottom space would be A=110. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 7. Full syntax of clefs A clef may be specified in a K: or V: line. The clef clauses are: := clef=[] [] [] := 'treble' | 'alto' | 'bass' | 'G' | 'C' | 'F' := '+8' | '-8' | '+15' | '-15' := = The 'clef=' may be omitted for the spelled-out clef names, but not for clefs identified by letter names. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -