Skip to content

CharlesGillingham/MusicToolsForNupic

Repository files navigation

MusicToolsForNupic

Dependecies

This depends on github/olemb/mido

VelocityData

Use from MIDIVelocityData import *

LoadVelocityDataFromMIDIFile ( fileName ) read the MIDI file fileName and return a numpy array d = [length of piece in ticks X MIDI.Note_Count] where:

If note n is playing at time t, then d[t,n] is the velocity used when the note began.

If note n is not playing at time t, then d[t,n] is zero.

A note n begins at time t if d[t,n] > d[t-1,n]

A note n ends at time t if d[t-1,n] > 0 and d[t,n] = 0

This is the "piano roll" representation of a musical piece.

SaveVelocityDataToMIDIFile ( data, fileName ) creates a MIDI file using the data.

Music

Contains constants describing notes, octaves and pitch classes, and these utility functions:

Music.pitchClass ( note )

Music.octave ( note )

Music.noteFromOctaveAndPitchClass ( octave, pitchClass )

Music.pitchInHz ( note )

Music,noteName ( note )

Music.intervalClassicalConsonance ( note1, note2 ) Consonance as it is taught to elementary music theory students, with four possible values: Music.dissonance, Music.consonant, Music.perfectConsonance, Music.unison

MIDI

Contains constants from the general MIDI standard for messages, notes, controllers and so on.

About

Tools for the 2015 Hackathon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages