note frequency statistics
as everything is computerize it should be possible to produce note frequency statistics such as: middle c occurred 10 times in this piece for a total duration of three seconds. Perhaps even graphs with a picture of a keyboard and how often each note was played.
Comments
I'm not against this, I'm just curious how you would use this and why?
In reply to I'm not against this, I'm by xavierjazz
It could make a great tool for analysis, for instance showing tonal centra through sonata form, or hidden hierarchy in serial music.
In reply to It could make a great tool by HenJor
I hate maths, but I have to recognize this could be a very useful tool to composition analysis people.
I just add an screen musical pitch (frequency in Hertz and kiloHertz) showing to each note we are using (when we enter notes).
Greetings & Blessings from Chile!!!!!!!
Juan
In reply to I'm not against this, I'm by xavierjazz
where I have seen it done is analysis of beethoven's string quartets, as he became more deaf less high notes
In reply to where I have seen it done is by macrobbair
Interesting! Though it seems quite a niche requirement.
In reply to Interesting! Though it seems by shoogle
I'll see if I can hunt up where there was an article on this in the press
In reply to I'll see if I can hunt up by macrobbair
5jan2012
An article in the strad: For each [Beethoven ] quartet the researchers calculated the percentage
of notes above high G6 (1,586Hz) in the first violin part of the first movement exposition.
Writing in the Christmas edition of the British Medical Journal,
the researchers reported that the use of high notes decreased from 8 per cent
for the op.18 quartets to around 5 per cent for the op.59 group
and then to under 2 per cent for opp.74 & 95.
But once Beethoven had gone totally deaf,
the percentage of high notes increased,
rising to just under 4 per cent in the opp.127-135 quartets
I don't think this feature merits inclusion in the main code, but it sounds like an ideal candidate for a plugin. Note counting at least shouldn't be too difficult to do. Feel free to have a go yourself and post back here if you need help. https://musescore.org/en/handbook/plugins-0
In reply to I don't think this feature by shoogle
But...
MuseScore 2.0.0 and above doesn't work with plug-ins.
So...
In reply to But... MuseScore 2.0.0 and by jotape1960
??? 2.X supports plugins - just not the *same* plugins that 1.X did. The programming interface has changed, so older plugins need to be updated.
In reply to ??? 2.X supports plugins - by Marc Sabatella
Sorry!!! I didn't know it.
There is another open source project that specializes in this sort of thing, and it is called music21. It's a programming language, not an application with a GUI etc, but it's a language that would make it trivially simple to write a program to count middle C's or whatever you like. It can load MusicXML files created with MuseScore.
In reply to There is another open source by Marc Sabatella
The main issue would be that if we provide for example the number of notes per pitches in the core of MuseScore. Then we will have another request to show frequencies. Then distribution of note duration, then the noteduration vs the pitches, the number of dynamics, the number of piano dynamics, and so on an so forth.
Everything is possible of course but it's probably better suited for a plugin that anyone can change or indeed something like Music21.
There used to be a plugin for MuseScore 1.3 here https://musescore.org/en/project/scorestats but it hasn't been ported to 2.0.
Another way to count notes would be to save your file as MSCX and use a text editor or command line tool to get the number of occurrences of each note within the file.
Here is how MuseScore stores a Middle C in an MSCX file:
To count the number of Middle Cs in a file:
Via a text editor
Open the MSCX file in a text editor and use the Find function (Ctrl+F) to count the number of times the above strings occur immediately after each other. Notepad++ can find and count regular expressions:
Via the Command Line (Mac or Linux only)
On Mac and Linux you can do it via the Terminal:
Variations:
Alternatively, if you want to count the notes but don't care about which octave they are in:
Or if you want to count the audible pitches and don't care about the enharmonics:
Instead of using a text editor you could use a spreadsheet with the "COUNTIF" or equivalent function. This would work for frequency (search and count for pitch>69, pitch>70 etc.) and for duration, accidentals and for a lot of other things if you'd like to look for them.
But, others are already working on this in terms of analysis of MusicXML files and MIDI files so why re-invent the wheel?
In reply to Instead of using a text by underquark
The sort of thing that I was hoping for is a picture of a keyboard with a graph above: this is how often beethoven used this note and this how often mozart....
In reply to The sort of thing that I was by macrobbair
Using the command line method to get the data and then passing it to another command line tool such as Gnuplot, or by using underquark's spreadsheet method, you could display the results any way you wanted.
You could, for example, draw an ordinary bar chart, hide the axes and labels if necessary, and then insert an image of a piano keyboard just below the x-axis.
In reply to Using the command line method by shoogle
I have no idea how to use these, I tried looking to see if I had gnuplot and it seems just some libraries; I looked for underquark and came up with nothing on either synaptic or the mint package manager. Is it a matter of installing some new software and then trying to work out how to use it?
In reply to I have no idea how to use by macrobbair
Gnuplot is a program as well as a library, but it runs in the terminal. This has the advantage that you can write a script to interpret a score and draw a graph, and then that same script would work for any score. There are lots of tutorials for how to do this, it's not hard but it can take a while to get the hang of so you might prefer the spreadsheet method.
Underquark is another user on these forums who commented above. Underquark suggested using the COUNTIF function built into ordinary spreadsheet software such as MS Excel or LibreOffice Calc.
Spreadsheet method:
Note: These calculations can take a while for long scores, so I suggest you test it with a very short one first. Use a score that contains less than 10 notes in total, then try it with a normal length score one you have got it working.
Save your score as a MSCX file and then open it with LibreOffice Calc (change the separater to "Fixed Width" in the import dialog). All of the file data will be in Column A of the spreadsheet. You need to copy the following formulas in column B and C to get the note statistics:
Once the frequency data is calculated you can make a graph of Occurrences against Tonal Pitch Class, or Occurrences against Note Name. However, every time you make a change to the spreadsheet all of those values will recalculate, so it is best to replace the formulas with the actual results before you do anything else. To do this, select all of the results, copy them and then paste them back over themselves using Edit -> Paste Special -> Values Only.
Gnuplot method:
To install Gnuplot, open a Terminal and type these commands:
(Note: these are the commands for Ubuntu, the commands for Mint are usually the same but they might be a bit different in places. Pay attention to any messages you get on screen.)
Once you have got Gnuplot to draw a basic graph you can start reading up on how to read data in from a file. You could then write a bash script to parse the MSCX file to get the note statistics (using the grep commands I wrote in the previous post) output these to a text file. You then write a Gnuplot script to read in the new text file and draw a graph. It should also also possible to combine the Gnuplot script into the bash script, but that can be a bit tricky.