Changeset 2472:39fc3e4ab091 in roaraudio


Ignore:
Timestamp:
08/22/09 04:16:33 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added a lot debug lions, got the synth basicly to work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/ssynth.c

    r2471 r2472  
    114114  return 0; 
    115115 
     116 ROAR_DBG("ssynth_update(void) = ?"); 
     117 
    116118 if ( streams_get(g_ssynth.stream, &ss) == -1 ) { 
    117119  return -1; 
     
    123125 
    124126 needlen = ROAR_OUTPUT_CALC_OUTBUFSIZE(&(s->info)); 
     127 
     128 ROAR_DBG("ssynth_update(void): needlen=%lu", (unsigned long)needlen); 
    125129 
    126130 for (i = 0; i < SSYNTH_NOTES_MAX; i++) { 
    127131  if ( g_ssynth.notes[i].stage != SSYNTH_STAGE_UNUSED ) { 
     132   ROAR_DBG("ssynth_update(void): used note slot: %i", i); 
    128133   if ( g_ssynth.notes[i].buf == NULL ) { 
    129134    if ( roar_buffer_new(&buf, needlen) == -1 ) 
     
    153158 } 
    154159 
     160 ROAR_DBG("ssynth_update(void): found streams: %i", curin); 
     161 
    155162 if ( curin > 0 ) { 
    156163  if ( roar_buffer_new(&outbuf, needlen) == -1 ) 
     
    173180 } 
    174181 
     182 ROAR_DBG("ssynth_update(void) = 0"); 
    175183 return 0; 
    176184} 
     
    179187int ssynth_note_new(struct roar_note_octave * note, char vv) { 
    180188 int i; 
     189 
     190 ROAR_DBG("ssynth_note_new(note=%p, vv=%i) = ?", note, vv); 
    181191 
    182192 for (i = 0; i < SSYNTH_NOTES_MAX; i++) { 
     
    187197   roar_synth_init(&(g_ssynth.notes[i].synth), &(g_ssynth.notes[i].note), g_sa->rate); 
    188198   ssynth_note_set_stage(i, SSYNTH_STAGE_KEYSTROKE); 
     199   ROAR_DBG("ssynth_note_new(note=%p, vv=%i) = %i", note, vv, i); 
    189200   return i; 
    190201  } 
    191202 } 
    192203 
     204 ROAR_DBG("ssynth_note_new(note=%p, vv=%i) = -1", note, vv); 
    193205 return -1; 
    194206} 
     
    250262 
    251263int ssynth_note_on       (struct roar_note_octave * note, char vv) { 
     264 ROAR_DBG("ssynth_note_on(note=%p, vv=%i) = ?", note, vv); 
    252265 return ssynth_note_new(note, vv); 
    253266} 
     
    256269 int id; 
    257270 
     271 ROAR_DBG("ssynth_note_off(note=%p, vv=%i) = ?", note, vv); 
     272 
    258273 if ( (id = ssynth_note_find(note)) == -1 ) 
    259274  return -1; 
     
    267282 if ( !ssynth_conf.enable ) 
    268283  return -1; 
     284 
     285 ROAR_DBG("ssynth_eval_message(mes=%p) = ?", mes); 
    269286 
    270287 switch (mes->type) { 
     
    273290   break; 
    274291  case MIDI_TYPE_NOTE_ON: 
    275     return ssynth_note_off(&(mes->d.note), mes->vv); 
     292    return ssynth_note_on(&(mes->d.note), mes->vv); 
    276293   break; 
    277294  default: 
     
    280297 } 
    281298 
     299 ROAR_DBG("ssynth_eval_message(mes=%p) = -1", mes); 
    282300 return -1; 
    283301} 
Note: See TracChangeset for help on using the changeset viewer.