Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Does anyone here know any formal music theory?

Does anyone here know any formal music theory?

Scheduled Pinned Locked Moved The Lounge
question
44 Posts 23 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H honey the codewitch

    I don't. It's sad I know, esp considering I just delivered a MIDI library unto the world. Anyway, I have a question for a music nerd, and it has to do with key signatures. Googling led me to some confusion. Basically I'm getting my key signature back as an int and a bool together, where the int is range -7 to 7 and the bool indicates minor or major. The int indicates the number of flats (int is negative) or the number of sharps (int is positive) or C if it's 0. Regarding the int, I'm not sure if I'm translating it correctly in code.

    const string FLATS = "FBEADGC";
    const string SHARPS = "GDEABFC";

    if (0 == scode)
    return "C " + (IsMinor ? "minor" : "major");
    if(0>scode)
    return FLATS[((-scode)-1)].ToString() + "b " + (IsMinor ? "minor" : "major");
    else // if(0

    scode is the aforementioned int.

    Real programmers use butterflies

    M Offline
    M Offline
    Marc Clifton
    wrote on last edited by
    #4

    If you haven't come across this already: Circle of fifths - Wikipedia[^]

    Latest Articles:
    Proxy class for TypeScript/Intellisense DOM manipulation

    H 1 Reply Last reply
    0
    • M Marc Clifton

      If you haven't come across this already: Circle of fifths - Wikipedia[^]

      Latest Articles:
      Proxy class for TypeScript/Intellisense DOM manipulation

      H Offline
      H Offline
      honey the codewitch
      wrote on last edited by
      #5

      my brain doesn't quite bend that way.

      Real programmers use butterflies

      K L 2 Replies Last reply
      0
      • Greg UtasG Greg Utas

        The flat key signatures go F, Bb, Eb, Ab, Db, Gb, Cb. The sharp key signatures go G, D, A, E, B, F#, C#. EDIT: That's major. No sharps/flats = C. The minor flat key signatures go D, G, C, F, Bb, Eb, Ab. The minor sharp key signatures go E, B, F#, C#, G#, D#, A#. No sharps/flats = A. But that's just major/minor. Then there's Dorian, Phrygian, and others. :laugh:

        Robust Services Core | Software Techniques for Lemmings | Articles

        K Offline
        K Offline
        kalberts
        wrote on last edited by
        #6

        There is a strong tradition for denoting major scales with uppercase letters, and minor scales with lowercase letters. So, The minor flat key signatures go d, g, c, f, bb, eb, ab. The minor sharp key signatures go e, b, f#, c#, g#, d#, a#. No sharps/flats = a. Maybe this tradition is stronger in some musical styles than others. I have never seen guitar chord annotations where it is not followed.

        Greg UtasG H M 4 Replies Last reply
        0
        • K kalberts

          There is a strong tradition for denoting major scales with uppercase letters, and minor scales with lowercase letters. So, The minor flat key signatures go d, g, c, f, bb, eb, ab. The minor sharp key signatures go e, b, f#, c#, g#, d#, a#. No sharps/flats = a. Maybe this tradition is stronger in some musical styles than others. I have never seen guitar chord annotations where it is not followed.

          Greg UtasG Offline
          Greg UtasG Offline
          Greg Utas
          wrote on last edited by
          #7

          True. That's how I mark up scores, although the pop music charts I've seen use A and Am for major and minor chords, respectively.

          Robust Services Core | Software Techniques for Lemmings | Articles

          <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
          <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

          J 1 Reply Last reply
          0
          • H honey the codewitch

            my brain doesn't quite bend that way.

            Real programmers use butterflies

            K Offline
            K Offline
            kalberts
            wrote on last edited by
            #8

            I guess English speaking musicians have reminders, like the Norwegian "Gå Du Anton Etter Henriks FISkestang", giving the sharp scales G, D, A, E, H, F# . (B is called H in Germanic languages, and sharp is an "iss" suffix.) It makes no sense translating it for use in English - "Go, You Anton, to Fech Henrik's Fishing Rod" - the initials don't match the scales at all. But I am quite sure that there are similar rules in English. There is of course another similar rule for the flats scales. Standard six string guitar tuning is, in Norway, by the rule "En Annen Dag Gikk Han Ensom" (another day, he was walking alone). Just as untranslatable as he sharp scales rule, but I am sure there are English rules for that. (Funny parallel: Anyone who has picked up an ukulele, knows that it is tuned to "My Dog Has Fleas". I learned that sequence of notes as a kid, never knowing why it was called that. Less than a year ago, I first heard the tune about the dog. Appearently, every single kid in the USA knows that nursery rhyme from infancy. In Norway, we don't.)

            H 1 Reply Last reply
            0
            • H honey the codewitch

              I don't. It's sad I know, esp considering I just delivered a MIDI library unto the world. Anyway, I have a question for a music nerd, and it has to do with key signatures. Googling led me to some confusion. Basically I'm getting my key signature back as an int and a bool together, where the int is range -7 to 7 and the bool indicates minor or major. The int indicates the number of flats (int is negative) or the number of sharps (int is positive) or C if it's 0. Regarding the int, I'm not sure if I'm translating it correctly in code.

              const string FLATS = "FBEADGC";
              const string SHARPS = "GDEABFC";

              if (0 == scode)
              return "C " + (IsMinor ? "minor" : "major");
              if(0>scode)
              return FLATS[((-scode)-1)].ToString() + "b " + (IsMinor ? "minor" : "major");
              else // if(0

              scode is the aforementioned int.

              Real programmers use butterflies

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #9

              I know the important theory of formal music: "It ain't over 'til the fat lady sings".

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony AntiTwitter: @DalekDave is now a follower!

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              1 Reply Last reply
              0
              • K kalberts

                I guess English speaking musicians have reminders, like the Norwegian "Gå Du Anton Etter Henriks FISkestang", giving the sharp scales G, D, A, E, H, F# . (B is called H in Germanic languages, and sharp is an "iss" suffix.) It makes no sense translating it for use in English - "Go, You Anton, to Fech Henrik's Fishing Rod" - the initials don't match the scales at all. But I am quite sure that there are similar rules in English. There is of course another similar rule for the flats scales. Standard six string guitar tuning is, in Norway, by the rule "En Annen Dag Gikk Han Ensom" (another day, he was walking alone). Just as untranslatable as he sharp scales rule, but I am sure there are English rules for that. (Funny parallel: Anyone who has picked up an ukulele, knows that it is tuned to "My Dog Has Fleas". I learned that sequence of notes as a kid, never knowing why it was called that. Less than a year ago, I first heard the tune about the dog. Appearently, every single kid in the USA knows that nursery rhyme from infancy. In Norway, we don't.)

                H Offline
                H Offline
                honey the codewitch
                wrote on last edited by
                #10

                For some reason the idea of norwegian ukulele players makes me grin like an idiot. :-D As far as your mnemonics, we have similar things in English, but it's not so much memorizing them as trying to understand them that vexes me. The "why" of it eludes me other than "it sounds appealing" and I suspect that answer lies in higher math, which is typically well beyond me. But since it doesn't make sense to me otherwise, it's hard for me to understand it. I need to deconstruct things in order to grok them, whereas it seems most of my musician friends don't, or at least don't care about the mechanics behind the things like scales. They just *use* them - and well! I don't get how. I can play a little too, but also, I don't understand *how* I do it. I just do it, but not well. :laugh: It bugs me trying to approach it, because so much of it is just opaque to me.

                Real programmers use butterflies

                1 Reply Last reply
                0
                • K kalberts

                  There is a strong tradition for denoting major scales with uppercase letters, and minor scales with lowercase letters. So, The minor flat key signatures go d, g, c, f, bb, eb, ab. The minor sharp key signatures go e, b, f#, c#, g#, d#, a#. No sharps/flats = a. Maybe this tradition is stronger in some musical styles than others. I have never seen guitar chord annotations where it is not followed.

                  H Offline
                  H Offline
                  honey the codewitch
                  wrote on last edited by
                  #11

                  I'll probably avoid that in my MIDI library because of things like "bb" looking confusing and my hesitancy to use a unicode flat character in the alternative that won't display on things like a console window. "Bb" is much clearer in my specific scenario, IMO, even if it defies convention.

                  Real programmers use butterflies

                  K 1 Reply Last reply
                  0
                  • Greg UtasG Greg Utas

                    The flat key signatures go F, Bb, Eb, Ab, Db, Gb, Cb. The sharp key signatures go G, D, A, E, B, F#, C#. EDIT: That's major. No sharps/flats = C. The minor flat key signatures go D, G, C, F, Bb, Eb, Ab. The minor sharp key signatures go E, B, F#, C#, G#, D#, A#. No sharps/flats = A. But that's just major/minor. Then there's Dorian, Phrygian, and others. :laugh:

                    Robust Services Core | Software Techniques for Lemmings | Articles

                    K Offline
                    K Offline
                    kalberts
                    wrote on last edited by
                    #12

                    Greg Utas wrote:

                    Then there's Dorian, Phrygian, and others.

                    A true story related to that: One of Norway's greatest modern folk singers, Lillebjørn Nilsen, tellsabout the first song he wrote: As a teenage schoolboy, he has an essay assignment, "Explain and anlyze one of your favorite poems". So he started out by writing the poem. Then he made up a tune for it, and performed it in a folk singer's club. In the audience was Geirr Tveitt, well known Norwegian composer. He went up to the young boy and remarked "Your have made a song very true to the traditions, and in a hypo-mixolydian scale!" To which Lillebjørn replied: "Huh? What's that?" At home, he looked up "hypo-mixolydian" in his music dictonary, to discover that Geirr Tveitt was right. For the curious ones: You can hear the first verse and a half of this song in a Scottish translation (it can hardly be called "English" :-)) at Adam McNaughtan: Dance Noo Laddie[^]. I like this version as much as the original!

                    1 Reply Last reply
                    0
                    • H honey the codewitch

                      I'll probably avoid that in my MIDI library because of things like "bb" looking confusing and my hesitancy to use a unicode flat character in the alternative that won't display on things like a console window. "Bb" is much clearer in my specific scenario, IMO, even if it defies convention.

                      Real programmers use butterflies

                      K Offline
                      K Offline
                      kalberts
                      wrote on last edited by
                      #13

                      Or learn German (or a related language, such as Norwegian): In the Germanic tradition, B is called H, and B flat is called B. In any case, it will be less confusing if you use a true musical ♭ sign for the flats, rather than a plain lowercase b letter. B♭ and b♭ isn't that confusing. Bonus joke: What could you get if you drop a piano down a mine shaft? Answer: a♭

                      Greg UtasG H J 3 Replies Last reply
                      0
                      • K kalberts

                        There is a strong tradition for denoting major scales with uppercase letters, and minor scales with lowercase letters. So, The minor flat key signatures go d, g, c, f, bb, eb, ab. The minor sharp key signatures go e, b, f#, c#, g#, d#, a#. No sharps/flats = a. Maybe this tradition is stronger in some musical styles than others. I have never seen guitar chord annotations where it is not followed.

                        Greg UtasG Offline
                        Greg UtasG Offline
                        Greg Utas
                        wrote on last edited by
                        #14

                        I just realized this is probably regional. Maybe you do it that way in Norway. I have some Le Orme sheet music, and those weird Italians don't write A minor as "a" or "Am". They actually write "La m" (La from do-re-mi... and m = minore). I rarely think in solfege. And if I do, it's relative: "la" = submediant (^6). But they use it absolutely: "la" = A, regardless of the key. Needless to say, I find their annotations useless.

                        Robust Services Core | Software Techniques for Lemmings | Articles

                        <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                        <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                        G 1 Reply Last reply
                        0
                        • K kalberts

                          Or learn German (or a related language, such as Norwegian): In the Germanic tradition, B is called H, and B flat is called B. In any case, it will be less confusing if you use a true musical ♭ sign for the flats, rather than a plain lowercase b letter. B♭ and b♭ isn't that confusing. Bonus joke: What could you get if you drop a piano down a mine shaft? Answer: a♭

                          Greg UtasG Offline
                          Greg UtasG Offline
                          Greg Utas
                          wrote on last edited by
                          #15

                          I thought you'd get a fff!

                          Robust Services Core | Software Techniques for Lemmings | Articles

                          <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                          <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                          K 1 Reply Last reply
                          0
                          • K kalberts

                            Or learn German (or a related language, such as Norwegian): In the Germanic tradition, B is called H, and B flat is called B. In any case, it will be less confusing if you use a true musical ♭ sign for the flats, rather than a plain lowercase b letter. B♭ and b♭ isn't that confusing. Bonus joke: What could you get if you drop a piano down a mine shaft? Answer: a♭

                            H Offline
                            H Offline
                            honey the codewitch
                            wrote on last edited by
                            #16

                            heh. I would use the flat sign but it doesn't render properly everywhere. I do not want to return it from ToString()

                            Real programmers use butterflies

                            1 Reply Last reply
                            0
                            • Greg UtasG Greg Utas

                              True. That's how I mark up scores, although the pop music charts I've seen use A and Am for major and minor chords, respectively.

                              Robust Services Core | Software Techniques for Lemmings | Articles

                              J Offline
                              J Offline
                              jsc42
                              wrote on last edited by
                              #17

                              I don't recall seeing lowercase for minor. I've only seen key signatures like A and Am. Even with minor keys there are two variant - Harmonic and Melodic. To quote Ella Fitzgerald: How strange the change from Major to Minor (actually it is by Noel Coward, but mostly known as sang by Ella Fitzgerald)

                              Greg UtasG 1 Reply Last reply
                              0
                              • J jsc42

                                I don't recall seeing lowercase for minor. I've only seen key signatures like A and Am. Even with minor keys there are two variant - Harmonic and Melodic. To quote Ella Fitzgerald: How strange the change from Major to Minor (actually it is by Noel Coward, but mostly known as sang by Ella Fitzgerald)

                                Greg UtasG Offline
                                Greg UtasG Offline
                                Greg Utas
                                wrote on last edited by
                                #18

                                I think it's fairly common on the Continent (edit: for classical music).

                                Robust Services Core | Software Techniques for Lemmings | Articles

                                <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                                <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                                1 Reply Last reply
                                0
                                • Greg UtasG Greg Utas

                                  I thought you'd get a fff!

                                  Robust Services Core | Software Techniques for Lemmings | Articles

                                  K Offline
                                  K Offline
                                  kalberts
                                  wrote on last edited by
                                  #19

                                  I guess that even a piano would turn into a forte, or forte fortissimo molto, so you for practical purposes you are right. You could also point out the accelerando - close to 9.8 m/s2. But we were talking scales, weren't we?

                                  Greg UtasG 1 Reply Last reply
                                  0
                                  • H honey the codewitch

                                    my brain doesn't quite bend that way.

                                    Real programmers use butterflies

                                    L Offline
                                    L Offline
                                    Lost User
                                    wrote on last edited by
                                    #20

                                    I suggest to read it carefully and try to understand. It is formal, at least for me. From all what I read from you it should not be a big problem for you. Once you got it, it will help you a lot. Finally, it is much easier than all the parser stuff you presented here ;)

                                    It does not solve my Problem, but it answers my question

                                    1 Reply Last reply
                                    0
                                    • H honey the codewitch

                                      I don't. It's sad I know, esp considering I just delivered a MIDI library unto the world. Anyway, I have a question for a music nerd, and it has to do with key signatures. Googling led me to some confusion. Basically I'm getting my key signature back as an int and a bool together, where the int is range -7 to 7 and the bool indicates minor or major. The int indicates the number of flats (int is negative) or the number of sharps (int is positive) or C if it's 0. Regarding the int, I'm not sure if I'm translating it correctly in code.

                                      const string FLATS = "FBEADGC";
                                      const string SHARPS = "GDEABFC";

                                      if (0 == scode)
                                      return "C " + (IsMinor ? "minor" : "major");
                                      if(0>scode)
                                      return FLATS[((-scode)-1)].ToString() + "b " + (IsMinor ? "minor" : "major");
                                      else // if(0

                                      scode is the aforementioned int.

                                      Real programmers use butterflies

                                      D Offline
                                      D Offline
                                      David ONeil
                                      wrote on last edited by
                                      #21

                                      This is what I came up with after a lot of googling on the 'fifths' that was mentioned earlier. I use it in my MIDI sequencer. I'm relatively sure I got it right, but not absolutely, so if anyone sees anything I've screwed up, feel free to give me hell! :laugh: (And I see I should have used non-caps for some, from another comment!) - edit: fixed

                                      const KeySignatures::KeySig KeySignatures::keySigsC[] = {
                                      { "g# min (af min)", 5, true },
                                      { "g min", -2, true },
                                      { "f# min", 3, true },
                                      { "f min", -4, true },
                                      { "e min", 1, true },
                                      { "ef min (d# min)", -6, true },
                                      { "d# min (ef min)", 6, true },
                                      { "d min", -1, true },
                                      { "c# min (df min (unused))", 4, true },
                                      { "c min", -3, true },
                                      { "b min", 2, true },
                                      { "bf min (a# min)", -5, true },
                                      { "a# min (bf min)", 7, true },
                                      { "a min", 0, true },
                                      { "af min (g# min)", -7, true },
                                      { "Af Maj", -4, false },
                                      { "A Maj", 3, false },
                                      { "Bf Maj", -2, false },
                                      { "B Maj (Cf Maj)", 5, false },
                                      { "Cf Maj (B Maj)", -7, false },
                                      { "C Maj", 0, false },
                                      { "C# Maj (Df Maj)", 7, false },
                                      { "Df Maj (C# Maj)", -5, false },
                                      { "D Maj", 2, false },
                                      { "Ef Maj", -3, false },
                                      { "E Maj", 4, false },
                                      { "F Maj", -1, false },
                                      { "F# Maj (Gf Maj)", 6, false },
                                      { "Gf Maj (F# Maj)", -6, false },
                                      { "G Maj", 1, false }
                                      };

                                      The forgotten roots of science | C++ Programming | DWinLib

                                      R 1 Reply Last reply
                                      0
                                      • K kalberts

                                        I guess that even a piano would turn into a forte, or forte fortissimo molto, so you for practical purposes you are right. You could also point out the accelerando - close to 9.8 m/s2. But we were talking scales, weren't we?

                                        Greg UtasG Offline
                                        Greg UtasG Offline
                                        Greg Utas
                                        wrote on last edited by
                                        #22

                                        Accelerando? :laugh:

                                        Robust Services Core | Software Techniques for Lemmings | Articles

                                        <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                                        <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                                        1 Reply Last reply
                                        0
                                        • D David ONeil

                                          This is what I came up with after a lot of googling on the 'fifths' that was mentioned earlier. I use it in my MIDI sequencer. I'm relatively sure I got it right, but not absolutely, so if anyone sees anything I've screwed up, feel free to give me hell! :laugh: (And I see I should have used non-caps for some, from another comment!) - edit: fixed

                                          const KeySignatures::KeySig KeySignatures::keySigsC[] = {
                                          { "g# min (af min)", 5, true },
                                          { "g min", -2, true },
                                          { "f# min", 3, true },
                                          { "f min", -4, true },
                                          { "e min", 1, true },
                                          { "ef min (d# min)", -6, true },
                                          { "d# min (ef min)", 6, true },
                                          { "d min", -1, true },
                                          { "c# min (df min (unused))", 4, true },
                                          { "c min", -3, true },
                                          { "b min", 2, true },
                                          { "bf min (a# min)", -5, true },
                                          { "a# min (bf min)", 7, true },
                                          { "a min", 0, true },
                                          { "af min (g# min)", -7, true },
                                          { "Af Maj", -4, false },
                                          { "A Maj", 3, false },
                                          { "Bf Maj", -2, false },
                                          { "B Maj (Cf Maj)", 5, false },
                                          { "Cf Maj (B Maj)", -7, false },
                                          { "C Maj", 0, false },
                                          { "C# Maj (Df Maj)", 7, false },
                                          { "Df Maj (C# Maj)", -5, false },
                                          { "D Maj", 2, false },
                                          { "Ef Maj", -3, false },
                                          { "E Maj", 4, false },
                                          { "F Maj", -1, false },
                                          { "F# Maj (Gf Maj)", 6, false },
                                          { "Gf Maj (F# Maj)", -6, false },
                                          { "G Maj", 1, false }
                                          };

                                          The forgotten roots of science | C++ Programming | DWinLib

                                          R Offline
                                          R Offline
                                          Ron Anders
                                          wrote on last edited by
                                          #23

                                          Free Bird!!!

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups