From e0d30c06949552671d95a6b75bd905d8162f72e7 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 7 Oct 2011 12:34:21 +0200 Subject: 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. --- src/drumgizmo.cc | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/drumgizmo.cc') 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++; } } -- cgit v1.2.3