diff options
| author | pepper <peppersclothescult@gmail.com> | 2015-01-29 17:06:43 -0800 |
|---|---|---|
| committer | pepper <peppersclothescult@gmail.com> | 2015-01-29 17:06:43 -0800 |
| commit | c6cdb37aa52eaa0a3a59e627c9ca6abec3d8561f (patch) | |
| tree | 0fd6c3b6e20b8c9b91120407808fa51b4ac66f78 /src/ladspa_run_synth.c | |
| parent | b1c372a55ca844878b358957c92fdbb63e1228b9 (diff) | |
cleanup
Diffstat (limited to 'src/ladspa_run_synth.c')
| -rw-r--r-- | src/ladspa_run_synth.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/ladspa_run_synth.c b/src/ladspa_run_synth.c index 1675cb7..17f7265 100644 --- a/src/ladspa_run_synth.c +++ b/src/ladspa_run_synth.c @@ -7,12 +7,8 @@ inline int min(int x, int y) { return (x < y) ? x : y; } -//is there any way to test a single event in the event table from here? hmm not sure void ladspa_run_sample_callback(event_table_t *event_table, void *userdata){ -//so something weird with nframes we pass, a bit strange code in trivial_synth too, I thought that run_synth need number of frames to calulate, but it seems it is multiplying number of events and number of frames to calulate. need to check documentation about to to actually run this thing. right trivial_synth is supplied as an example from the people who wrote dssi, most likely it's cli-dssi-host that is the source of the confusion b utc ould believe -//what if we set the number of frames to a fixed number, did that work? yes already tried that, wo rk partially, only with on_event. so i guess only thing left to check is to supply on_event and change only one field like note in it with data from event_table, just to find out what is going on. well one thing, not sure if this is the best, but I could generate a much simpler midi file for testing purposes, with two notes, or do you think that's a waste? well it should work too, checking it here will be just faster -//well one quick fix we can try to run, overwise need to check it all again snd_seq_event_t on_event, off_event, *current_event; on_event.type = SND_SEQ_EVENT_NOTEON; on_event.data.note.channel = 0; @@ -25,10 +21,6 @@ void ladspa_run_sample_callback(event_table_t *event_table, void *userdata){ off_event.data.note.note = midi_note; off_event.data.note.off_velocity = midi_velocity; off_event.time.tick = 0; -if(event_table->length >=1){ - //on_event.data.note.note = event_table->events->data.note.note; - //on_event.data.note.velocity = event_table->events->data.note.velocity; -}// nope i removed those changes, should be correct notes nframes = event_table->nframes_since_last; nframes = nframes > 0 ? nframes : 1; for (int i = 0; i < outs; i++) { @@ -36,9 +28,7 @@ if(event_table->length >=1){ memset(pluginOutputBuffers[i], 0, nframes * sizeof(float)); } connect_ports(); -//should we try exiting right after runsynth? or is there not much code afterwards? -//nframes = event_table->nframes_since_last; if (descriptor->run_synth) { descriptor->run_synth(instanceHandle, @@ -46,21 +36,13 @@ if(event_table->length >=1){ event_table->events, event_table->length ); -/*if(event_table->events){ -printf("on_event: "); -print_snd_seq_event(&on_event); -printf("event_table: "); -print_snd_seq_event(event_table->events); -}*/ } else if (descriptor->run_multiple_synths) { descriptor->run_multiple_synths(1, &instanceHandle, - // event_table->nframes_since_last, nframes, &event_table->events, &event_table->length); } -//so we need to test it now? yes /* Interleaving for libsndfile. */ float sf_output[nchannels * nframes]; for (int i = 0; i < nframes; i++) { @@ -140,37 +122,9 @@ print_snd_seq_event(event_table->events); fprintf(stdout, "%s: Wrote %d frames to %s\n", my_name, items_written, output_file); -/* total_written += items_written; - if (release_tail >= 0) { - if (total_written > length + release_tail) { - finished = 1; - } - } else { - if (total_written > length - && is_silent(sf_output, nframes * nchannels)) { - finished = 1; - } else if (total_written > MAX_LENGTH * sample_rate) { - / * The default sineshaper patch never releases, after a note-off, - * to silence. So truncate. This is sineshaper 0.3.0 (so maybe it's - * different in the new version) and here I mean the default - * patch as returned by the get_port_default() function, not the - * default set by the sineshaper UI. - / - finished = 1; - fprintf(stderr, "%s: Warning: truncating after writing %d frames\n", - my_name, total_written); - } - } - } -*/ } void ladspa_run_synth(void){ - -// ctx.player = player; -// ctx.callback = callback; -// ctx.callback_userdata = callback_userdata; -// ctx.track = player->track[i];// here. so i guess need to make a structure and put player, track pointers into it. load_midi_file(midi_filename, ladspa_run_sample_callback, NULL); } |
