Mercurial > hg > midi-score-follower
view jnmr/MidiInputStream.h @ 35:6cd3e0075adf
now writing out alignment data - correct beat positions for the MIDI file so alignment can be done via iostream over RWV database
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Wed, 14 Dec 2011 17:28:17 +0000 |
parents | 9d2a651a87b2 |
children |
line wrap: on
line source
/* * MidiInputStream.h * MuseScoreMidiFollower * * Created by Andrew on 03/12/2011. * Copyright 2011 QMUL. All rights reserved. * */ #ifndef MIDI_INPUT_STREAM #define MIDI_INPUT_STREAM #include "ofMain.h" #include "ofxMidi.h" #include "midiEventHolder.h" //WOULD BE GOOD TO USE STD CONSTANTS here //#include "MIDIFileReader.h" //using namespace MIDIConstants; class MidiInputStream{ public: MidiInputStream(); bool noteInReceived(ofxMidiEventArgs &args); void reset(); void printNotes(); int endNote(int notePitch); typedef std::vector<int> IntVector; typedef std::vector<IntVector> IntMatrix; typedef std::vector<double> DoubleVector; DoubleVector eventTimesForNote; double calculateTotalScore(midiEventHolder& midiEvents); IntMatrix midiInputEvents; DoubleVector midiInputTimes; IntVector v; IntVector totalNotesRecievedByPitch; void newNoteCounted(const int& pitch); void printTotalCount(); double* startTime; midiEventHolder* eventHolder; int* transposeVal; double* factor; void printUpToIndex(const int& index, midiEventHolder& midiEvents); }; #endif