denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MIDI (was Re: [Denemo-devel] Anacrusis script needed)


From: Jeremiah Benham
Subject: Re: MIDI (was Re: [Denemo-devel] Anacrusis script needed)
Date: Mon, 14 Sep 2009 11:57:27 -0500

On Mon, 14 Sep 2009 16:51:23 +0100
Richard Shann <address@hidden> wrote:

> On Mon, 2009-09-14 at 14:39 +0100, Richard Shann wrote:
> > There is some investigating still to do - why does it repeat noteon
> > madly if no noteoff is given etc, but it seems usable. I don't
> > understand all the stuff about nframes etc there is a loop which is
> > is going thru
> >   for(n=0;n<nframes;n++){
> > in send_midi_event which can only fire once - also i is just a
> > synonym for 0 here...
> > 
> OK, I have looked at this. The loop is spurious, and puts the noteon
> message in multiple times, which is what you hear if your noteoff is
> not scheduled for 44 seconds. The noteon is being put as having a
> time n, by this
> 
>       buffer = jack_midi_event_reserve(port_buffers[i], n, 3);
> 

I tried that but it did not work. Through trial and error I have only
found that this works:


static void
send_midi_event(jack_nframes_t nframes){
  unsigned char *buffer;
  gint i=0;

  void *port_buffers[MAX_NUMBER_OF_TRACKS];
  if (global_midi_buffer[0] >=0){
     if (output_ports[i]){
     port_buffers[i] = jack_port_get_buffer(output_ports[i], nframes);
     jack_midi_clear_buffer(port_buffers[i]);
     buffer = jack_midi_event_reserve(port_buffers[i], 0, 3);
     buffer[0] = global_midi_buffer[0];
     buffer[1] = global_midi_buffer[1];
     buffer[2] = global_midi_buffer[2];
     global_midi_buffer[0] = 0;
     BufferEmpty=TRUE;
   }
  }
}

I have removed the loop even though it was not causing it. Was I
believe was causing it was the BufferEmpty even though it was set to
static volatile gboolean.

>  we only want to put it in at time 0. 
> 
> Shall I check something in along these lines?

I would say no unless you have tested it and it works.

Jeremiah 

> Richard
> 
> 
> 
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]