Mercurial > hg > midi-score-follower
view jnmr/CannamMidiFileLoader.h @ 34:9d2a651a87b2
autoomatically set prior that matches the durations of the songs. Using 120 bpm as default for the recorded part.
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Wed, 14 Dec 2011 11:35:31 +0000 |
parents | fa527df85c2c |
children | 6cd3e0075adf |
line wrap: on
line source
/* * CannamMidiFileLoader.h * midi-score-follower * * Created by Chris Cannam on 19/08/2011. * Copyright 2011 QMUL. All rights reserved. * */ #ifndef CANNAM_MIDI_FILE_LOADER #define CANNAM_MIDI_FILE_LOADER #include "MIDIFileReader.h" //#include "MIDIEvent.h" #include "midiEventHolder.h" using namespace MIDIConstants; class CannamMidiFileLoader{ public: CannamMidiFileLoader(); typedef std::vector<double> DoubleVector; int loadFile(std::string& filename, midiEventHolder& myMidiEvents); void createEventTiming( midiEventHolder& myMidiEvents); void setTempoFromMidiValue(long tempo, midiEventHolder& myMidiEvents); double firstNoteTime; int firstTickTime; bool chopBeginning; void chopBeginningfromEvents(midiEventHolder& myMidiEvents); typedef std::vector<int> IntVector; IntVector v; int noteOnIndex; int ticksPerMeasure; void newTimeSignature(int ticks, int numerator, int denominator, midiEventHolder& myMidiEvents); void updateMeasureToTickPosition(int ticks, midiEventHolder& myMidiEvents); bool printMidiInfo; void printMeasuresSoFar(midiEventHolder& myMidiEvents); void correctMeasuresTiming(midiEventHolder& myMidiEvents); double fileDuration; }; #endif