[Python] How Do I use Music21 in conjunction with Musescore4 to Generate MP3 files?

Discussão em 'Python' iniciado por Stack, Agosto 10, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to use Music21 and Musescore4 - I also tried V3 - to programmatically generate MP3 sounds of all the chords and scales. This seems like it should be doable.

    I can get Music21 to use Musescore to generate PNGs successfully. I can also go into Musescore with a musicxml file and generate an MP3 successfully, but when trying to have Music21 generate an mp3, it silently fails and only generates the musicxml file.

    # Does not work both with .mp3/.wav added to output path or without
    # Also doesn't work if I just put .mp3/.wav alone without musicxml
    score.write("musicxml.mp3", "outputpath")
    score.write("musicxml.wav", "outputpath")

    # Works for png
    score.write("musicxml.png", "outputpath")


    I looked for any information on how to do this in the documentation and came up with nothing. What am I missing here if this is doable?

    Continue reading...

Compartilhe esta Página