简体   繁体   中英

How do I encoding musescore in Music21?

在此处输入图像描述

在此处输入图像描述

from music21 import *

us = environment.UserSettings()
us["musicxmlPath"] = r"C:/Program Files/MuseScore 3/bin/MuseScore3.exe"
us["musescoreDirectPNGPath"] = r"C:/Program Files/MuseScore 3/bin/MuseScore3.exe"
.
.
.
xml_file_name = f'output_dance_{str(int(time.time()))}.musicxml'
xml_file_path = f'app/data/output_audio/{xml_file_name}'
midi_stream.write('musicxml', fp=xml_file_path)

When I make musicxml in music21, how can I encode musiccore instead of music21?

music21 did actually encode the output from scratch, so that's why it's listed in <software> , but if you wish to change it:

from music21 import *
beach_score = corpus.parse('beach')
beach_score.metadata.software = ['Musescore']

If .metadata doesn't return anything for your score, you may need to insert a metadata.Metadata object into the beginning of your score and manipulate that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM