summaryrefslogtreecommitdiff
path: root/vfg/src/music.h
blob: 145538e670b56588e09b53c5559adb4cbf77f323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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;
};