Mercurial > hg > midi-score-follower
view hackday/CannamMidiFileLoader.h @ 36:5a1b0c6fa1fb
Added class to read in the csv Annotation file, then write out the respective difference between the performed piece as followed here, and the annotation of RWC by Ewert and Muller
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Thu, 15 Dec 2011 02:28:49 +0000 |
parents | 9a70d9abdc8b |
children |
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; 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); }; #endif