text:
Talk:Key signature

7+sharps/flats, Modes
The article explains that the seven-sharp and seven-flat key signatures are rare but they have nonetheless been used. Why have they? Also, the article doesn't explain how modes play into the whole thing. I would imagine that F lydian uses the same key signature as C major, right?

--Furrykef 05:16, 17 May 2004 (UTC)

 * I'll try to explain here: Lets assume that a large scale piece is "in A major". If a section of that piece takes place on the mediant, and is in major, it would "correctly" be notated in C# major, with seven sharps. However, this is fairly rare, and more rare still considering subsidary key areas are often not notated with a change of key signature and that this change could be notated or enharmonically ("incorrectly") as Db major. Hyacinth 20:55, 18 May 2004 (UTC)

 * There may also be more mundane reasons; the Bach prelude and fugue cited in the article, for example, is notated in C sharp major rather than D flat major because (if I remember rightly) Bach took an old piece he had written in C major and just stuck seven sharps in the key signature to put it in the required key - much easier than re-notating the whole thing in D flat major.

 * Incidentally (a bit off-topic this), I've been looking at Chopin's mazurkas for fun, and noticed that in Opus 6, No. 2, there is a passage which is notated in G sharp major - eight sharps, that is, seven sharps and then F sharp again making F double sharp. This happens because G sharp major is the dominant parallel major of the piece's home key, C sharp minor. Of course, this isn't expressed in a key signature, but it's sort of interesting anyway, I think. --Camembert

Proposed outline

 * 1) Intro: In music and musical notation, a key signature is a series of sharps or flats placed on the musical staff.
 * 2) Indicates:
 * 3) A key signature indicates which notes or pitches are to be played one semitone sharp or flat. The "standard" against which notes are raised or lowered are the natural or white keys of the musical keyboard.
 * 4) Despite being called the "signature" of a "key", or tonic, it does not indicate, by itself, the Key, mode, or scale. However, if one knowns the key or tonic and the key signature then one can deduce the scale or mode.
 * 5) Accidentals are flat, sharp, or natural signs outside of a key signature. They may appear throughout a score. These override the key signature for the duration of the bar they occur in. Thus a written F, in key signature with F#, will be played F# unless it has an accidental natural sign immediately preceding it and any written Fs in that octave will be played as F#s until the next measure.
 * 6) During a modulation or change of key, the key may be temporarily different than the one still indicated by the key signature, or the key signature may change also.
 * 7) History
 * 8) Purpose: The purpose of key signatures is to avoid having to write sharps and/or flats before every note which would require one. The lines and spaces of the musical staff represent the white keys of a piano. This represents the C major and A minor scales and all modes beginning on the appropriate pitches. However, if one wishes to write in another scale, such as G major, one would need to write a sharp sign before each F that one used. Rather than do this, a key signature consisting of one sharp on the line for F, is added to the beginning of the score. Thus key signatures are a convenience of notation in tonal music, but are less usual and thus less frequently found in atonal music.
 * 9) Design
 * 10) Standard:
 * 11) Key signatures are generally written immediately after the clef at the beginning of a line of musical notation, although they can appear in other parts of a musical score.
 * 12) They contain only sharps or flats and only in the order of the circle of fifths
 * 13) Non-standard: Nonstandard key signatures not included in the chart below are sometimes used by composers. One example being the key signature to Frederic Rzewski's song "God to a Hungry Child" (lyrics by Langston Hughes), which features Bb, Eb, and an F# in one key signature but which starts in the key of D with a D major chord.
 * 14) misc: from F to B, the set of notes used in C Major or A Minor scale.

list of songs?
Perhaps someone should include in the articles for each key a list of songs or pieces in it? I know some do but it's not ocmprehensive enough.

That's not very logical. Most songs can be arranged in various keys by various arrangers. Look in a few songbooks that you think have at least one song in common. Look up the song in each songbook. Are they in the same key?? If the answer is yes, then try either another song or a third songbook with the same song. Georgia guy 00:50, 24 November 2005 (UTC)

Is is logical!! List the songs in the recorded keys beside the artist who made it most popular. This would be an excellent resource to vocalist and music teachers who are trying to teach Guitar or Recorder to elementary kids (my situation) and you are limited on time and what they can retain. A list like this would allows folks like myself to teach a tune with A D E to 3rd through 5th grade class on the open strings of the Guitar. Since music is one of the biggest problems in public school being worked into the schedule reasonably, we are forced to utilize as many tricks as we can to improve retention, attention and cover the National Music Standards all at once.

Mr. Kreston Smith Munford Elementary Munford TN

Bartlett Music Academy and Store CEO and Private Teacher — Preceding unsigned comment added by 96.4.168.5 (talk) 16:53, 15 April 2013 (UTC)

Non-diatonic key signatures
Anyone know of a widely used non-diatonic key signature not in the table?? Georgia guy 21:33, 19 June 2006 (UTC)
 * Freygish key signatures are non-diatonic, although some musicians trained in "standard" western music prefer to see Klezmer music written in a familiar diatonic key signature with accidentals throughout the piece. The key of A Freygish, for example, may be written with one flat (B) and one sharp (C), but not all music notation programs support this. __Just plain Bill (talk) 04:25, 4 August 2008 (UTC)

Key signature with 1 flat in
I am trying to arrange a piece of music using the music software Sibelius, and am having trouble with the key signature. The music shows a key signature with a G flat in. I was wondering if anyone knew the name of this signature so I could enter it in Sibelius? Thanks! Hawk —Preceding unsigned comment added by 82.46.31.38 (talk • contribs) 23:36, July 8, 2006
 * Well, a key signatre with one flat has to be B. G-flat is the fifth flat in key signature order. Georgia guy 23:44, 8 July 2006 (UTC)

 * Late response, but a B flat on a bass staff could look like a G flat to someone automatically assuming G-clef note placement. Noteworthy Composer allows "custom" key signatures. I haven't found a way to get GNU Lilypond to do that. __Just plain Bill (talk) 02:50, 4 August 2008 (UTC)
 * Good point, the OP didn't identify the clef. The key sig chart shows the treble clef only, so would it be possible to answer the question by reading the article? --Jtir (talk) 16:48, 5 August 2008 (UTC)
 * Yes, with diligence. Clef is linked in the lead, as it was in July of 2006. The Relation of signature to key section now shows (although it didn't back then) key signatures with two flats, B and E, on a grand staff with both clefs.
 * (I'm probably not the only person who has missed seeing an alto clef, and wound up playing more or less a minor second seventh away from where it's supposed to go, mindlessly assuming it was a treble staff.) __Just plain Bill (talk) 23:01, 5 August 2008 (UTC)
 * OK, I see you added a sentence about notation software in addition to the example image. Why isn't there a clef in the the Freygish example? ISTM, the article is still a bit POV wrt to clefs, but I guess you don't need to be told that. :-) --Jtir (talk) 22:33, 6 August 2008 (UTC)
 * Missing clef? Not any more... no problem limiting the presentation to treble clef, since that's the one most folks are most familiar with. We're not here to educate the reader exhaustively on every page; there are links, for those who care to follow them. __Just plain Bill (talk) 00:03, 7 August 2008 (UTC)

Disagree with this sentence
"...if you see a piece with a one-sharp key signature, you cannot be certain it is in G major."

The composition will be in either G major or E minor. Of course it may fleetingly move elsewhere, but if it were not principally in G maj or E min it would have a different key signature.

Relative major / Relative minor, could be better explained on this page.

If the piece is tonal it will will be composed around a tonic note, which is G if major, E if minor or some other note for other mode.

Karl 10 July 08:35 UT
 * Karl, it seems you have little experience with Baroque music, where the key signature often doesn't match the tonality. Many pieces with two flats are in C minor, with the A-flats added as accidentals throughout. Bach's famous Dorian toccata is in D minor with no key signature (here, too, the B flats are present as accidentals). One can find examples like this as late as Haydn. —Wahoofive (talk) 04:09, 15 October 2006 (UTC)
 * Here in the 21st century we have a living tradition of fiddle tunes, with new ones still being composed, sometimes even written down on treble staves. One sharp? Most probably G major, or E minor, or D mixy, or A dorian, until the next mode comes along. It's not uncommon to see tunes such as Flop-Eared Mule in two key signatures, one each for the A and B parts (1st & 2nd turns, or strains) or a tune like Da New-Rigged Ship which starts somewhere around A major and finishes in the neighborhood of A minor, unless I'm thinking of a different one... __Just plain Bill (talk) 22:28, 1 August 2008 (UTC)
 * And similarly (though this is really a better example), if you see a piece with no key signature, it doesn't have to be in C major or A minor: it could be in another key, and the key signature is omitted for some other reason (e.g. it modulates very frequently, such as Mozart's K.475 Fantasia). Double sharp (talk) 07:10, 5 January 2014 (UTC)
 * (Or, even more obviously, it could simply be atonal.) Double sharp (talk) 15:12, 14 May 2015 (UTC)

Exotic key signatures
We really should include a section on modes expressed through key signatures (e.g. D flat and A flat = ahavo-rabo mode) and acknowledge that these exist. Amber388 15:21, 13 October 2006 (UTC)

 * What is an exotic key signature?? Georgia guy 20:49, 13 October 2006 (UTC)

 * The most common definition seems to be a key signature that cannot designate a major key (assuming of course that the key signature is correct for the key). (I don't say minor key, because a key signature with only G♯ might reasonably be deemed to designate the key of A minor.) Double sharp (talk) 07:11, 5 January 2014 (UTC)

"In-between" key signatures
How do you decide the key signature of a piece tuned between e.g. C and C-sharp? (Well, to be pedantic, a piece tuned a quarter-tone over C...) 85.228.206.181 12:03, 5 November 2006 (UTC)

 * Because key signatures only affect the 12 notes of the scale. You're discussing an issue of tuning, which key signatures have little control over.  You could either simply notate in C major and make a note that the instrument should be tuned a quarter tone sharp, or you could make really unnecessary use of the quarter- and smaller-tone notations mentioned in the microtonality article. Amber388 16:47, 5 November 2006 (UTC)
 * This probably won't answer your question, but the Accidental article has some quarter-tone examples. —Wahoofive (talk) 22:25, 5 February 2007 (UTC)

"Semitones"
The start of the page says that a key signature denotes that each note is played a semitone higher or lower. This is inaccurate, a key signature shows that a note is played one half step higher or lower, not a semitone (quarter step). 72.70.158.183 21:04, 5 February 2007 (UTC)Dan
 * I think you're confusing US notation with British: semitone is correct, half-step is American. — Gareth Hughes 21:17, 5 February 2007 (UTC)
 * Well, in America, a semitone and a half step are two different things. A semitone is a quarter step, located between two half steps (i.e., the pitch between C and C#).  I asked my music theory teacher about this, and she confirmed the difference. 72.95.15.198 20:22, 6 February 2007 (UTC)Dan
 * Not to speak for all Americans, but I've always been under the impression that a semitone and a half-step are the same thing. See any number of American-English dictionaries on the matter for confirmation.  I believe you are confusing the word semitone with smaller tonal subdivisions, such as those found in microtonal music.  71.199.186.236 02:37, 22 March 2007 (UTC)
 * My 1965 Merriam Webster's presents 'half-step' as a synonym for 'semitone'. However, the only relevant definition of half-step in the same dictionary is "the pitch interval between any two adjacent keys on a keyboard instrument --- called also semitone".  That said, I have always been taught that a half-step has the size of the interval between B and C, namely one-twelfth of an octave.CountMacula (talk) 05:30, 2 April 2013 (UTC)

Key signature graphics
Who deleted the key signature graphics? unsigned comment by User:71.174.72.72 —Wahoofive (talk) 03:08, 26 March 2007 (UTC)

 * While I don't know what that comment means, I wonder why the article doesn't start with an example of a key signature. Instead, the first graphic is a B major scale. Even in the second graphic, there's really no explanation describing what part of the graphic is the key signature. It would be great to have a key signature example with the key signature in red to emphasize it. —Wahoofive (talk) 03:08, 26 March 2007 (UTC)

It is well again...
The comment was posted because, for a time, several of the images were missing.

Now they are back. —The preceding unsigned comment was added by 137.71.23.54 (talk) 22:28, 29 March 2007 (UTC).

Key signature characteristics of 430Hz tuning?
I am curious about which pitches Christian Schubart actually heard when writing of characteristics for each key signature. Modern musicians hear A to be 440 or higher, but the standard tuning of most keyboard instruments of Schubart's time (1806) was around 430. If so, would these characteristics be best heard when centered around 430, or are the characteristics "transposable"?
 * I'd say this is in the ear of the listener; various writers throughout history have made associations between various keys and various emotions, and they haven't agreed much. But part of our feelings for various keys stems from associations with music that we've heard in that key. For example, music in D major historically tends to be majestic and triumphant, music in F major tends to be more pastoral (or Christmas carols), etc. These are just historical associations based on the literature and have nothing to do with pitch level, although in some cases the "feel" of a key comes from the fact that string instruments play with more open strings in some keys. This factor would be transposable. —Wahoofive (talk) 23:44, 17 May 2007 (UTC)

"For any number of sharps, take the last sharp and go up one semitone to get the (major) key."
This turned out to be wrong so I changed it to whole tone. It's not helpful when you are trying to learn this stuff and wikipedia tells you things like this :P WikiLlama 15:01, 22 July 2007 (UTC)
 * Semitone is correct. For example, in the key signature with 3 sharps, the last sharp is G♯, and you go up a semitone from G♯ to A, not a whole tone from G♯ to A♯. Georgia guy 15:10, 22 July 2007 (UTC)
 * Yeah, I just realised my mistake, thanks anyway. WikiLlama 15:14, 22 July 2007 (UTC)
 * I added an example to make it clearer. WikiLlama 15:35, 22 July 2007 (UTC)

Accidental (music)
See the discussion at Talk:Accidental (music) concerning the definition of "accidental" and its relation to sharp and flat signs and key signatures. Hyacinth (talk) 21:18, 1 August 2008 (UTC)

example showing a key sig following a double bar
This article could use a sheet music example showing a key sig following a double bar. This image does that, but it seems a bit large for the purpose. --Jtir (talk) 21:54, 6 August 2008 (UTC)
 * It could also use an example showing key sigs with other clefs in modern notation (I'm not sure if the Victoria example could be called modern.) Such an image would fit nicely in the lead. --Jtir (talk) 22:15, 6 August 2008 (UTC)

Article Tone
Is this just me, or does this article sound less like and article and more like a how-to guide, with all the mnemonics etc? Fairweather01 (talk) 22:22, 8 March 2009 (UTC)
 * It's not just you. It doesn't read well at all and is misleadingly inconsistent in places. I'll try and get around to tidying up some of it. I've already deleted a raft of rather silly "my favourite" mnemonics, which weren't even in the section called 'Mnemonics". Feline Hymnic (talk) 13:10, 2 May 2009 (UTC)
 * I've rewritten one section. I hope that is an improvement, especially with the inline "circle of fifths" diagram. There is doubtless room for further improvement. Feline Hymnic (talk) 14:48, 2 May 2009 (UTC)

Table of Keys
I've added Table of Keys, which I believe is valuable as it clearly shows all the key signatures with appropriate changes in sharps and flats. I'm not sure about the name of the section, however. I've settled for Table of Keys but maybe some other name would be more appropriate. Feel free to post any thoughts about the table. OutOf Timer  Wanna chat?  04:58, 25 July 2009 (UTC)
 * Isn't all of this information already provided in the circle of fifths diagram earlier? TrbleClef ♮ (talk) 05:06, 25 July 2009 (UTC)
 * Yes, it is. However, I presented it in an alternative layout, which in my opinion, may be considered easier to read and/or memorise. There is another table similar to this one here, which presents yet another alternative approach but is fairly basic for obvious, article-related reasons. I do believe that the table I included is valuable to the article. However, if this is not the case from an objective point of view, I'll be happy to participate in a discussion about it. My one and only concern is improving this article and Wikipedia. OutOf Timer   Wanna chat?  05:16, 25 July 2009 (UTC)
 * I understand your preference for the table and we have the same goal, I think. I am not fundamentally opposed to the table. However, I believe the circle of fifths historically is used since it indicates not only the relationship between each key signature's keys, but also the intervallic relationship of neighboring keys in the circle. This is not as apparent in a table presentation... IMHO the student of music would be better off understanding the relationship of keys rather than simply memorizing signatures & related keys by rote. Perhaps a more prominent presentation of the circle is in order but that's neither here nor there TrbleClef ♮ (talk) 05:24, 25 July 2009 (UTC)
 * It is perfectly clear that the Circle of Fifths is much more valuable. I am in no way undermining it (I would be an idiot if I did). I simply added an alternative layout to help in memorising the signatures. OutOf Timer   Wanna chat?  08:40, 25 July 2009 (UTC)

Layout Improvements
I've made a number of layout improvements and edits. I believe the article is much clearer now and simply looks better. The most important changes are:

 * Increased size of the Circle of Fifths picture. It is the most important part of the article and should be more prominent.
 * Addition of the new section Memorising Key Signatures as providing an alternative key signatures table is supposed to help in exactly that. Mnemonics sub-section also fits this aim perfectly. OutOf Timer   Wanna chat?  08:17, 25 July 2009 (UTC)

Error in external link
Reference 2 at the bottom of the page, when the page is viewed in Print format, includes extraneous material which prevents the page from printing correctly. My editing skills aren't good enough to fix this. Could someone with better skills than mine fix this?RegT (talk) 23:49, 27 February 2010 (UTC)

Odd notation in article
Why are flats notated as question-marks in the article text? In some places sharps also appear as question-marks, making the text very confusing to read.

Also, the Circle of Fifths chart shows that F# is equivalent to Gb, but it fails to show the enharmonic correcpondences for Cb/B and C#/Db. ~ ~ ~ ~ —Preceding unsigned comment added by 208.100.241.2 (talk) 04:50, 1 March 2010 (UTC)

 * See Manual of style (music).
 * The chart does show the enharmonic equivalence between B & C flat and D flat & C sharp in their key signatures, to the right and left (counterclockwise and clockwise, respectively) of G flat & F sharp, but then quits demonstrating enharmonic equivalence. The circle of fifths chart doesn't show the equivalence between C double-sharp & D or G triple-flat & E. It would get overloading with examples and one wouldn't be able to see the pattern in the three examples provided (just counting major keys). Hyacinth (talk) 08:10, 1 March 2010 (UTC)

 * Are you seeing question marks in the article or just when you edit the page? If the former is the case please supply information about which browser, version, and operating system that you are using. --dbolton (talk) 18:39, 1 March 2010 (UTC)

Changing to CM/Am
The article's good.

Suggested improvement - show how key signatures of naturals are used to change from the current key to CM/Am during a piece of music. Don't need to give examples of all sigs. I'd do it, but don't have any software to make the graphics.

Kevgermany (talk) 22:06, 24 November 2010 (UTC)

 * Image added under Relationship between key signature and key. Hyacinth (talk) 06:38, 18 April 2011 (UTC)
 * That's interesting, but how about this:

Showing a key signature change from a key with more sharps/flats to a key with fewer sharps/flats (the choice matters; it cannot be a change from sharps to flats or flats to sharps.) Specifically, whether a change from D major to G major key signature is written:

C natural, F sharp

or

F sharp, C natural

I've seen this kind of change written in both ways. Georgia guy (talk) 17:34, 18 April 2011 (UTC)

How popular??
How popular is it for certain composers to put sharps or flats in octaves other than the standard locations?? For your info, check out:

http://www.guitarland.com/Music10/MusFund/Maj_Key_Sig/MajKeySig.html

and look at the info on where the sharps or flats are placed. A few Wikipedia articles say that the standard rules mentioned on that page are occasionally violated by certain composers. Specifically, check out info in G major, B major, and C-flat major. They reveal that certain composers violate the rules on where to place the sharps or flats. Georgia guy (talk) 23:12, 27 November 2010 (UTC)

 * I'm not sure how popular this is. If I remember correctly, Robert Schumann fudged around with B major (bass clef A♯ up an octave from now), and Charles-Valentin Alkan fudged around with all the sharp key signatures (treble clef F♯, G♯ down an octave from now, bass clef A♯, B♯ up an octave from now). Lanthanum-138 (talk) 00:21, 23 April 2011 (UTC)
 * It was pretty common in the Baroque and earlier, when music notation wasn't as standardized as it is today. Sometimes an accidental would be placed in more than one octave. Look at this Bach manuscript and note the F# is present in both octaves on every staff. —Wahoofive (talk) 03:02, 25 April 2011 (UTC)

Additional citations
Why, what, where, and how does this article need additional citations for verification? Hyacinth (talk) 13:35, 10 March 2011 (UTC)

 * Tag removed. Hyacinth (talk) 00:45, 2 June 2012 (UTC)

The "Feel" of Key Signatures
In each of the articles about individual key signatures, there is something about the mood or feel that the key signature creates. Maybe there should be something in the article about that. E-sub-n (talk) 00:10, 21 March 2011 (UTC)

 * I agree. Why does a composer decide to write in a particular key? What is there that makes the difference? Surely, any discussion or article should deal with this aspect, otherwise why not write everything in the simple key of C Major or A Minor with no accidentals? JohnClarknew (talk) 08:00, 17 April 2011 (UTC)
 * Contrary to what Nigel Tufnel may have led you to believe, D minor is not a particularly sad key. It is a convenient key on the violin in its standard tuning, and according to its WIkipedia article "some consider it the flattest key that is practical for a guitar to play."
 * Choice of key may depend on the sonority of a particular instrument or instrument family: D major, for example, sits easily on a violin, and "is perhaps the sharpest key that is practical" for the clarinet in B flat. Choice of key will sometimes be influenced by the typical range expected from a vocalist, or may accommodate a particular singer.
 * Subjective notions of any particular key's "color" or "mood" are subjective. If a notable musician or composer has expressed an opinion about such a thing, it may be encyclopedic to mention it without giving it too much weight. __ Just plain Bill (talk) 13:46, 17 April 2011 (UTC)
 * Different instruments have reasons for favoring certain keys, as you point out. But the question really applies to keyboard instruments, think piano. Why did Mozart, for example, write his pieces in different specific keys? What is the motivation. Sure, it "sounds better", but why? The article should deal with this somewhere. JohnClarknew (talk) 17:39, 17 April 2011 (UTC)
 * In Mozart's time, equal-tempered tuning of keyboards was a recent invention, not yet universally adopted. See Duffin, Ross (2006) How Equal Temperament Ruined Harmony (and Why You Should Care) W.W. Norton & Co. ISBN 0393062279. Modern pianos are mis-tuned to a homogenized system that allows modulation to any key without producing wolf fifths. An unfortunate effect of this "enhancement" is a departure from true harmonic relations between notes. __ Just plain Bill (talk) 17:56, 17 April 2011 (UTC)
 * Is this the subject of this section of the talk page:
 * Nope, it is tangential, but illustrates the difficulty with assigning subjective qualities to "a key signature," made more complicated by variablity of instrumentation. __ Just plain Bill (talk) 18:30, 17 April 2011 (UTC)

Play a song twice, first in the key of G major, then in E-flat major. Compare how each version of the song sounds. To me, G major sounds like a "daytime" key; while E-flat major is more "nighttime". (If this example of a problem is not the subject of this section, please illustrate a problem that is.) Georgia guy (talk) 18:02, 17 April 2011 (UTC)
 * That may depend on the instrument you choose to play it on. If it is a piano, it may well depend on its current state of tuning. In any case, that would be original research, not suitable for the article space.
 * For a possibly encyclopedic example, the D major page says "Scriabin considered D major to be golden in color..." No doubt there are many other such opinions to be found. It might even make sense to collect them in a page of their own, if anyone feels like doing that. __ Just plain Bill (talk) 18:30, 17 April 2011 (UTC)

Wouldn't it be the feel of different keys, rather than their key signatures (which are notational conventions)? Hyacinth (talk) 00:44, 2 June 2012 (UTC)
 * I dunno, it could be some of both. When I see a piece in F♯ major, I feel it to be slightly more "daytime" (following Georgia guy) than if it were notated in G♭ major, despite this making absolutely no difference in sound today... Double sharp (talk) 07:13, 5 January 2014 (UTC)

 * Why do you think it makes absolutely no difference in sound today? If it made a difference in the past, shouldn't it be the same now? Or have all people suddenly gone deaf?—Jerome Kohl (talk) 07:19, 5 January 2014 (UTC)
 * Because in the past due to non-equal temperaments (e.g. 1/4-comma) F-sharp and G-flat might not sound the same? Double sharp (talk) 07:50, 5 January 2014 (UTC)
 * Are you trying to say that non-equal temperaments sound differently today than they did in the past? I don't buy this.—Jerome Kohl (talk) 20:27, 5 January 2014 (UTC)
 * No, it's just that typically we use equal temperament (or a close approximation, I suppose) today, which wasn't always true. Double sharp (talk) 06:00, 6 January 2014 (UTC)
 * Do we? There is a street singer who improvises, unaccompanied, two or three days a week on a corner I pass on my way home from work. As far as I can tell, he cannot read music, but he always sings in exactly the same set of keys: C pentatonic minor, B-flat major, and G minor. Is he thinking in equal temperament? I doubt he even knows what it is, and the intervals he actually sings are not equal-tempered ones. Why does he always sing in the same keys? I should ask him some day, but I will bet it is because that is the pitch at which his voice feels the most comfortable. How do I know what keys he sings in? I don't possess "perfect pitch", as it is usually understood, but I know where my voice "feels the most comfortable", and I can feel my singing muscles react when I hear this guy sing (this is sometimes called "muscle memory"). This has got quite a lot to do with the "feel of keys" (as opposed to "key signatures, perhaps), and is what ancient Greek authors like Ptolemy mean by tonoi, in the sense of "transposition levels". Keyboardists, understandably, tend to make a lot of assumptions about tunings that singers, string players, and in fact most other non-keyboarding musicians do not. Our theory books tend to be written from a keyboard point of view, and so the (often useful) baggage of equal temperament comes along with it. When we are in the midst of a performance, these theoretical assumptions go out the window. We just sing or play pitches where our ears tell us they should be—unless, of course, we are playing a pre-tuned instrument like a piano or xylophone, or are playing along with one of these instruments in a passage where matching their pitches is important. Under such conditions, no doubt we non-keyboardists must use some "close approximation", but how close is "close"? Justly intoned fourths and fifths are not very far off of equal-tempered ones; thirds and sixths deviate more, but still may be regarded as "close", depending on context and how they are measured.
 * Was it formerly not the case that "a close approximation" of equal temperament was used as a frame of reference? I'm not so sure of this as you seem to be. Aristoxenus, in the fourth century BC, describes scales in terms of "approximately equal" intervals of tones, semitones, and quarter tones. He does not formally (mathematically) define equal temperament, of course, but the concept of "a whole step is a whole step" and "a semitone is a semitone", within practical limits is certainly present. I don't know of any earlier evidence one way or the other about how musicians thought about their scales in performance—as opposed to the problems of tuning a lyre or similar instrument. Tunings and musical scales (or keys) are certainly related, but they are not identical things.—Jerome Kohl (talk) 17:23, 14 May 2015 (UTC)

Optical illusion
I notice an optical illusion in the sharp key signature images. The sharps on lines look thinner than the sharps on the spaces. Georgia guy (talk) 15:00, 16 April 2011 (UTC)

Too technical
Why and where is this article too technical? How should it be cleaned up? Hyacinth (talk) 00:42, 2 June 2012 (UTC)
 * Four months have passed since that banner promising specifics was put up, and I see nothing at all. It looks like a drive-by to me, so I am removing it.—Jerome Kohl (talk) 23:22, 28 September 2012 (UTC)

Examine this sentence:
However, the connection is not absolute; a piece with a one-sharp key signature is not necessarily in the key of G major, and likewise, a piece in G major may not always be written with a one-sharp key signature.

This sentence is found in the article. Any common reasons for this?? Here's an example:

I was using Musipedia to search for the melody of "Parade of the Wooden Soldiers"; specifically the first few notes:

The toy shop door is locked up tight and everything is quiet for the night

The arrangement of the result I got was in C major, but they put in the G major key signature, putting a natural sign on the F that goes with the word "locked" and in the phrase "quiet for"; the notes G-F♯-F♮ were written, which is correct, but the F♯ was written without a sharp sign because they gave it the G major key signature even though the true key is C major. Is it common for songs (arrangements of songs already written; not necessarily songs newly written) to have the wrong key signature?? The sentence being discussed definitely needs a lot of attention, especially by someone who can give common reasons for this. Georgia guy (talk) 14:29, 13 June 2012 (UTC)
 * Historically, the reason is that key signatures were invented before the concept of "key" was developed; the signatures were created as a convenient shorthand for notation, not because they were intended to convey anything about the music. I suspect that key-oriented names for the signatures, such as "G major signature" (as opposed to descriptive terms like "one-sharp signature" were a 19th-century (or even 20th) development, although I've never seen any documentation for this.
 * However, in the case you cite it's probably just incompetence on the part of the person who created the transposition. —Wahoofive (talk) 17:58, 14 June 2012 (UTC)
 * Well, how frequently do you see arrangements of songs that are written in C major using the G major key signature?? Georgia guy (talk) 18:03, 14 June 2012 (UTC)

Mnemonics
The mnemonics are getting out of hand. It's become an attraction for creativity and not encyclopedic. WikiHow is for stuff like that. —Wahoofive (talk) 15:15, 17 July 2012 (UTC)
 * Are any of those mnemonics even mentioned in the source for the first one? If not, then they are also all original research. I'd say delete the lot of them—Jerome Kohl (talk) 16:30, 17 July 2012 (UTC)
 * Did it. __ Just plain Bill (talk) 17:55, 17 July 2012 (UTC)

The Need For Key Signatures
I'm a poor writer, so feel free to edit for grammer, etc., but I suggest the article should state something along these lines at the very beginning: Musical notation uses a set of horizontal lines with spaces between them, called the staff, to indicate the correct pitch to be played by placing a marker, called a note, on the appropriate line or space. The staff would be too large and difficult to read if it had a line or space for every pitch so the staff that's used has fewer lines and spaces but accomodates the extra, homeless, pitches by using symbols, called sharps and flats, to indicate a given note on the staff is to be a pitch that is not indicated normally by the line or space it's on. When a piece of music routinely uses these homeless pitches that require sharps or flats on given lines or spaces, it is more convenient to place the sharps or flats on the proper places at the beginning of the score and save the trouble of placing them everywhere they would otherwise be needed. The collection of sharps or flats at the beginning of the score is called a key signature. — Preceding unsigned comment added by Jklmnopqrst (talk • contribs) 11:03, 1 September 2012 (UTC)

Table images
The images of staves indicating key signatures (in the "Table" section) are inconsistently sized and proportioned. I reduced the size of the recently added ones (8 sharps/flats), but they're in a different format from the others. I'm hoping someone fluent with the graphics involved can sort this out. - Special-T (talk) 22:36, 26 September 2023 (UTC)

Neological names of the 15 key signatures
The neological names of the 15 clavisignatures (key signatures) are;

1: "Zeroaccident"/"zeroalteration": Zero sharp and zero flat;

2: "Heptadiesis"/"sevensharp" and "fiveflat"/"pentabemol": Seven sharps and five flats

3: "Didiesis"/"twosharp": Two sharps;

4: "Threeflat"/"tribemol": Three flats;

5: "Foursharp"/"tetradiesis": Four sharps;

6: "Monobemol"/"oneflat": one flat;

7: "Hexadiesis"/"sixsharp" and "hexabemol"/"sixflat": Six sharps and six flats;

8: "Monodiesis"/"onesharp": One sharp;

9: "Fourflat"/"tetrabemol": Four flats;

10: "Threesharp"/"tridiesis": Three sharps;

11: "Dibemol"/"twoflat": Two flats;

12: "Fivesharp"/"pentadiesis" and "heptabemol"/"sevenflat": Five sharps and seven flats.

189.50.182.128 (talk) 11:34, 4 January 2024 (UTC)

Pitch classes
The following passage appears in the lede: "Each symbol applies to all notes in the same pitch class—for example, a flat on the third line of the treble staff (as in the diagram) indicates that all notes appearing as Bs are played as B-flats. This convention was not universal until the late Baroque and early Classical period..."

While it's true that some earlier signatures contain accidentals in more than one octave, I don't think it was ever the case that the key signature didn't apply to all octaves — a sharp on the top line of the treble staff also applied to the bottom space since the inception of signatures. Unless someone has some evidence to the contrary, I'm going to rewrite this to make it clearer.

Also, the term "pitch class" is unnecessary technical jargon. I'll remove that too. —Wahoofive (talk) 16:34, 14 April 2024 (UTC)

 * The description that follows the section you quoted doesn't really address the "applies to all pitch classes" issue anyway - it just says that some older notation might put (e.g.) an F# on the bottom space *and* the top line of treble clef. Doesn't say anything about the F an octave above or below those. And it's uncited, so, yeah, I think that can go. I don't think "pitch class" is too bad, though, especially with a link. I get your point but I'd be inclined to leave it (and maybe expand someone's music knowledge with a simple click). - Special-T (talk) 20:39, 14 April 2024 (UTC)
 * Especially with a link, "pitch class" fits perfectly with the notion that "sharps or flats in the key signature apply in all octaves" without being overly technical jargon. I favor keeping it. Just plain Bill (talk) 20:50, 14 April 2024 (UTC)

I decided to take out the reference to signatures with accidentals on multiple octaves, since it's not part of standard notation; such historical rarities don't really deserve to be in the lede (it's mentioned lower down under "Earlier notation styles"). I also, despite your pushback, took out the reference to pitch classes (although you can re-add it if you really want), partly because it's not really accurate: B flat and A sharp are the same pitch class, but B flat and the B an octave above or below are different classes. The signature changes the pitch class of the affected notes, but this seems overly burdensome to have to explain. —Wahoofive (talk) 16:43, 15 April 2024 (UTC)

 * I hadn't considered the complicating factor of enharmonic equivalence, whereby A-sharps and B-flats are in the same pitch class. So I'm OK with taking that out. One of the difficulties of writing clearly about this kind of thing is that 'note', 'pitch' etc. can mean the written note on the page, or the audible note (more like 'pitch'). I've done a lot of editing of similar articles (flat, sharp, natural, accidental, enharmonic equivalence, transposing instruments, etc.) and clarity is hard to achieve. So I lean towards simpler & clearer, even if it leaves out some interesting ideas. - Special-T (talk) 14:28, 16 April 2024 (UTC)

Overstating situations that are extremely rare in the real world
I don't think anyone reading a general article on key signatures is likely to have seen anything except 12TET tuning and standard key signatures. Info about other tuning systems or key sigs with double/triple flats/sharps is good to mention here, but it needs to be very clear to the general reader that these situations don't occur in any written music they're likely to encounter. 99% of professional musicians won't even encounter these (most of us have never even seen C-flat as a key sig). These general music articles often become unclear because they drift into technical details or rare situations. - Special-T (talk) 19:36, 4 June 2024 (UTC)

title: Talk:Key signature


text:
Endianness

In computing, endianness is the order in which bytes within a word of digital data are transmitted over a data communication medium or addressed (by rising addresses) in computer memory, counting only byte significance compared to earliness. Endianness is primarily expressed as big-endian (BE) or little-endian (LE), terms introduced by Danny Cohen into computer science for data ordering in an Internet Experiment Note published in 1980. The adjective endian has its origin in the writings of 18th century Anglo-Irish writer Jonathan Swift. In the 1726 novel Gulliver's Travels, he portrays the conflict between sects of Lilliputians divided into those breaking the shell of a boiled egg from the big end or from the little end. By analogy, a CPU may read a digital word big end first, or little end first.

Computers store information in various-sized groups of binary bits. Each group is assigned a number, called its address, that the computer uses to access that data. On most modern computers, the smallest data group with an address is eight bits long and is called a byte. Larger groups comprise two or more bytes, for example, a 32-bit word contains four bytes. There are two possible ways a computer could number the individual bytes in a larger group, starting at either end. Both types of endianness are in widespread use in digital electronic engineering. The initial choice of endianness of a new design is often arbitrary, but later technology revisions and updates perpetuate the existing endianness to maintain backward compatibility.

A big-endian system stores the most significant byte of a word at the smallest memory address and the least significant byte at the largest. A little-endian system, in contrast, stores the least-significant byte at the smallest address. Of the two, big-endian is thus closer to the way the digits of numbers are written left-to-right in English, comparing digits to bytes. Bi-endianness is a feature supported by numerous computer architectures that feature switchable endianness in data fetches and stores or for instruction fetches. Other orderings are generically called middle-endian or mixed-endian.

Big-endianness is the dominant ordering in networking protocols, such as in the Internet protocol suite, where it is referred to as network order, transmitting the most significant byte first. Conversely, little-endianness is the dominant ordering for processor architectures (x86, most ARM implementations, base RISC-V implementations) and their associated memory. File formats can use either ordering; some formats use a mixture of both or contain an indicator of which ordering is used throughout the file.

Characteristics

Computer memory consists of a sequence of storage cells (smallest addressable units); in machines that support byte addressing, those units are called bytes. Each byte is identified and accessed in hardware and software by its memory address. If the total number of bytes in memory is n, then addresses are enumerated from 0 to n − 1.

Computer programs often use data structures or fields that may consist of more data than can be stored in one byte. In the context of this article where its type cannot be arbitrarily complicated, a "field" consists of a consecutive sequence of bytes and represents a "simple data value" which – at least potentially – can be manipulated by one single hardware instruction. On most systems, the address of a multi-byte simple data value is the address of its first byte (the byte with the lowest address). There are exceptions to this rule – for example, the Add instruction of the IBM 1401 addresses variable-length fields at their low-order (highest-addressed) position with their lengths being defined by a word mark set at their high-order (lowest-addressed) position. When an operation such as addition is performed, the processor begins at the low-order positions at the high addresses of the two fields and works its way down to the high-order.

Another important attribute of a byte being part of a "field" is its "significance". These attributes of the parts of a field play an important role in the sequence the bytes are accessed by the computer hardware, more precisely: by the low-level algorithms contributing to the results of a computer instruction.

Numbers
Positional number systems (mostly base 2, or less often base 10) are the predominant way of representing and particularly of manipulating integer data by computers. In pure form this is valid for moderate sized non-negative integers, e.g. of C data type. In such a number system, the value of a digit which it contributes to the whole number is determined not only by its value as a single digit, but also by the position it holds in the complete number, called its significance. These positions can be mapped to memory mainly in two ways:

 * Decreasing numeric significance with increasing memory addresses (or increasing time), known as big-endian and
 * Increasing numeric significance with increasing memory addresses (or increasing time), known as little-endian.

In these expressions, the term "end" is meant as the extremity where the big resp. little significance is written first, namely where the field starts.

The integer data that are directly supported by the computer hardware have a fixed width of a low power of 2, e.g. 8 bits ≙ 1 byte, 16 bits ≙ 2 bytes, 32 bits ≙ 4 bytes, 64 bits ≙ 8 bytes, 128 bits ≙ 16 bytes. The low-level access sequence to the bytes of such a field depends on the operation to be performed. The least-significant byte is accessed first for addition, subtraction and multiplication. The most-significant byte is accessed first for division and comparison. See.

Text
When character (text) strings are to be compared with one another, e.g. in order to support some mechanism like sorting, this is very frequently done lexicographically where a single positional element (character) also has a positional value. Lexicographical comparison means almost everywhere: first character ranks highest – as in the telephone book. Almost all machines which can do this using a single instruction are big-endian or at least mixed-endian.

Integer numbers written as text are always represented most significant digit first in memory, which is similar to big-endian, independently of text direction.

Byte addressing
When memory bytes are printed sequentially from left to right (e.g. in a hex dump), little-endian representation of integers has the significance increasing from left to right. In other words, it appears backwards when visualized, which can be counter-intuitive.

This behavior arises, for example, in FourCC or similar techniques that involve packing characters into an integer, so that it becomes a sequence of specific characters in memory. For example, take the string "JOHN", stored in hexadecimal ASCII. On big-endian machines, the value appears left-to-right, coinciding with the correct string order for reading the result ("J O H N"). But on a little-endian machine, one would see "N H O J". Middle-endian machines complicate this even further; for example, on the PDP-11, the 32-bit value is stored as two 16-bit words "JO" "HN" in big-endian, with the characters in the 16-bit words being stored in little-endian, resulting in "O J N H".

Byte swapping
Byte-swapping consists of rearranging bytes to change endianness. Many compilers provide built-ins that are likely to be compiled into native processor instructions (bswap/movbe), such as __builtin_bswap32. Software interfaces for swapping include:

 * Standard network endianness functions (from/to BE, up to 32-bit). Windows has a 64-bit extension in winsock2.h.
 * BSD and Glibc endian.h functions (from/to BE and LE, up to 64-bit).
 * macOS OSByteOrder.h macros (from/to BE and LE, up to 64-bit).
 * The std::byteswap function in C++23.

Some CPU instruction sets provide native support for endian byte swapping, such as bswap (x86 — 486 and later, i960 — i960Jx and later ), and rev (ARMv6 and later).

Some compilers have built-in facilities for byte swapping. For example, the Intel Fortran compiler supports the non-standard CONVERT specifier when opening a file, e.g.: OPEN(unit, CONVERT='BIG_ENDIAN',...). Other compilers have options for generating code that globally enables the conversion for all file IO operations. This permits the reuse of code on a system with the opposite endianness without code modification.

Simplified access to part of a field
On most systems, the address of a multi-byte value is the address of its first byte (the byte with the lowest address); little-endian systems of that type have the property that, for sufficiently low data values, the same value can be read from memory at different lengths without using different addresses (even when alignment restrictions are imposed). For example, a 32-bit memory location with content 4A 00 00 00 can be read at the same address as either 8-bit (value = 4A), 16-bit (004A), 24-bit (00004A), or 32-bit (0000004A), all of which retain the same numeric value. Although this little-endian property is rarely used directly by high-level programmers, it is occasionally employed by code optimizers as well as by assembly language programmers. While not allowed by C++, such type punning code is allowed as "implementation-defined" by the C11 standard and commonly used in code interacting with hardware.

Calculation order
Some operations in positional number systems have a natural or preferred order in which the elementary steps are to be executed. This order may affect their performance on small-scale byte-addressable processors and microcontrollers. However, high-performance processors usually fetch multi-byte operands from memory in the same amount of time they would have fetched a single byte, so the complexity of the hardware is not affected by the byte ordering.

Addition, subtraction, and multiplication start at the least significant digit position and propagate the carry to the subsequent more significant position. On most systems, the address of a multi-byte value is the address of its first byte (the byte with the lowest address). The implementation of these operations is marginally simpler using little-endian machines where this first byte contains the least significant digit.

Comparison and division start at the most significant digit and propagate a possible carry to the subsequent less significant digits. For fixed-length numerical values (typically of length 1,2,4,8,16), the implementation of these operations is marginally simpler on big-endian machines.

Some big-endian processors (e.g. the IBM System/360 and its successors) contain hardware instructions for lexicographically comparing varying length character strings.

The normal data transport by an assignment statement is in principle independent of the endianness of the processor.

Hardware
Many historical and extant processors use a big-endian memory representation, either exclusively or as a design option. The IBM System/360 uses big-endian byte order, as do its successors System/370, ESA/390, and z/Architecture. The PDP-10 uses big-endian addressing for byte-oriented instructions. The IBM Series/1 minicomputer uses big-endian byte order. The Motorola 6800 / 6801, the 6809 and the 68000 series of processors use the big-endian format. Solely big-endian architectures include the IBM z/Architecture and OpenRISC.

The Datapoint 2200 used simple bit-serial logic with little-endian to facilitate carry propagation. When Intel developed the 8008 microprocessor for Datapoint, they used little-endian for compatibility. However, as Intel was unable to deliver the 8008 in time, Datapoint used a medium-scale integration equivalent, but the little-endianness was retained in most Intel designs, including the MCS-48 and the 8086 and its x86 successors. The DEC Alpha, Atmel AVR, VAX, the MOS Technology 6502 family (including Western Design Center 65802 and 65C816), the Zilog Z80 (including Z180 and eZ80), the Altera Nios II, and many other processors and processor families are also little-endian.

The Intel 8051, unlike other Intel processors, expects 16-bit addresses for LJMP and LCALL in big-endian format; however, xCALL instructions store the return address onto the stack in little-endian format.

The IA-32 and x86-64 instruction set architectures use the little-endian format. Other instruction set architectures that follow this convention, allowing only little-endian mode, include Nios II, Andes Technology NDS32, and Qualcomm Hexagon.

Some instruction set architectures are "bi-endian" and allow running software of either endianness; these include Power ISA, SPARC, ARM AArch64, C-Sky, and RISC-V. IBM AIX and IBM i run in big-endian mode on bi-endian Power ISA; Linux originally ran in big-endian mode, but by 2019, IBM had transitioned to little-endian mode for Linux to ease the porting of Linux software from x86 to Power. SPARC has no relevant little-endian deployment, as both Oracle Solaris and Linux run in big-endian mode on bi-endian SPARC systems, and can be considered big-endian in practice. ARM, C-Sky, and RISC-V have no relevant big-endian deployments, and can be considered little-endian in practice.

Bi-endianness
Some architectures (including ARM versions 3 and above, PowerPC, Alpha, SPARC V9, MIPS, Intel i860, PA-RISC, SuperH SH-4 and IA-64) feature a setting which allows for switchable endianness in data fetches and stores, instruction fetches, or both. This feature can improve performance or simplify the logic of networking devices and software. The word bi-endian, when said of hardware, denotes the capability of the machine to compute or pass data in either endian format.

Many of these architectures can be switched via software to default to a specific endian format (usually done when the computer starts up); however, on some systems, the default endianness is selected by hardware on the motherboard and cannot be changed via software (e.g. the Alpha, which runs only in big-endian mode on the Cray T3E).

The term bi-endian refers primarily to how a processor treats data accesses. Instruction accesses (fetches of instruction words) on a given processor may still assume a fixed endianness, even if data accesses are fully bi-endian, though this is not always the case, such as on Intel's IA-64-based Itanium CPU, which allows both.

Some nominally bi-endian CPUs require motherboard help to fully switch endianness. For instance, the 32-bit desktop-oriented PowerPC processors in little-endian mode act as little-endian from the point of view of the executing programs, but they require the motherboard to perform a 64-bit swap across all 8 byte lanes to ensure that the little-endian view of things will apply to I/O devices. In the absence of this unusual motherboard hardware, device driver software must write to different addresses to undo the incomplete transformation and also must perform a normal byte swap.

Some CPUs, such as many PowerPC processors intended for embedded use and almost all SPARC processors, allow per-page choice of endianness.

SPARC processors since the late 1990s (SPARC v9 compliant processors) allow data endianness to be chosen with each individual instruction that loads from or stores to memory.

The ARM architecture supports two big-endian modes, called BE-8 and BE-32. CPUs up to ARMv5 only support BE-32 or word-invariant mode. Here any naturally aligned 32-bit access works like in little-endian mode, but access to a byte or 16-bit word is redirected to the corresponding address and unaligned access is not allowed. ARMv6 introduces BE-8 or byte-invariant mode, where access to a single byte works as in little-endian mode, but accessing a 16-bit, 32-bit or (starting with ARMv8) 64-bit word results in a byte swap of the data. This simplifies unaligned memory access as well as memory-mapped access to registers other than 32-bit.

Many processors have instructions to convert a word in a register to the opposite endianness, that is, they swap the order of the bytes in a 16-, 32- or 64-bit word.

Recent Intel x86 and x86-64 architecture CPUs have a MOVBE instruction (Intel Core since generation 4, after Atom), which fetches a big-endian format word from memory or writes a word into memory in big-endian format. These processors are otherwise thoroughly little-endian.

There are also devices which use different formats in different places. For instance, the BQ27421 Texas Instruments battery gauge uses the little-endian format for its registers and the big-endian format for its random-access memory.

SPARC historically used big-endian until version 9, which is bi-endian. Similarly early IBM POWER processors were big-endian, but the PowerPC and Power ISA descendants are now bi-endian. The ARM architecture was little-endian before version 3 when it became bi-endian.

Floating point
Although many processors use little-endian storage for all types of data (integer, floating point), there are a number of hardware architectures where floating-point numbers are represented in big-endian form while integers are represented in little-endian form. There are ARM processors that have mixed-endian floating-point representation for double-precision numbers: each of the two 32-bit words is stored as little-endian, but the most significant word is stored first. VAX floating point stores little-endian 16-bit words in big-endian order. Because there have been many floating-point formats with no network standard representation for them, the XDR standard uses big-endian IEEE 754 as its representation. It may therefore appear strange that the widespread IEEE 754 floating-point standard does not specify endianness. Theoretically, this means that even standard IEEE floating-point data written by one machine might not be readable by another. However, on modern standard computers (i.e., implementing IEEE 754), one may safely assume that the endianness is the same for floating-point numbers as for integers, making the conversion straightforward regardless of data type. Small embedded systems using special floating-point formats may be another matter, however.

Variable-length data
Most instructions considered so far contain the size (lengths) of their operands within the operation code. Frequently available operand lengths are 1, 2, 4, 8, or 16 bytes. But there are also architectures where the length of an operand may be held in a separate field of the instruction or with the operand itself, e.g. by means of a word mark. Such an approach allows operand lengths up to 256 bytes or larger. The data types of such operands are character strings or BCD. Machines able to manipulate such data with one instruction (e.g. compare, add) include the IBM 1401, 1410, 1620, System/360, System/370, ESA/390, and z/Architecture, all of them of type big-endian.

Middle-endian
Numerous other orderings, generically called middle-endian or mixed-endian, are possible.

The PDP-11 is in principle a 16-bit little-endian system. The instructions to convert between floating-point and integer values in the optional floating-point processor of the PDP-11/45, PDP-11/70, and in some later processors, stored 32-bit "double precision integer long" values with the 16-bit halves swapped from the expected little-endian order. The UNIX C compiler used the same format for 32-bit long integers. This ordering is known as PDP-endian.

UNIX was one of the first systems to allow the same code to be compiled for platforms with different internal representations. One of the first programs converted was supposed to print out Unix, but on the Series/1 it printed nUxi instead.

A way to interpret this endianness is that it stores a 32-bit integer as two little-endian 16-bit words, with a big-endian word ordering:

Segment descriptors of IA-32 and compatible processors keep a 32-bit base address of the segment stored in little-endian order, but in four nonconsecutive bytes, at relative positions 2, 3, 4 and 7 of the descriptor start.

Logic design
Hardware description languages (HDLs) used to express digital logic often support arbitrary endianness, with arbitrary granularity. For example, in SystemVerilog, a word can be defined as little-endian or big-endian.

Files and filesystems
The recognition of endianness is important when reading a file or filesystem created on a computer with different endianness.

Fortran sequential unformatted files created with one endianness usually cannot be read on a system using the other endianness because Fortran usually implements a record (defined as the data written by a single Fortran statement) as data preceded and succeeded by count fields, which are integers equal to the number of bytes in the data. An attempt to read such a file using Fortran on a system of the other endianness results in a run-time error, because the count fields are incorrect.

Unicode text can optionally start with a byte order mark (BOM) to signal the endianness of the file or stream. Its code point is U+FEFF. In UTF-32 for example, a big-endian file should start with 00 00 FE FF; a little-endian should start with FF FE 00 00.

Application binary data formats, such as MATLAB .mat files, or the .bil data format, used in topography, are usually endianness-independent. This is achieved by storing the data always in one fixed endianness or carrying with the data a switch to indicate the endianness. An example of the former is the binary XLS file format that is portable between Windows and Mac systems and always little-endian, requiring the Mac application to swap the bytes on load and save when running on a big-endian Motorola 68K or PowerPC processor.

TIFF image files are an example of the second strategy, whose header instructs the application about the endianness of their internal binary integers. If a file starts with the signature MM it means that integers are represented as big-endian, while II means little-endian. Those signatures need a single 16-bit word each, and they are palindromes, so they are endianness independent. I stands for Intel and M stands for Motorola. Intel CPUs are little-endian, while Motorola 680x0 CPUs are big-endian. This explicit signature allows a TIFF reader program to swap bytes if necessary when a given file was generated by a TIFF writer program running on a computer with a different endianness.

As a consequence of its original implementation on the Intel 8080 platform, the operating system-independent File Allocation Table (FAT) file system is defined with little-endian byte ordering, even on platforms using another endianness natively, necessitating byte-swap operations for maintaining the FAT on these platforms.

ZFS, which combines a filesystem and a logical volume manager, is known to provide adaptive endianness and to work with both big-endian and little-endian systems.

Networking
Many IETF RFCs use the term network order, meaning the order of transmission for bytes over the wire in network protocols. Among others, the historic defines the network order for protocols in the Internet protocol suite to be big-endian.

However, not all protocols use big-endian byte order as the network order. The Server Message Block (SMB) protocol uses little-endian byte order. In CANopen, multi-byte parameters are always sent least significant byte first (little-endian). The same is true for Ethernet Powerlink.

The Berkeley sockets API defines a set of functions to convert 16- and 32-bit integers to and from network byte order: the htons (host-to-network-short) and htonl (host-to-network-long) functions convert 16- and 32-bit values respectively from machine (host) to network order; the ntohs and ntohl functions convert from network to host order. These functions may be a no-op on a big-endian system.

While the high-level network protocols usually consider the byte (mostly meant as octet) as their atomic unit, the lowest layers of a network stack may deal with ordering of bits within a byte.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Endianness


text:
Talk:Haar measure

Relationship to Jeffrey's prior
It might be interesting to add this to the article. 134.184.26.82 (talk) 12:34, 7 October 2020 (UTC)

Measure
The article says:
 * It turns out that there is, up to a multiplicative constant, only one translation invariant measure on X which is finite on all compact sets.

This can't be quite right. On R, for example, Borel measure and Lebesgue measure both have this property. Perhaps it's correct if "measure" is replaced with "complete measure". --Zundark, 2002 Mar 6

 * You're mistaken. "X" was defined as the sigma algebra generated by the compact sets.  Lebesgue measure has a more extensive domain than that; Borel measure does not.

Duality
I think some of the facts on Pontryagin duality really belong here.

Charles Matthews 08:20, 17 May 2004 (UTC)

TeX
TeX isn't working. Argh!

CSTAR 15:24, 6 Jun 2004 (UTC)

Question about this article
Let me quote the last section from the article

The modular function

 * Here we show how right and left Haar measures are related. Note that the left translate of a right Haar measure (or integral)  is a Haar measure (or integral): More precisely, if μ is a right Haar measure,
 * $$f \mapsto \int_G f(t x) \ d\mu(x) $$
 * is a also right invariant. Thus there is unique function $$\Delta$$ such that
 * $$\int_G f(t x) \ d \mu(x) = \Delta(t) \int_G f(x) \ d \mu(x) .$$

From what I see, μ is the right measure. If you say that the left and the right measures are related, where is the left measure in here? And which is the relation? Oleg Alexandrov 00:06, 15 Jan 2005 (UTC)

 * This defines the modular function. The left translate of a right invariant Haar measure is also a right invariant Haar measure.  Thus the modular function.  However having defined the modular function, the modular function also serves to relate right and left Haar measures.CSTAR 00:35, 15 Jan 2005 (UTC)

I still don't get it. OK, it is my fault I guess; I know what an invariant measure is, but I don't know what a modular function is. What I really wanted, is something of the form:

 * $$\int_G f(t x) \ d \mu_1(x) = \Delta(t) \int_G f(x) \ d \mu_2(x) .$$

with μ1 being the left measure, μ2 being the right measure. In other words, I want some explicit formula showing how they relate. The above argument you wrote is probably correct, but it is hard to interpret (for me). Oleg Alexandrov 01:55, 15 Jan 2005 (UTC)

 * Nope that won't work. What you wrote says

 * $$\int_G f(t x) \ d \mu_1(x) = \int_G f(x) \ d \Delta(t) \mu_2(x) .$$

which would say the left translate of a right Haar measure is a multiple of a left Haar measure. However, the left translate of a right Haar measure is also a right Haar measure so what you're looking for is an assertion that a right Haar measure is a multiple of a left Haar measure, e.g. is itself left Haar. That's only true for unimodular groups. CSTAR 06:20, 15 Jan 2005 (UTC)

 * I was aware that precisely this would not work. OK, let me try one last time. Is there a way (any way) to establish an explicit equation between the left and the right measures, containing both and μ2? If you say "No", I will give up. Oleg Alexandrov 17:52, 15 Jan 2005 (UTC)

Basically taking the inverse on G interchanges left and right. So μ1(g) is proportional to μ2(g-1), if you understand the notation ...

Charles Matthews 19:15, 15 Jan 2005 (UTC)

 * Good. OK, all I wanted is a formula in the The modular function of Haar measure article which contains both μ1(g) and μ2(g-1). But I guess that is not achievable. Oleg Alexandrov 19:55, 15 Jan 2005 (UTC)

I don't know what I was thinking when I wrote the above. I understand what you say, and this is indeed neat! Basically, let $$\mu_1$$ and $$\mu_2$$ be left and right invariant measures. For a set $$S$$ denote by $$S^{-1}$$ the set of inverses of elements of $$S$$. Then, what you say is that there exists a positive constant $$k$$ such that
 * $$\mu_1(S^{-1})=k\,\mu_2(S)$$

for all measurable sets $$S$$.

I will have this written in the article sometime. Oleg Alexandrov 21:56, 16 Jan 2005 (UTC)

 * I thought that fact was already in it. If μ is a left Haar measure then

 * $$ \int f(x^{-1}) d \mu(x) $$

is a right invariant integral. Maybe it should be made more explicit by letting f be an indicator function. CSTAR 22:53, 16 Jan 2005 (UTC)

 * I think the equation $$\mu_1(S^{-1})=k\,\mu_2(S)$$ could be the simplest thing to write. Also, the sentence "Here we show how right and left Haar measures are related." should go from the last section in the section where the actual equation containing both the right measure and the left measure is. That sentence is misleading in the last section, because that section talks not about the relation between the left and the right measures, but rather about the relation between a right measure and its left translate. Oleg Alexandrov 00:59, 17 Jan 2005 (UTC)

 * FWIW, agree w/Oleg, this last formula is a very natural way to write this. linas 14:11, 14 August 2006 (UTC)

The theorem
I forgot to say in my change to the Haar measure article that I removed the statement of the theorem because it shows up twice. Oleg Alexandrov 04:54, 17 Jan 2005 (UTC)

How to define
Q: How do you exactly define the Haar measure on an "arbitrary" (locally compact and Hausdorff) group? The uniqueness-statement does NOT define it. —Preceding unsigned comment added by 195.176.0.50 (talk)

 * The article defines the property of being a Haar measure and also states an existence and uniqueness result (without proof).  Do you object to the use of "existence" in this statement, in the sense that without an explicit construction of Haar measure the statement of existence is meaningless?--CSTAR 19:36, 27 May 2006 (UTC)

 * The construction of the Haar measure is quite easy for Lie groups (confer volume form). I wonder if the article should mention it?  But no, at least not until after we do the general case. -lethe talk [ +] 19:52, 27 May 2006 (UTC)

 * Well by construction I meant here something more explicit, something along the lines of intuitionism or constructivism.--CSTAR 19:54, 27 May 2006 (UTC)

 * Oh I see. Well after checking in a book, I see that indeed the existence uses Tychanoff's theorem, so I guess it is nonconstructive.  I suppose this article should mention that the general existence theorem is nonconstructive, but then go on to mention that in particular cases constructions can often be given.   Like I say, the construction is easy for Lie groups, and it doesn't require choice, as far as I can tell. -lethe talk [ +] 20:25, 27 May 2006 (UTC)
 * It's actually possible to give a proof w/o axiom of choice as per André Weil.--CSTAR 20:59, 27 May 2006 (UTC)

 * Well, I don't know about that. You brought up constructivism in the first place, but it seems irrelevant if there is a constructive existence proof.  Either way, isn't the article incomplete without either a construction or a justification for the lack thereof? -lethe talk [ +] 21:25, 27 May 2006 (UTC)
 * I was just trying to figure out if there was an "agenda" behind the anonymous question.
 * Re isn't the article incomplete without either a construction or a justification for the lack thereof?  Do you mean put in a proof?--CSTAR 22:46, 27 May 2006 (UTC)
 * PS Given that Haar measure is unique (up to a constant) the fact that known proofs (around up to 1955) used the axiom of choice was weird. This prompted Weil (I think it was Weil) to find one which wasn't dependent on choice. --CSTAR 22:54, 27 May 2006 (UTC)
 * I stand corrected: It's Cartan not Weil. Googling I came up with this:
 * Ultimately, neither Haar nor von Neumann proved the existence of invariant measures on all locally compact groups. The first one to come up with a full proof was Andŕe Weil. This proof, however, was criticized for using the Axiom of Choice in the form of Tychonoff’s Theorem. Later, Henri Cartan proved the existence of invariant measures on locally compact groups without the Axiom of Choice. Since then, several other people have also proved this theorem.
 * I think Hewitt and Stromberg has the constructive (i.e. non-choice) proof. --CSTAR 23:18, 27 May 2006 (UTC)
 * They use Tychonoff on page 6. 94.21.49.195 (talk) 23:30, 1 April 2009 (UTC)

 * For Lie groups everything is quite explicit. Here is a quote from "Noncommutative harmonic analysis" by Michael Taylor (Sect.0.2):

 * The term "Haar measure" in this context is a slight misnomer. Haar solved the more delicate problem of showing that every locally compact topological group has a locally finite left invariant Baire measure. The construction given above for Lie groups is quite simple and was known long before Haar's work.

 * Boris Tsirelson (talk) 19:38, 23 March 2009 (UTC)

 * From the indentations I would infer that you are replying to the first question in the subsection, but your comment seems to be directed at another question or remark. --CSTAR (talk) 21:20, 23 March 2009 (UTC)

 * Sorry... Nothing really important, just a note about the history. Somewhat related to "The construction of the Haar measure is quite easy for Lie groups" above (by Lethe). Boris Tsirelson (talk) 21:29, 23 March 2009 (UTC)

Borel sets
The article currently states early on that:
 * Let G be a locally compact topological group. In this article, the σ-algebra generated by all compact subsets of G is called the Borel algebra.[1]

with a footnote that an anon elaborated on:
 * [1] We follow the conventions of Halmos' textbook. Many authors instead use the term Borel algebra to denote the σ-algebra generated by the open sets.

I don't see that any part of the rest of the article depends on whether the sigma algebra was defined using open or closed sets. (If there is such content, it should be clarified locally). Thus, I propose eliminating the footnote, and replacing the sentence by:

 * Let G be a locally compact topological group, and let its Borel algebra be the σ-algebra corresponding to the topology of the group.

This avoids confusion over an extraneous, unrelated point. linas 14:23, 14 August 2006 (UTC)

 * I think the footnote is very important and we should not remove it. —Preceding unsigned comment added by 201.231.28.30 (talk • contribs)

 * I agree with linas that we should remove this extraneous detail. --MarSch (talk) 11:09, 17 December 2007 (UTC)

It seems very odd and rather confusing to use these uncommon conventions on Borel sets. Does any reasonably modern measure theory book use the term "Borel sets" in this way? I don't think so: Bogachev, Fremlin, Folland, Royden-Fitzpatrick, Rudin certainly don't. It is also inaccurate to say that Halmos considers the σ-algebra generated by the compact sets: he uses the term Borel sets for the σ-ring generated by the compact sets. Dottyhill (talk) 08:34, 2 October 2012 (UTC)

More on Borel sets
The article defines Haar measure on the sigma algebra generated by compact sets. However, some classic books like Rudin's "Fourier Analysis on Groups" consider Haar measure over the sigma algebra generated by all open sets. Rudin's book does not prove explicitly the existance of such a measure. Is there a mistake on Rudin's book or Haar measure can be defined over the sigma algebra generated by all open sets? I think this is a very important matter since it has consequences on the mesurability of the continuos functions. Can someone provide a clarification about this matter and maybe an example that shows that one needs to restrict the construction to the sigma algebra generated by compact sets or a reference to a book where the measure is constructed over the sigma algebra generated by all open sets? That would be a great contribution to this article! —Preceding unsigned comment added by 201.231.28.30 (talk • contribs)

 * No, Rudin's book is correct, but so is the WP article. The statement given in the article is exactly as given in Halmos' book "Measure Theory" (now admittedly klunky, but authoritative and completely accessible).  Haar measure can also be approached via Radon measures on locally compact spaces; these are non-negative functionals on the space of continuous functions of compact support.  There is a unique (up to a scalar) non-zero left invariant Radon measure on a locally compact group.  Now Radon measures can be "extended" in a canonical way to the σ-algebra of Borel sets (generated by open sets). See Rudin's "Real and Complex Analysis 2.14" (Big Rudin 1966) for a precise statement and the proof. The delicate point here is uniqueness, which requires somewhat different regularity properties for the measures in the statements.

 * Most of these technical distinctions are immaterial for metrizable separable locally compact groups or compact groups. This would be massive technical overkill for the article to elaborate further, I think.
 * --CSTAR 20:32, 11 September 2006 (UTC)

The theorem is stated incorrectly.
The theorem says that $$\mu(B) > 0$$ for any nonempty Borel set $$B$$. What if B is a singleton set? This is ridiculous. 128.208.1.224 (talk) 21:26, 4 March 2009 (UTC)
 * The theorem says that $$\mu(B) > 0$$ for any open nonempty Borel set $$B$$. If a singleton set is open, then indeed it must have positive measure, and the group is discrete. JackSchmidt (talk) 22:50, 4 March 2009 (UTC)

Harr measure on unitary matrices
Could someone explicitly discuss the Harr measure on unitary matrices? It is very important in physics (especially for SU(N) in QFT and unitary transformations in quantum information theory). I haven't found anywhere it is explained well. Njerseyguy (talk) 16:14, 15 July 2009 (UTC)

Existence of the Haar measure
In section "Existence and uniqueness of the left Haar measure" it is said that

< 0 for any open non-empty Borel set U. Such a measure is called a left Haar measure>>

While in section "Uses" it is stated that

<>

Why bother to "use a technique for proving the existence of a Haar measure" if it always exists? Where am I missing the point? —Preceding unsigned comment added by 88.1.123.97 (talk) 17:03, 6 November 2009 (UTC)

Split
There is a split and an expand tag. The section as it stands cannot be split because a split article would not be viable. The expand tag seems reasonable so I have removed the split tag. Op47 (talk) 15:09, 6 April 2012 (UTC)

Suggested need for expansion of section 'Haar integral'
Can someone say what expansion they would like to see in this section? The statements under Haar integral seem quite clear. If the question is 'How to define the Haar integral', or another such question, then this is properly a question about the definition of the 'Lebesgue integral' with respect to a given measure. Also there are links to 'Lebesgue integration' AND 'indicator functions' here.

Further, with the 4 examples of Haar measures beneath this heading, it seems that there is enough meat in this section for someone who longs for some computational examples of Haar integrals. 99.33.255.116 (talk) 22:42, 2 June 2013 (UTC)

Open submanifolds
The measure for open submanifolds is stated to be dnx/J(x). But shoulden't it be $$d^nx / |\det(J(x))|$$ instead? --Jobu0101 (talk) 09:22, 14 December 2016 (UTC)

Existence of Haar measure: *regular* content?
Quote from the section about existence:

 * The function $${\displaystyle \mu _{A}}$$ is additive on disjoint compact subsets of $${\displaystyle G}$$, which implies that it is a regular content.

I understand that this is a content. I don't see, however, how this is a regular content. Additivity for disjoint compact sets is part of the definition of content. But in order to get a Radon measure from it, we need a regular content. I couldn't find anywhere a convincing proof that the so-constructed content is regular. Could someone who understands this please expand upon that claim? --138.246.2.201 (talk) 12:13, 28 July 2017 (UTC)

An unstated change of hyperbola in the middle of a paragraph
The section titled Examples contains this paragaph:

"* The unit hyperbola $$\{(x,y) : x^2 - y^2 = 1, x > 0 \}$$ can be taken as a group under multiplication defined as with split-complex numbers $$z = x + y j, \ \ j^2 = +1 .$$ The usual area measure in the crescent $$C = \{(x,y) : |y| < x, \ \ x^2 - y^2 < 1 \}$$ serves to define hyperbolic angle as the area of its hyperbolic sector. The Haar measure of the unit hyperbola is generated by the hyperbolic angle of segments on the hyperbola. For instance, a measure of one unit is given by the segment running from (1,1) to (e,1/e), where e is Euler's number. Hyperbolic angle has been exploited in mathematical physics with rapidity standing in for classical velocity."

Unfortunately the points (1,1) and (e,1/e) do not lie on the stated hyperbola, but instead on the hyperbola given by

{(x,y) in R2 |  xy  =  1}.

I hope that someone familiar with this example can fix this.

In addition, this article has many places where it could be phrased a lot more clearly.50.205.142.50 (talk) 22:00, 8 June 2020 (UTC)

title: Talk:Haar measure


text:
Scoville scale

The Scoville scale is a measurement of pungency (spiciness or "heat") of chili peppers and other substances, recorded in Scoville heat units (SHU). It is based on the concentration of capsaicinoids, among which capsaicin is the predominant component.

The scale is named after its creator, American pharmacist Wilbur Scoville, whose 1912 method is known as the Scoville organoleptic test. The Scoville organoleptic test is a subjective assessment derived from the capsaicinoid sensitivity by people experienced with eating hot chilis.

An alternative method, high-performance liquid chromatography (HPLC), can be used to analytically quantify the capsaicinoid content as an indicator of pungency.

Scoville organoleptic test
In the Scoville organoleptic test, an exact weight of dried pepper is dissolved in alcohol to extract the heat components (capsaicinoids), then diluted in a solution of sugar water. Decreasing concentrations of the extracted capsaicinoids are given to a panel of five trained tasters, until a majority (at least three) can no longer detect the heat in a dilution. The heat level is based on this dilution, rated in multiples of 100 SHU.

Another source using subjective assessment stated, "Conventional methods used in determining the level of pungency or capsaicin concentration are using a panel of tasters (Scoville organoleptic test method). ... Pepper pungency is measured in Scoville heat units (SHU). This measurement is the highest dilution of a chili pepper extract at which heat can be detected by a taste panel."

A weakness of the Scoville organoleptic test is its imprecision due to human subjectivity, depending on the taster's palate and number of mouth heat receptors, which vary widely among subjects. Another shortcoming is sensory fatigue; the palate is quickly desensitized to capsaicinoids after tasting a few samples within a short time period. Results vary widely (up to ± 50%) between laboratories.

Quantification by HPLC

Since the 1980s, spice heat has been assessed quantitatively by high-performance liquid chromatography (HPLC), which measures the concentration of heat-producing capsaicinoids, typically with capsaicin content as the main measure. As stated in one review "the most reliable, rapid, and efficient method to identify and quantify capsaicinoids is HPLC; the results of which can be converted to Scoville heat units by multiplying the parts-per-million by 16."

HPLC method gives results in American Spice Trade Association 1985 "pungency units", which are defined as one part capsaicin equivalent per million parts dried pepper mass. This "parts per million of heat" (ppmH) is found with the following calculation: $$\text{ppmH} = \frac{\text{peak area}({\text{capsaicin})} + 0.82\cdot \text{peak area}(\text{dihydrocapsaicin)}}{\text{peak area}(\text{standard)}}$$

Peak areas are calculated from HPLC traces of dry samples of the substance to be tested in 1 ml of acetonitrile. The standard used to calibrate the calculation is 1 gram of capsaicin. Scoville heat units are found by multiplying the ppmH value by a factor of 15. By this definition of ppmH, spicy compounds other than the two most important capsaicinoids are ignored, despite the ability of HPLC to measure these other compounds at the same time.

Considerations
Since Scoville ratings are defined per unit of dry mass, comparison of ratings between products having different water content can be misleading. For example, typical fresh chili peppers have a water content around 90%, whereas Tabasco sauce has a water content of 95%. For law-enforcement-grade pepper spray, values from 500,000 up to 5 million SHU have been reported, but the actual strength of the spray depends on the dilution. This problem can be overcome by stating the water content along with the Scoville value. One way to do so is the "D-value", defined as total mass divided by dry mass.

Numerical results for any specimen vary depending on its cultivation conditions and the uncertainty of the laboratory methods used to assess the capsaicinoid content. Pungency values for any pepper are variable, owing to expected variation within a species, possibly by a factor of 10 or more, depending on seed lineage, climate and humidity, and soil composition supplying nutrients. The inaccuracies described in the measurement methods also contribute to the imprecision of these values.

Capsicum peppers
Capsicum chili peppers are commonly used to add pungency in cuisines worldwide. The range of pepper heat reflected by a Scoville score is from 500 or less (sweet peppers) to over 2.6 million (Pepper X) (table below; Scoville scales for individual chili peppers are in the respective linked article). Some peppers such as the Guntur chilli and Rocoto are excluded from the list due to their very wide SHU range. Others such as Dragon's Breath and Chocolate 7-pot have not been officially verified.

Capsaicinoids

The class of compounds causing pungency in plants such as chili peppers is called capsaicinoids, which display a linear correlation between concentration and Scoville scale, and may vary in content during ripening. Capsaicin is the major capsaicinoid in chili peppers.

The Scoville scale may be used to express the pungency of other, unrelated TRPV1 agonists, sometimes with extrapolation for much hotter compounds. One such substance is resiniferatoxin, an alkaloid present in the sap of some species of euphorbia plants (spurges). Since it is 1000 times as hot as capsaicin, it would have a Scoville scale rating of 16 billion. In the table below, non-capsaicinoid compounds are italicized.

title: Scoville scale