Skip to main content
6 votes
Accepted

How does the analyze function work by taking 'key' in music21 library(python)? From a passed midi file, how can it determine the key and mode?

If you just were spend a little bit of effort reading the documentations you’d see that music21 uses the Krumhansl-Schmuckler algorithm for key detection with the Krumhansl-Kessler weights. Basically ...
Lazy's user avatar
  • 21.1k
4 votes

Duration of a MIDI file by parsing it and making a stream of parsed notes and chords do not playback the same length music. What is the problem here?

MIDI files almost always use time units based on quarter notes, not time units based on seconds. MIDI file software uses the tempo events in a MIDI file to convert the quarter-note-based time units ...
Bavi_H's user avatar
  • 409
2 votes

If I have a combination of pitches played as a chord in a MIDI, how do I extract only two pitches from it and get somewhat similar tone?

Assuming you mean to do this by a computer program... You could invert the tones so they are a tertian stack then take the root and third. You could invert to a tertian stack, take the root, and then ...
Michael Curtis's user avatar
1 vote

If I have a combination of pitches played as a chord in a MIDI, how do I extract only two pitches from it and get somewhat similar tone?

One way to go about this would be to consider an approximate harmonic spectrum for your instrument and use this to estimate the harmonic spectrum for your chord. Then try to find two (or more ...
Lazy's user avatar
  • 21.1k
1 vote

In a piano midi file what all parameters(like time signature, duration etc) define how long a note or a chord is held pressed on the keyboard?

The main thing you should look for is note-on and note-off messages, and timestamps, i.e. when a particular note-on or note-off is to be performed. Timestamps are of different kinds (absolute, ...
MMazzon's user avatar
  • 6,349

Only top scored, non community-wiki answers of a minimum length are eligible