Skip to content

syberen/pitch-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pitch Extractor

A python module for extracting pitch datasets from midi files.

Usage

Load a midi file and get list of pitches:

from extractor import PitchExtractor

pxt = PitchExtractor('midi_samples/twinkle.mid')

pxt.get_pitches() # [60, 60, 67, 67, 69, 69, 67, 65, 65, 64, 64, 62, 62, 60]

To get a list of notes instead of notes instead of midi values use

pxt.get_pitches(note_names=True) # ['C5', 'C5', 'G5', 'G5', 'A5', 'A5', 'G5', 'F5', 'F5', 'E5', 'E5', 'D5', 'D5', 'C5']

Check whether the loaded midi file has format 0, 1 or 2:

pxt.get_file_format() # 0

About

A python module for extracting pitch datasets from midi files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages