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
0
votes
1 answer

Analyze just Pretty_Midi Instruments

Trying to figure out a good way of solving this problem but wanted to ask for the best way of doing this. In my project, I am looking at multiple instrument note pairs for a neural network. The only problem is that there are multiple instruments…
0
votes
1 answer

How can I get all piano parts from a music21 score?

I'm able to get all the parts in a music21.stream.Score, using s = music21.stream.Score() s.getElementsByClass(music21.instrument.Instrument) or music21.instrument.partitionByInstrument(s) But I cannot find a way to check whether each Part is…
stwykd
  • 2,684
  • 3
  • 19
  • 20
0
votes
1 answer

Music21 to get sample of time and frequencies in txt or csv

I'm getting familiar with python but I just discovered music21 and even if I'm currently reading as much as possible from the documentation, I'm having a hard time finding simple answer to my simple question: How to sample a piece of music (say…
Etsaf
  • 167
  • 7
0
votes
1 answer

How to display musical notation using music21 in ipython/python with MuseScore WITHOUT MuseScore re-opening every time .show() is called?

I am using music21 with MuseScore in an ipython notebook. It works well, the only problem is that every time I create a Stream and then run my_stream.show(), it takes a forever because it waits to open the MuseScore application. This happens even if…
Jeff
  • 11
  • 1
  • 2
0
votes
2 answers

How to get midi track instrument name with python?

The only way to do it I found is to use music21: m = converter.parse(path) for m in m.parts: print(m[0]) but it's output is incorrect: Piano Piano empty places is also an instrument names, it just can't read it, but problem is not in file,…
user7745819
  • 15
  • 1
  • 4
0
votes
1 answer

Make a pandas series by running a function on all adjacent values

I have a pandas series, s1, and I want to make a new series, s2, by applying a function that takes two inputs to create one new value. This function would be applied to a 2-value window on s1. The resulting series, s2, should have one fewer value…
Alex
  • 2,154
  • 3
  • 26
  • 49
-1
votes
1 answer

Identify Simultaneous Notes in Different Streams

I'd like to determine when notes from two different parts/instruments should be played at the same moment. Take the above sheet music. In the third measure, the treble clef's accented A and the bass clef's B should be played in unison. How can I…
Derek
  • 97
  • 8
1 2 3
10
11