20 Jun 2012 22:17
Tempo event in a Midi sequencer...
Ru Vuott <vuott <at> yahoo.it>
2012-06-20 20:17:09 GMT
2012-06-20 20:17:09 GMT
Hello,
I am finally able to make a simple midi sequencer with the Gambas language. It works, but I have some little
problem about changing the metronomic Tempo within a midi song.
Since I used the method of sending an Echo event to send Midi Messages groups to ALSA, I thought I'd solve the
problem of an eventual return of metronomic Time by sending an echo and backing from Alsa custom (Type:
90). At the time of receipt of the echo by the Alsa function:
int snd_seq_event_input(snd_seq_t *handle, snd_seq_event_t **ev)
the code sends the value of the tempo to a routine, where there are these Alsa functions:
snd_seq_queue_tempo_malloc(...)
snd_seq_queue_tempo_set_tempo(...)
snd_seq_set_queue_tempo(...)
snd_seq_queue_tempo_free(...)
...obviously with teir parametres.
I noticed, though, unfortunately (incomprehensibly) that often the change is a bit 'earlier than
required. I do not think there is a problem of Delta Time, since the Delta Time of metronomic Tempo event is
treated the same way as that relating to other MIDI events.
Looking for a solution, I had a look at the code of your Aplaymidi, and I saw this statement:
case 0x51: /* tempo */
......
...etc
event->type = SND_SEQ_EVENT_TEMPO;
...etc,
so, I thought that the change of Tempo occur simply by sending an event by identifying it with precisely the
type number: 35. I performed the test, checking the result is listening to the song, seeing both as
reported by Aseqdump.
(Continue reading)
RSS Feed