Skip to content

Commit

Permalink
Increase MIDI buffer size upto 16384 bytes to allow longer SysEx data…
Browse files Browse the repository at this point in the history
… transmission.
  • Loading branch information
jofemodo committed Jan 4, 2024
1 parent 768df83 commit 1250297
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion zynmidirouter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ int write_rb_midi_event(jack_ringbuffer_t *rb, uint8_t *event_buffer, int event_
return 0;
}
} else {
fprintf(stderr, "ZynMidiRouter: Error writing ring-buffer: FULL\n");
fprintf(stderr, "ZynMidiRouter: Error writing ring-buffer => %d bytes available < %d bytes needed\n", jack_ringbuffer_write_space(rb), event_size);
return 0;
}
return 1;
Expand Down
7 changes: 4 additions & 3 deletions zynmidirouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ int get_midi_learning_mode();
// Zynmidi Ports
//-----------------------------------------------------------------------------

#define JACK_MIDI_BUFFER_SIZE 4096

#define ZMOP_CH0 0
#define ZMOP_CH1 1
#define ZMOP_CH2 2
Expand Down Expand Up @@ -359,7 +357,8 @@ void jack_connect_cb(jack_port_id_t a, jack_port_id_t b, int connect, void *arg)
// MIDI Events Buffer Management and Direct Send functions
//-----------------------------------------------------------------------------

#define ZYNMIDI_BUFFER_SIZE 4096
#define JACK_MIDI_BUFFER_SIZE 16384
//32768

//---------------------------------------------------------
// Direct Send Event Ring-Buffer write
Expand Down Expand Up @@ -433,6 +432,8 @@ int dev_send_program_change(uint8_t idev, uint8_t chan, uint8_t prgm);
// MIDI Internal Ouput Events Buffer => UI
//-----------------------------------------------------------------------------

#define ZYNMIDI_BUFFER_SIZE 16384

int init_zynmidi_buffer();
int end_zynmidi_buffer();
int write_zynmidi(uint32_t ev);
Expand Down

0 comments on commit 1250297

Please sign in to comment.