Questions tagged [music21]

A toolkit for computer-aided musicology

A python library developed at MIT for helping answer questions about music files. Full documentation here

157 questions
2
votes
1 answer

How to set application path in music21

I'm using Ubuntu 14.04 64bit. I don't know what to set on path to application. I have installed music21 in anaconda3, but I got output as follows: music21.converter.subConverters.SubConverterException: Cannot find a valid application path for…
Július Marko
  • 1,196
  • 5
  • 15
  • 37
2
votes
1 answer

music21 how to create an element.lyric even if there's no note or element at that offset (create an invisible element?)

How can I have lyrics at regular intervals even if there is no corresponding element at that offset in the score? I need to do: myElement.lyric = 'bla bla' Can I create invisible elements?
Nick463
  • 225
  • 2
  • 11
2
votes
1 answer

Why is music21 using pitch attributes in an unexpected way?

Consider the following testing code. from music21 import pitch C0 = 16.35 for f in [261, 130, 653, 64, 865]: p = pitch.Pitch() p.frequency = f # Compare manual frequency with music21 frequency f1 = p.frequency f2 = C0 * pow(2,…
chtenb
  • 14,924
  • 14
  • 78
  • 116
2
votes
1 answer

Getting parts from a kern score with music21 (python) - why doesn't it find the parts?

I have parsed a collection of krn files with music21 and they all consist of a number of parts. I want to remix the parts and save them as a different file. However, for a few of the kern files music21 says that is has 0 parts: >>> s =…
dorien
  • 5,265
  • 10
  • 57
  • 116
2
votes
1 answer

Showing midi pitch numbers from Mid file with music21

I am using music21 to extract the midi pitch numbers (in order) for a bunch of midi files. I have been reading through the documentation and I can load one file like this: from music21 import * sBach = corpus.parse('bach/bwv7.7') Now how do I…
dorien
  • 5,265
  • 10
  • 57
  • 116
1
vote
1 answer

music21: get keys of midi file?

I'm trying to analyze a midi file with music21 to get the keys of that file. Does anyone know the command for that or where to find an example for this? I'm new to this. Thank you a lot in advance.
1
vote
1 answer

Music21 - cannot display rests

I'm cutting up sections of sheet music into snippets on the beat. I'm using music21 and LilyPond to convert the output into a png. There's a very specific issue though where I get no display of a snippet only containing a rest. If the rest is being…
1990brien
  • 13
  • 1
  • 3
1
vote
1 answer

Music21 output to Vexflow

From what I understand in the docs/code, Music21 output to Vexflow seems to be done through Music21j, which I find myself unable to get running. Isn't there an actual Vexflow output possible? So, instead of getting something like this (output of…
fr.jurado
  • 11
  • 1
1
vote
1 answer

Music21 merge midi/merge instruments

I'm currently working on a project that has some midi processing. For my processing I needed to separate percussive instruments from pitched ones. After I did my processing (transposing the pitched instruments to another key) I need to merge the two…
Eva K.
  • 189
  • 7
1
vote
0 answers

Convert MusicXML to MIDI in browser using music21j

I'm trying to load music21j in the browser (successful), and then convert an uncompressed MusicXML string into a MIDI file using the converter (not successful).