summaryrefslogtreecommitdiff
path: root/vfg/src/music.h
diff options
context:
space:
mode:
authorTim Redfern <tim@gray.(none)>2012-11-01 21:10:31 +0000
committerTim Redfern <tim@gray.(none)>2012-11-01 21:10:31 +0000
commitc31a609399c2e05a50a5df8be10049903521c9e7 (patch)
tree246c2c9a67ad0fc8b7473006d0763ab8bbf22675 /vfg/src/music.h
initial commit
Diffstat (limited to 'vfg/src/music.h')
-rwxr-xr-xvfg/src/music.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/vfg/src/music.h b/vfg/src/music.h
new file mode 100755
index 0000000..145538e
--- /dev/null
+++ b/vfg/src/music.h
@@ -0,0 +1,55 @@
+#pragma once
+
+#include "ofMain.h"
+#include "ofxXmlSettings.h"
+
+//event times are absolute integer milliseconds
+
+class note {
+ public:
+ note(int n,int v,int d=0);
+ int num;
+ int velocity;
+ int duration; //may be needed another time?
+};
+
+class score {
+ //implements basics of timelime, loading from xml, time, checking
+ public:
+
+ protected:
+ ofxXmlSettings XML;
+};
+
+class lyricscore: public score {
+ //draws lyrics to screen for a certain time
+ public:
+};
+
+class musicscore: public score {
+ //draws notes to screen for a certain time and certain parameters, checks when they become ready
+ //how will it be played dictates how the data is stored
+ //play : start from beginning, schedule event at next delta
+ //end : clean up and start again
+ //you can set position of sound file, it will seek. will we want ffwd at any stage
+ //when it comes to drawing, we will want to repeatedly retrieve notes in a range of times
+ //lower_bound and upper_bound
+ public:
+ void parseMidi(string filename);
+ private:
+ map<int,note*> notes;
+};
+
+class song {
+ public:
+ song(string backfile,string melfile,string musfile);
+ private:
+ ofSoundPlayer backing;
+ ofSoundPlayer melody;
+ lyricscore lyrics;
+ musicscore notes;
+ int bpm;
+};
+
+
+