diff options
| author | Tim Redfern <tim@gray.(none)> | 2012-11-02 17:19:17 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@gray.(none)> | 2012-11-02 17:19:17 +0000 |
| commit | 2ea0f60bb2ca981ff1e72575dd92c4ab906fd1c7 (patch) | |
| tree | 559b3a70c0f378e30bc641e134304a77191dcc1b /vfg/src/music.h | |
| parent | a0eff6b1806e7a99edde8714fbb4f3330fc87a61 (diff) | |
syncing and drawing notes
Diffstat (limited to 'vfg/src/music.h')
| -rwxr-xr-x | vfg/src/music.h | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/vfg/src/music.h b/vfg/src/music.h index 145538e..ecec8f2 100755 --- a/vfg/src/music.h +++ b/vfg/src/music.h @@ -4,52 +4,59 @@ #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?
+ int updown; //-1 0 1 used for 3-button interaction
};
-
+//---------------------------------------------------------------------------------------------------------------------------------------------
class score {
- //implements basics of timelime, loading from xml, time, checking
+ //basics of timelime
public:
-
+ long startTime;
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:
+ musicscore();
void parseMidi(string filename);
+ void setTimeframe(int millis);
+ void draw();
private:
map<int,note*> notes;
+ int timeframe;
+ ofImage flake;
};
-
+//---------------------------------------------------------------------------------------------------------------------------------------------
class song {
public:
song(string backfile,string melfile,string musfile);
+ void play();
+ void stop();
+ void preRoll(long preroll);
+ void setTimeframe(int millis);
+ void draw();
+ bool isPlaying;
private:
ofSoundPlayer backing;
ofSoundPlayer melody;
lyricscore lyrics;
musicscore notes;
- int bpm;
+ long startTime;
+ bool isPreroll;
};
-
+//---------------------------------------------------------------------------------------------------------------------------------------------
|
