|
|
my brain doesn't quite bend that way.
Real programmers use butterflies
|
|
|
|
|
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.)
|
|
|
|
|
For some reason the idea of norwegian ukulele players makes me grin like an idiot.
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.
It bugs me trying to approach it, because so much of it is just opaque to me.
Real programmers use butterflies
|
|
|
|
|
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
modified 19-Jan-21 21:04pm.
|
|
|
|
|
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!
|
|
|
|
|
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! (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 }
};
modified 9-Jul-20 14:24pm.
|
|
|
|
|
|
Maybe it's just a typo, but you have two of the major keys transposed (bad choice of words maybe in this context!)
Line 2 SHARPS should be "GDAEBFC"
However, there are bigger problems!
This code will return mostly wrong answers. If we look at the sharps only, your code (assume it's major) would return:
C, G# major, D# major, A# major ...
which is incorrect.
The correct sequence (without all the "majors" shown) would be: C G D A E B F# C#
And a sort of reverse applies situation applies to the flats. (C), F, Bb, Eb, Ab, Db, Gb, Cb
Hope that helped!
modified 10-Jul-20 3:54am.
|
|
|
|
|
Hi, I'm not sure what language the pretty generic C-style code is in but I guess it's not Javascript as ToString is Pascal case.
Anyway, this JS library is brilliant for accessing musical theory in code.
|
|
|
|
|
it's C#.. oooh and thank you. I'll take a look
Real programmers use butterflies
|
|
|
|
|
SHARPS string is wrong. Should be GDAEBFC.
Otherwise looks good
|
|
|
|
|
|
The closest I've came was writing a few measures of "music" containing abominations like 4096th notes, and notes with a half dozen dots in a highschool class to spite a teacher I disliked.
(It was trivial - if a bit tedious - to create iteratively by splitting notes in half and inserting the new one randomly, far harder for the teacher to actually add up to make sure it actually had the correct total. )
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Not sure if this was already mentioned in one of the other responses, but you have E and A in the wrong order for the sharp key signatures. A has 3 and E has 4.
I learned the sequence of sharps (aka circle of fifths) back in piano classes many years ago as "Father Charles Goes Down And Ends Battle". Conveniently, you can reverse the phrase to get the order of flats (ie circle of fourths) and it still makes sense.
|
|
|
|
|
It's not right: major and minor keys have different numbers of sharps or flats. For example, while B major has 5 sharps: C#, D#, F#, G#, A#, B minor has a D natural, and then, if it's a harmonic minor, a G natural; if it's a melodic minor, a G# and A# for an ascending scale, whereas both those are natural for a descending scale. Minor keys are tricky: there's no fixed answer. More here:
musictheory.net[^]
|
|
|
|
|
To simplify that - there are 12 keys in the chromatic scale, so just put an integer from 0...11.
Then you don't have any regional differences.
And if you want major / minor, then add a Boolean.
Should suffice for the most common "Western" music.
PS
|
|
|
|
|
no, this is not even close.
Real programmers use butterflies
|
|
|
|
|
Think it would be a good guess to look at music notation programs like MuseScore
|
|
|
|
|
Note that no flats or sharps is C major (or A minor), but that C minor is three flats (same as E flat).
( scode == 0 ) && (IsMinor) should be A minor, not C minor
I have always enjoyed this presentation of the "circle of fifths": Tolkien Circle of Fifths : lotr[^]
Letter names outside the circle are the major keys.
Lower case letters on the inside of the circle are the minor keys.
This more colorful presentation includes all the sharp & flat keys.
[^]
|
|
|
|
|
They've been bugging me for a few months.
I tried some insecticides, but they just keep on coming, although it's gotten less.
So I was wondering how these ants didn't get infected with COVID-19, as it's possible for the virus to infect animals.
Turns out they have tiny anty-bodies.
Ba dum tsss! I'll get my coat.
Half of the story is actually true though.
|
|
|
|
|
I hear the same thing applies to termites[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
But which half of the story am I laughing at?
|
|
|
|
|
There is an insecticide known as "ant honey" (because it looks like honey). You place drops of it where the ants are to be found (but not near food or on food preparation surfaces!), and the ants take it back to their nest, where it kills the ants in the nest.
It takes a few days to work, but if it does - it works very well.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Daniel Pfeffer wrote: It takes a few days to work, but if it does - it works very well.
If it works, then it works?
That is like saying: "60% of the time, it works every time"
|
|
|
|
|