For Mathy Musicians

For you mathy musicians!

This all started as a way to make flashcards for myself to help improve my sight reading. I wanted to make flashcards of “all the possible rhythm combinations”. :laughing:

I started with quarter notes and rests in 4/4 time. This was pretty straightforward because it’s just counting in binary.





Next I wanted to do the same thing, but using eighth notes in 4/4 time.
Again, you count in binary, but this time it’s from 00000000 to 11111111.


Here’s how a little bit of that looked, from 00000100 to 00010001





There were 256 measures of it – it ran 6 pages.
(By the way, I played it as a midi file, and some parts in the middle had wonderful syncopation!) :sunglasses:

OK, this is all well and good, but it’s all eighth notes. This is fine if you’re playing a percussion instrument with no sustain, but if you’re playing flute, piano, etc. there’s whole notes, half notes, quarter notes, dotted notes, etc. In other words, the eighth notes can be tied in various combinations.

I started working on this problem last night and was able to generate all the combinations for 2 eighth notes in a measure, 3 eighth notes in a measure, 4 in a measure, 5 in a measure – all the way up to 6/8 time. At that point the air got too thin and I had to turn back :boggle:

Here is an example of what made it so difficult.
Consider the case of 00001111, in other words, four rests and and four eighth notes. How many ways can you tie those eighth notes together?

The top staff has the eighth notes with their varying pattern of ties, the bottom staff is the same information written in a more standard way.




Eight combinations! And that’s just for 00001111 !
Side note – here’s the way I figured out how to find all the combinations of ties for 1111.
Look at the 4 notes, there’s 3 spaces between them.
Each space can either be tied, or not tied. One, or zero…so it’s counting in binary again!


If you got this far, I’m impressed. Or a little worried… :astonished:
Can anyone think of an algorithm for computing all the rhythm combinations from 00000000 to 11111111?
I’m just going after it by brute force and trying to see patterns.

I think I’m a victim of syncope.

To begin with, you’ve got the existence of a note as a binary number. So you are working in one dimension.
Now you are trying combinations of existences of notes, so you’ve developed to two dimensions.
If you give the pitch of the note a numerical value, you are working in three dimensions… Getting into calculus territory… you could add another dimension with loudness/volume. How’s yer algebra?

Caroluna,

Wow, I’m impressed… I like your systematic approach. I also agree: some nice little bits of syncopation emerge… stuff one wouldn’t normally think to try… very nifty.

As to your question on algorithms: I think its quite tractable, especially if you are willing to live with your “top line” notation. First, as you have done, just count from 00000000 to 11111111 in binary. Thats 256 different measures of eighth notes.

Then, with that set generated, examine each measure as you have done, and go through all the possible ties (of course, ignoring some cases like two adjacent rests). Note that this results in two sets of 8 bits for each measure: one for the notes and one for the ties.

Note further: to generate your bottom-line notation, you could then re-scan the two bit-sets mentioned above and “consolidate” or “collapse” adjacent ties into a new type of note (e.g. quarter, dotted quarter, half). This would be a “valued” set, i.e. not just 1 or 0, but 1,2,3,or 4 depending on how long the consolidated notes were. More data…

Question: do you have a way to take a text file (16bits for each measure) and import it into a program that prints sheet music? Come to think of it, I wonder if ABC notation wouldn’t help here… Are there ABC->sheet music printers?

Finally, I cant wait to see if you are inspired to make a graphic of this process… I miss your replies to Denny’s APOD postings.

trill

This may make sense to y’all, but this makes my head spin.
I’d have never played or read a note if I’d had to grasp this. :stuck_out_tongue:

Me too!

My husband took a little more than an hour this evening to write up a computer program.
It calculated the number of combinations for the 8 notes problem: 1597.

Then he explained to me how the program worked. It’s like this:

:laughing: Actually, I’m still a bit fuzzy about how it works.
I do know, though, that I’m not going to be making that many flashcards. :stuck_out_tongue:

Nice, very nice. Yes, indeedy! Hmm.

there ya go IB! :laughing:

Caroluna !

What a lovely rendering !

Letters, numbers, colors, axes, with some fluid meaning meandering through… what more could one ask for ?

On the subject of sight reading practice, I sometimes just flip to random pages in the “Fiddlers Fakebook” by David Brody. It’s got like 500 tunes in it.

I’m curious: when there’s a tune you really like that you want to learn, how do go about it? Do you always play from sheet music? Do you memorize?

trill

Aye, that’ll do. :thumbsup:

Thank you for everyone’s kind and appreciative comments!
I had a blast doing this (no idea why :boggle: ) and it was great to see the feedback.

I really envy people who can sightread. I’m fascinated that some people can look at music and “hear” it in their heads!

I would love to read “the dots” but I’ve always played by ear. :frowning: I used to use a sequencer program that had a very nice “piano roll” function where the notes were represented by bars of different lengths. Once I composed a long piece, and to have it performed in public I had to translate it into “dots”. Took me 6 months, but I learned a lot!

I still write dots better than I read them!

Currently my kid is learning bass guitar and he wants me to write out different bass lines that we hear. "Hey, Invisible Sun, that one’s cool. Can you write that one out?"I just about busted my brain figuring it out (had syncopation) but finally got it. Just one more little block of knowledge.

My husband cracked the 8 note problem. His output looks like this –

rhythm 1395 has 8 notes: 0-0 0 0-0-0-0 .
rhythm 1396 has 8 notes: 0-0 0 0-0-0-0 0
rhythm 1397 has 8 notes: 0-0 0 0-0-0-0-0
rhythm 1398 has 8 notes: 0-0 0-0 . . . .
rhythm 1399 has 8 notes: 0-0 0-0 . . . 0
rhythm 1400 has 8 notes: 0-0 0-0 . . 0 .
rhythm 1401 has 8 notes: 0-0 0-0 . . 0 0
rhythm 1402 has 8 notes: 0-0 0-0 . . 0-0

Next project is to write that out into whole notes, half notes, dotted quarters etc.
I bet I’ll learn a lot!

I think I’m a victim of > syncope> .

I had to look that one up! What a great word!

I bet Denny has a nice emoticon for that one.

oh dear…you’ve teamed up with muttpt.


I thought we had agreed to not do “grasshopper” jokes anymore



Yes, but that thread didn’t even begin to plumb the depths of your, um, resources.
Surely you have a boggly one with little tweety birds flying around the guy’s head?

And since we are on the topic of musical permutations and combinations, you ought to be able to work that in there too. :stuck_out_tongue:

Caroluna, you only gave us the result yesterday, without explanation! That left me no rest, till I had the problem cracked in my own way.
Here it is, a combination of Brute Force and some math:

Starting out with a bar divided into eight time slots.
We are looking for combinations of numbers 1 to 8 which should always add up to 8 (to make a full bar).
8 stands for a whole bar,
7 for a whole bar less 1 eighths,
6 for a whole bar less 2 eighths (3/4 note),
5 for a whole bar less 3 eighths,
4 for a half bar,
3 for a dotted quarter,
2 for a quarter,
1 for an eighths OR a rest of an eighths. Rests of other length are ignored, as they can be made up from eighth rests.

Now we can find 22 types of combinations listed below, each sums to 8, making a bar. For each type we can determine how many combinations exist, how many ways we can shuffle the numbers into a different order. The number of combinations follows the type in each row (column C). The sum of all these combinations is 128! But we have not considered the rests yet. Each 1 in the combination type can be either an eighth note or a rest of that length. So we need to multiply the number in C with 2 times 2 times 2, depending on how many eighths are in that type. so we multiply with 2 to the power of the number of 1s (column E). And we get the true number of combinations including rests (column Sum).

Type      C    E   Sum
8         1      =   1
71        2 *  2 =   4
62        2      =   2
53        2      =   2
44        1      =   1
611       3 *  4 =  12
521       6 *  2 =  12
431       6 *  2 =  12
422       3      =   3
332       3      =   3
5111      4 *  8 =  32
4211     12 *  4 =  48
3311      6 *  4 =  24
3221     12 *  2 =  24
2222      1      =   1
41111     5 * 16 =  80
32111    20 *  8 = 160
22211    10 *  4 =  40
311111    6 * 32 = 192
221111   15 * 16 = 240
2111111   7 * 64 = 448
11111111  1 *256 = 256
----------------------
        128       1597

Example: Type 3311: 2 dotted quarters and 2 eighths or rests.
There are 6 ways of arranging two 3s and two 1s:

3311
3131
3113
1331
1313
1133

and in each of these each 1 can be an eighths OR an eighth rest: so 22 = 4 possibilities for each row, making a total of 64 = 24

Adding rests for 3311: 
rests are now  0, and eighth are now 1:
3300
3301
3310
3311
etc. the same for patterns 3131, 3113, 1331, 1313, 1133

Mostly i was chuffed to get the 1597 total :party:

ya think, eh…

Sheet music? Sheet music? Aside from its decorative aspects, sheet music is useless. :imp:

I just listen to a CD of whatever it is in the car for a while.

Dzzzzzzz Can this topic be for real?

It’s quite mind blowing how different peoples minds work and sorry hans but is there nothing to do in the Moray Firth? :poke:

Of course it’s real, dear! It’s just intellectual. :poke:

What if it’s 100 % Egyptian cotton sheet music?