Re: New feature: show song position (measure.beat) during playback

From: Alexandre Ratchov <alex_at_caoua.org>
Date: Tue Feb 05 2008 - 13:10:40 CET
On Mon, Feb 04, 2008 at 11:01:42PM +0100, George Wieggers wrote:
> > > Ok, that's fine. I wasn't aware of the '-v' option, that's why I chose
> > > the debug solution. Your approach probably is better.
> > >
> >
> > well, it's not documented; i've just added a new section ("Using
> > midish in other programs"), but it's still incomplete. Also added a
> > new line to the -v option to write the song position on stdout and
> > updated rmidish to use it.
> 
> Thanks for that, I'll update my working copy...
> 
> After browsing through the sources I already noticed that rmidish.c is
> a nice starting point for my project.
> 
> As I mailed you before, I intend to take a Linksys NSLU2 and convert
> it into a do-it-yourself midi file player. midish itself runs great.
> (I was a bit worried if the NSLU2 would have enough processing power
> to play midifiles and do midi-in filtering at the same time)
> The remaining task is to design a UI that will run properly on a 4x20
> LCD module and can be controlled easily using a small USB keypad.
> 
> Just wondering, would the following approach work?
> - always keep midish in "idle" or in "songplay" mode
> - if a command is initiated by the user:
>   - send a ctrl-c to midish
>   - perform the command
>   - and return to "idle" or "songplay" mode immediately
> 
> With the miditemp, I can re-assign tracks to devices, while a song is
> playing... I was just wondering if the same would be possible using
> midish, using this approach.
> 

it's possible but it will not work very well. When leaving
performace mode (idle, play, record) all notes are shutdown,
controllers are reset and midi devices are closed. When entering
performace mode again, devices are opened, controllers are restored
(but not notes). The result will not be smooth. Furthermore there's
no "pause/unpause" function, so the playback will not restart from
the right song postion.

I need similar features too in the short term, like switching
between filters and mutting tracks while in performace mode.

Other approaches require code changes.

The simpler approach could be just not to stop the interpreter
while in performace mode. This requires to:
 - add r/w reference counters to structures of all editable
   objects: song, track, filt, chan, sysex.
 - get a reference in the interpreter functions that use them and
   allow functions to fail if the requested object is in use by the
   performace mode.
 - tweak the console i/o code and remove the ^C crap...
most of the necessary cleaup is already done, so the code is almost
ready for the change.

another approach would be to define pseudo-midi events to tweak
filters and tracks and then to use midi gears to control midish. I
like this approach because events can be stored on tracks and
because it doesn't require a computer keyboard ;-). This requires
to:
 - define the new "meta" events 
 - fix the filter so that voice events from midi devices can
   be mapped to the new meta events.
 - make your keypad generate midi events.

Both are on my todo list. IMO you can use your approach until the
code is changed.

-- Alexandre
Received on Tue, 5 Feb 2008 13:10:40 +0100

This archive was generated by hypermail 2.1.8 : Thu Dec 20 2012 - 14:58:01 CET