summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-10-07 12:34:21 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2011-10-07 12:34:21 +0200
commite0d30c06949552671d95a6b75bd905d8162f72e7 (patch)
tree07f78371e14cc184016cd8e8cf9930eb0be9c6ca /src
parent6509ebfaea12f690af459ddc85416786e475684b (diff)
Remove debug output. Remove gain down-ramp on copy. It took up alot of CPU power and is already a part of the sample files.
Diffstat (limited to 'src')
-rw-r--r--src/drumgizmo.cc20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index 6982b28..b7b2841 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -102,13 +102,6 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
event_t *evs = ie->run(pos, nsamples, &nev);
for(size_t e = 0; e < nev; e++) {
- /*
- printf("Event: type: %d\tinstrument: %d\tvelocity: %f\toffset: %d\n",
- evs[e].type,
- evs[e].instrument,
- evs[e].velocity,
- evs[e].offset);
- */
if(evs[e].type == TYPE_ONSET) {
Instrument *i = NULL;
int d = evs[e].instrument;
@@ -143,7 +136,7 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
if(af == NULL) {
//printf("Missing AudioFile.\n");
} else {
- printf("Adding event %d.\n", evs[e].offset);
+ //printf("Adding event %d.\n", evs[e].offset);
Event *evt = new EventSample(ch.num, 1.0, af);
evt->offset = evs[e].offset + pos;
activeevents[ch.num].push_back(evt);
@@ -212,7 +205,7 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t *s, size_t sz)
EventSample *evt = (EventSample *)event;
AudioFile *af = evt->file;
af->load(); // Make sure it is loaded.
- // printf("playing: %s (%d)\n", af->filename.c_str(), sz);
+
for(size_t n = 0; n < sz; n++) {
if(evt->offset > (pos + n)) continue;
@@ -221,11 +214,12 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t *s, size_t sz)
removeevent = true;
break;
}
-
- float gain = evt->gain;
- gain *= 1.0 - ((float)evt->t / (float)af->size);
+
+ //float gain = evt->gain;
+ //gain *= 1.0 - ((float)evt->t / (float)af->size);
sample_t val = af->data[evt->t];
- s[n] += val * gain;
+ s[n] += val;// * gain;
+
evt->t++;
}
}