Python Musescore tutorial ?

• Feb 15, 2023 - 05:19

Hi,
Is there a msc group or tutorial etc about Python midi musescore topics?
For a composer, musicologist etc. it is great interest that MIT s music21 is a python programming language library that works with musescore. In other words it is claimed that objects ig. masterpieces like Bach s well tempered piano maybe programmed with ease with some fundamental knowledge of music theory and the Python language. Is there a discussion group devoted to the issues or an expert here that has introductions to the subjects other than existing utubes from third parties? Any beginners information welcome.


Comments

Although music21 has the facility to automatically open MuseScore to display a MusicXMl file that it creates, there is no special connection between the two systems. In particular, there is no way to actually use python with MuseScore. Plugins are written in QML.

In reply to by Gandharv

Yu mean, how to install a plugin someone else wrote? it's very simple:

1) download the plugin to your Documents/MuseScore4/Plugins folder
2) if it came as a zip file, unzip it
3) In MuseScore, go to Plugins / Manage plugins
4) select the plugin and click "Enable"

Now you can run it directly from the Plugins menu.

In reply to by Marc Sabatella

Thank you, there are some pdf s from the makers of music21
https://www.academia.edu/243058/music21_A_Toolkit_for_Computer_Aided_Mu…
and others there.
In the ct 2 2023 PC magazine in german : “Programming Composing” some workfiles were included
ct.de/ypxg
https://www.heise.de/select/ct/2023/2/softlinks/ypxg?wt_mc=pred.red.ct…

My question is may they be installed in msc 4 the same way as plugins you described or do these Python files open in msc by another interface?

In reply to by Gandharv

As I explained previously, MuseScore has no relationship whatsoever to music21 aside from the automatic opening of the program. Python scripts created for use with music21 are only usable in music21, not within MuseScore. And plugins created for MuseScore can only be used in MuseScore, not in music21. Again, you can pretty much forget python even exists when it comes to using MuseScore; it just won't be of any use at all. It's of great use with music21 of course, but not with MuseScore.

In reply to by Marc Sabatella

Marc, I wished I could agree with you that easily but science itself seems different.
In music21 there are python functions like cycle of fifths, chords etc. to try to construct themes like a well tempered piano according to one s own understanding. But in reality the tuning of Bachs piano was kept a secret by him, an advanced science at his time. I am pretty unsure how one handles such complex issues like tunings in music21, that is ig. greek and other modes? Transfering the preset python results to musescore one can via msc add ons as you described in detail or manually by msc inspecteur correct the tunings cent by cent and phps achieve the effects of the original composer much better to one s own understanding or prescribed literature. As a musicologists I believe at the moment both sw platforms need it each other to advance in AI matters. I hope to understand this topic better in the future. Next to it I think it is needed to put better Vocaloids, virtual singers, choirs into msc to get clear voices to the text of a score.

In reply to by Gandharv

Hmm, I'm not sure what you are disagreeing with. I am not saying music21 isn't a great tool - it is. I am not saying Python isn't a useful programming language - it is. And I am not saying there is no room for improvement in any area of MuseScore - there is. I am simply pointing out the fact that MuseScore does not support the use of Ppython scripts. It just doesn't. There is nothing within MuseScore capable of using Python in any way. If you're interested in creating plugins for MuseScore, you will need to learn QML (

MuseScore does support alternate tunings, and there are plugins to help automate this - but again, these are not written not in Python, but in QML (which basically means, in JavaScript).

A virtual singer would be possible to create, but not via the plugin framework. You'd probably have to actually build it in MuseScore using C++, although it's possible the new MPE interface would allow for alternatives in the future.

In reply to by Marc Sabatella

Hello Marc and Gandharv. I have published 100+ compositions with virtual singers on my MuseScore page.
https://musescore.com/user/27069844
I use a workaround but it work fine for me and means you do not need to master a programming language!

(1) I write the piece on MuseScore with a top staff as voice for melody and lyrics
(2) I mute the top staff and then export the rest as a .wav file e.g. the backing track
(3) I open VOCALOID5 and import the .wav file and add several VOCALOID tracks for lead and backing singers
(4) After fine-tuning singers (Cyber Songman II + Cyber Diva II) and notes I export the result as a new .wav file
(5) I combine the exported .wav file plus a cover page file (image + composer name) into a .mp4 video
(6) I then upload the video to my YouTube site and note the link (URL)
(7) I publish my original .mscz score as usual on MuseScore then I click on "manage audio source"
(8) Here I add the link to the YouTube video and check the "Default Video" and "Audio Only" boxes

In case the above steps are not clear I attach a .PDF I made because I get asked to often by followers how the vocal(oid)s are done!

Normally the last step would be to access the pull-down menu last item on right and click on "synch" so that the YT-video and the MS score are fully and automatically synched. Unfortunately since a couple of weeks this menu option has disappeared!! It was so simple and really accurate!!

This means I have to use "M" for marker and mark the first beat of each individual measure which works but is hard work! I have posted this as a bug to the MS-team.

Hope this helps you Gandharv
- even if only as a temporary solution until you have programmed something better. VOCALOID5 is a programme from Yamaha (cost approx. US$300) which comes with 2 standard voice banks e.g. one male and one female singer that you can fine-tune. You enter the notes via a keyboard and then simply type in the lyrics and it splits them into syllables across the notes. I have spent 3 years learning how to fine-tune the voices because my aim is not to produce the typical 'robot on steroids' voice that many of the VOCALOID-fans love but to make my voices as human and as realistic as possible. Steep learning curve!!

BTW Marc
MuseScore is a brilliant programme with immense depth and breadth allowing one to really compose music effectively and efficiently. It has certainly changed my life since starting to use it about 3 years ago. It also has very comprehensive support pages and information plus the great book by you Marc that lies permanently next to my laptop. CONGRATULATIONS to you and the whole MuseScore-team!!!

Attachment Size
Use Video File with a MuseScore Score.pdf 685.06 KB

In reply to by SteveHaite

Steve, thank you for your detailed analysis, much appreciated. But in regard to pop music I would think a perfection could be if a song like this utube that can be selfproduced.
https://www.youtube.com/watch?v=Gul3xupPlXg
This is a bollywood film self designed in Second Life, the song is copyrighted I guess.
If Vocaloids etc. can one day produce a real sounding song to a scene without fear of transgressing copyrights I think its worthwhile the effort. Cheers

In reply to by Gandharv

Hmm, I'm not an expert in Hindustani music, so maybe I'm missing some subtlety that you are picking up on, but I'm not hearing anything in that recording that any reasonably competent singer in that genre couldn't do. Is there a particular point in the video where there is a specific sound you are concerned with? I've worked with quite a few musicians in this style myself, and am familiar with the training methods used; this doesn't seem outside the norms. But, if there is some sort of detail that would in fact be difficult for other singers to reproduce, it's probably also the case that it would be difficult to program a synthesized voice to reproduce that exact same detail. And it would probably be far easier, and sound more natural, to take a recording of human voice and process it to add the necessary inflection, than to recreate the entire performance from scratch.

In reply to by Marc Sabatella

Marc, sorry to have caused that lot of confusion. My site is at
https://www.youtube.com/watch?v=90xkY1zC1sU&t=1s
and Steve had offered me to add a score with vocalized ancient notes, it is all about the quality of them. If one can sample natural voices too, that would be an appreciated alternative.

I am looking towards music from the beginning of time, might see things a little different. But fact is 12. cent AD Saranga Dev wrote a music scripture ( Sangita Ratnakara, SR)) based mainly on 5. cent BC Dance scripture (Bharat s Natya Shastra, NS) that incooperated most of what was known till then. A matter for musicologists. SR has 7 chapters, the last is devoted to the dance play firmely attached to the philosophy, religion and scores collected by the author in the previous chapters.

My take on the popular bollywood movie Ghoomar was that Strawberry Singh of Second Life TM showed how this dance action could be managed in Machinima language. I do not know how she did it, but nobody did it better as her. In the meantime there are methods like motion cap, that costly films or scans physical dancers and transpose into the 3D virtual world.

The underlying music was taken from recordings like Shreya Goshal, famous Bengali singer, recordings which are all copyrighted. So I thought, next to Archaeology phps one day one could be able by easy means to record a utube of dancing acc. to SR chapt. 7 and music of the same without copyright limitations. I have no idea how long that will take me, if ever.

Steve kindly offered me to translate the oldests score into vocaloid syllables, so I sent him a self reconstructed melody of one of the scores, of 11 strings to try out if we get clear sung note voices like from the Sa Ri Ga Ma Guru of ytube and put them with text into the score for further manipulations. The result would be that we can listen to the SR provided ancient scores in good sounding Sa Ri Ga Ma s, to get a better idea. Since this never had been done before recently it would be quite a challenge.

Another, further steps is that these simple scores were used by SR or before in a way that corresponds to modern algorithmic composing. I think the best melodic results were kept and the rest, less harmonious were disregarded, This is what I can get from the SR, which again no other scholars sofar has taken at length to investigate in experiment. If we succeed, and it might take some unspecified time until we are through with. Since there are according to SR gramas, shruties, svaras, yatis etc. to master before we reach firm ground, maybe with or without programming who knows, anyhow it is more than a simple cycle of fiths, microtones or subscription to a guru. Now and then were discussed some random topics on academic.edu platform free to anyone, Unfortunately when the topic is closed these discussions are ended and lost. I am of old age and hope to get some of the research results before I manage to leave the stage. The comments to Steve are valid to anyone interested so are the workshop links mentioned at the beginning.
Cheers

In reply to by Gandharv

Hi Gandharv. Thanks for the suggestion. I like a musical challenge! I just spent a year researching reggae(ton) on the web and learning everything I could about that genre and my MuseScore set "Feeling the Heat" has several songs in the reggae genre.

I will look into Bollywood and see what I can do with MuseScore + VOCALOID5 and maybe come up with the next big Bollywood hit?! : -) :-) If it does work out I will dedicate the first song to you!!

In reply to by SteveHaite

Hi Steve,
Re Bollywood you need score of Sa,Ri,Ga,Mas
adding a comment to:
https://youtu.be/-yUENqj56RY
Sa Ri Ga Ma Pa Dha Ni ( do re mi fa…)
The octave order Sa as C4 to C5 is in usage since the middle ages only, before for millennia it was normal as Sa , the peacocks cry from C5 to C4, that is Madhya Sa was C5, madya Ri was B4 to Mandra Sa was C4.
The Yati Sadji (aka Parent Group) of 11 strings is probably a remembrance on the times of King Droupad of ca. 2800 - 2500 BC at Ur, Mesopotamia. The famous 11 stringed Queen harp now at the British Museum might be a testimony to this. Discussion will follow at academia.edu website where I also learned about music21.

I think it might be easiest to Vocaloid the Ma and Ni, Amen Notes first, then Ri, then the three consonants ( probably from Egypt) that is Ga, Dha and Pa and then Sa? Once they have been mastered they may be used for thousands of algorithmic compositions thoughout the ages. To me the sarigams were a first alphabet usef for notes tuned to the 22 fixed shruti pitches.

Another suggestion for vocaloids would be: take the rock opera Tommy by the Who in it s musescore edition by
an experienced user
https://musescore.com/user/33457131/sets/5109304
and vocaloid it.
How much could vocaloid change if the lettering was big and a clear singing voice was added?
Cheers

In reply to by msfp

re: ABC Import/Export
ig. it is written at
https://abcnotation.com/
• tunes from many cultures - a large proportion from Irish, Scottish & other Celtic sources, with plenty of music from America, England, France, Scandinavia & all over Europe and even a sizeable collection of Chinese music
May I ask:
Indian tunes is missing, but in SR
https://kupdf.net/download/sarngadeva-sangita-ratnakara-vol01_5906eabed…
we have tons of tunes in shruti svara notation. That is 1,2,3…from Sa,Ri,Ga,Ma easily converted into ABC…and mxml score which later correspond to rhythm, sentiment and dance expression. How does one go about?

In reply to by msfp

thanks, one can indeed manually add notes from SR notation like here
https://www.youtube.com/watch?v=5hEgJfH3foI
and finish it later by adding more components, AI etc.

but when you have 300 pieces to do and no time,
you need some method of dictation. Say, you read a score into
a software speech converter: Sa, Ri, Ni,Sa,Ga…etc. about 100 characters usually.
Each syllable has a fixed note in cents (shruti svara, about 12 varieties). The output should be the score in singing as midi, msc file etc, to be added various tempos, instruments etc.

SR (Sangita Ratnakara) in the above sample is only the first chapter in English pdf, the seventh chapter on how dance movements are connencted to the notes is hardly studied yet and needs extra explanation, ig.here a beautiful artistic AI sample as different from exact re-construction of ancient text and philosophy
https://www.youtube.com/watch?v=wb5iwfu5ziQ

Do you still have an unanswered question? Please log in first to post your question.