Enhanced possible debugging output.
authorStefan Westerfeld <stefan@space.twc.de>
Wed, 26 May 2010 13:30:45 +0000 (15:30 +0200)
committerStefan Westerfeld <stefan@space.twc.de>
Wed, 26 May 2010 13:30:45 +0000 (15:30 +0200)
src/jacksampler.cc
src/jacksampler.hh

index 5d51ba6..40bbdd8 100644 (file)
@@ -153,7 +153,11 @@ JackSampler::process (jack_nframes_t nframes)
                         }
                     }
                   if (voices[v].sample) /* only switch to on if a sample was found */
-                    voices[v].state = Voice::ON;
+                    {
+                      voices[v].state = Voice::ON;
+                      //printf ("sample=%s\n", voices[v].sample->file_name.c_str());
+                      //printf ("stepping=%f\n", voices[v].frequency / voices[v].sample->osc_freq * voices[v].sample->mix_freq / jack_mix_freq);
+                    }
                 }
               else
                 {
@@ -162,7 +166,7 @@ JackSampler::process (jack_nframes_t nframes)
             }
           else if (isNoteOff (in_event))
             {
-              /* note on */
+              /* note off */
               //printf ("note off %d\n", in_event.buffer[1]);
 
               for (int v = 0; v < voices.size(); v++)
@@ -307,6 +311,7 @@ JackSampler::load_note (const Options& options, int note, const char *file_name,
   s.mix_freq = gsl_data_handle_mix_freq (dhandle);
   s.osc_freq = freqFromNote (note);
   s.instrument = instrument;
+  s.file_name = file_name;
   samples.push_back (s);
 }
 
index 52302f1..063f782 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <jack/jack.h>
 #include <vector>
+#include <string>
 #include "main.hh"
 
 struct Sample
@@ -30,6 +31,7 @@ struct Sample
   double             osc_freq;
   std::vector<float> pcm_data;
   int                instrument;
+  std::string        file_name;
 };
 
 struct Voice