I have found a maths regularity in MIDI using Python

Anything that doesn't fit into other topics goes here!
A year ago I've tried to make a music generator. It was buggy. I've decided to measure real music. Probably I haven't found nothing new.
I knew that music is linear. Then if I convolve it with [-1,1], it will become constant. Guess what will be if to convolve again? Right, pulse.
And the music transformed to pulse looks like (I've used the "It Must've Been Love"):
Image
Image
Image
And there is a regularity in that pulse. See that green binary layer? If it's 0, then a cumulative sum which is constant is 0 too. That means, the music is in the same state it started. 0 ends the music word.
So knowing that, music can be separated into words. Note that the sum of every word is 0. Except maybe last.
And words can be measured in three ways.
First is obvious - duration of word.
Second is how many notes in a word. I'll call it amount.
Third is absolute sum of all notes in the word. I'll call it path.
I can show that these three features are similar to each other.
Take the duration as is. Get its mean.
Square the amount, divide by its mean and multiply by duration's mean. Do the same with the path.
Now compare these three curves. See how close they are?
Image
Image
Image
The code: https://drive.google.com/open?id=19mtip ... jvYPPrw3f1
I dunno if there's a practical use for this. If I'll find a way to invert that...
Edit. I'm sorry. There were two mistakes. First, path as described above is absmean*amount. So it's better to use square absmean as path.
Second - I thought I didn't squared time. But time wasn't on the graph. No, I didn't squared what I called amount.
I've updated the files. Now the graph looks like:
Image
Image
Image
I'm really sorry.
Add: time does not completely follow amount and path. But they're still close.
Add: it makes sense if not to square anything, but divide the time by Ticks Per Quarter Note.
Image
And I'm trying to do next order.
Image
Code will be at version 4 of the file when I'll be sure.
Add: almost sure. Trying to fake that curve.
Image
Image
These are random curves. I think it's possible to add some more variation to them, but I'll do it later.
Add: quick fix.
Image
It's v5.
bckpkol wrote:
Sun Mar 11, 2018 10:42 am
I knew that music is linear. Then if I convolve it with [-1,1], it will become constant.
Very interesting, but it's beyond my level of understanding. What does "to convolvo the music" mean?
https://stackoverflow.com/questions/386 ... m-function
That's what I mean by "convolve". For more, look in the code.
In common speech it means subtract the previous note if there's one, else subtract the note itself, which gets 0.
bckpkol wrote:
Sun Mar 11, 2018 10:42 am
tried to make a music generator.
Lmms needs coders! Especially for the bugs (criticals)
https://github.com/LMMS/lmms/labels/critical
that blocks for the 1.2 release.

You can read all about participating and how to get your own repository, the methods for creating and submitting patches and the Master commits, Here:
https://github.com/LMMS/lmms/wiki

Project lead is Tres Finocchiaro He is the one to contact if you have special questions or run into some difficulties with the gitHub system.
https://github.com/tresf

I hope you will be interested in aiding project lmms :)
@musikbear, I'd always like to help. However I haven't looked at LMMS source deeply, and I'd be only able to do small patches to the code. And currently there's no open issues. Also, sometimes a new issue is a new kind of old issue, so if there would be new, I first look at the old for the information.
Edit: didn't see that you gave the link to the critical. Well, what's the non-critical issue?
bckpkol wrote:
Fri Mar 16, 2018 1:15 am
Edit: didn't see that you gave the link to the critical. Well, what's the non-critical issue?
Just now, a rehaul of all our bugs are being done. The purpose is to point out, sc. 'junior-jobs'. Those are smaller jobs, that does not need huge insight in core, and also are reasonable in work-load.
You can follow the process here:
https://github.com/LMMS/lmms/issues/4182
I do not think, that the actual label is in use, but it will be in 'shortish' time, but you could ask, in that thread, if there is something you could look at :)
Any help is appreciated!
bckpkol wrote:
Tue Mar 13, 2018 5:14 pm
https://stackoverflow.com/questions/386 ... m-function
That's what I mean by "convolve". For more, look in the code.
In common speech it means subtract the previous note if there's one, else subtract the note itself, which gets 0.
Ho! Thanks :)
Well :|
It's sunny today, huh? 8-)

(I feel a bit overwhelmed)