summaryrefslogtreecommitdiff
path: root/src/instrument.h
diff options
context:
space:
mode:
authordeva <deva>2011-03-01 19:19:02 +0000
committerdeva <deva>2011-03-01 19:19:02 +0000
commite190d38057892b69246391841b234a368bc2b4ad (patch)
tree34f946bc1c3b86997d4cd45e63c433ef07b36486 /src/instrument.h
parentc393edc920f8ee126d1bced3500b6bc1ecf86f83 (diff)
MAJOR rewrite of the internals. New input/output 'plugin' system. Still a lot missing.
Diffstat (limited to 'src/instrument.h')
-rw-r--r--src/instrument.h59
1 files changed, 47 insertions, 12 deletions
diff --git a/src/instrument.h b/src/instrument.h
index 96fc6ba..b01379f 100644
--- a/src/instrument.h
+++ b/src/instrument.h
@@ -30,25 +30,60 @@
#include <string>
#include <vector>
-#include <jack/jack.h>
-
-#include "velocity.h"
+#include "rangemap.h"
+#include "sample.h"
class Instrument {
public:
- Instrument(std::string name, unsigned int midimap);
-
- void addVelocity(Velocity *velocity);
- Velocity *getVelocity(unsigned int velocity);
+ Instrument(std::string name);
- std::string name;
- unsigned int midimap;
+ Sample *sample(level_t level);
- jack_port_t *port;
+ void addSample(level_t a, level_t b, Sample *s);
private:
- typedef std::vector< Velocity * > Velocities;
- Velocities velocities;
+ std::string name;
+ RangeMap<level_t, Sample*> samples;
};
+typedef std::map< std::string, Instrument > Instruments;
+
+/*
+ * <?xml version='1.0' encoding='UTF-8'?>
+ * <instrument name="kick-r">
+ * <samples>
+ * <sample name="kick-r-1">
+ * <audiofile channel="Alesis-3" file="samples/1-kick-r-Alesis-3.wav"/>
+ * <audiofile channel="Amb L-3" file="samples/1-kick-r-Amb L-3.wav"/>
+ * <audiofile channel="Amb R-3" file="samples/1-kick-r-Amb R-3.wav"/>
+ * <audiofile channel="Kick L-3" file="samples/1-kick-r-Kick L-3.wav"/>
+ * <audiofile channel="Kick R-3" file="samples/1-kick-r-Kick R-3.wav"/>
+ * </sample>
+ * <sample name="kick-r-2">
+ * <audiofile channel="Alesis-3" file="samples/2-kick-r-Alesis-3.wav"/>
+ * <audiofile channel="Amb L-3" file="samples/2-kick-r-Amb L-3.wav"/>
+ * <audiofile channel="Amb R-3" file="samples/2-kick-r-Amb R-3.wav"/>
+ * <audiofile channel="Kick L-3" file="samples/2-kick-r-Kick L-3.wav"/>
+ * <audiofile channel="Kick R-3" file="samples/2-kick-r-Kick R-3.wav"/>
+ * </sample>
+ * <sample name="kick-r-3">
+ * <audiofile channel="Alesis-3" file="samples/3-kick-r-Alesis-3.wav"/>
+ * <audiofile channel="Amb L-3" file="samples/3-kick-r-Amb L-3.wav"/>
+ * <audiofile channel="Amb R-3" file="samples/3-kick-r-Amb R-3.wav"/>
+ * <audiofile channel="Kick L-3" file="samples/3-kick-r-Kick L-3.wav"/>
+ * <audiofile channel="Kick R-3" file="samples/3-kick-r-Kick R-3.wav"/>
+ * </sample>
+ * </samples>
+ * <velocities>
+ * <velocity lower="0" upper="99">
+ * <sampleref name="kick-r-1"/>
+ * <sampleref name="kick-r-2"/>
+ * </velocity>
+ * <velocity lower="100" upper="127">
+ * <sampleref name="kick-r-3"/>
+ * </velocity>
+ * </velocities>
+ * </instrument>
+ */
+
#endif/*__DRUMGIZMO_INSTRUMENT_H__*/