Re: [linux-audio-dev] Sequencer Sync Woes

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Sequencer Sync Woes
From: Tim Goetze (tim_AT_quitte.de)
Date: Wed Feb 07 2001 - 21:03:44 EET


Today Billy Biggs wrote:

> Do you calculate your position in the song based on the current time?
>That's no good for me. In my app, you need to be able to turn looping
>on and off, and move the loop mid-song. Otherwise, how can you play
>live?

yes, the engine is time-based. and yes, it can loop, and i use it.

> I usually have to sync to an external source: I have a TR-707 which
>can output DIN sync to my TR-606, but only if it's the sync master. So,
>I usually don't care too much about keeping track of the tempo myself.

yeah, midithing is missing that yet, and it may mean the engine design
will have to be altered, after all ticks and time are very different.
something to think about ...

> Thanks for the code, I'm going to think about it some more.

i need to patch what i posted:

bool
m_song::parse (m_tempo_event * e)
{
  /* this line was missing. tim stupidly oversimplified things ... */
  time.current = tick2time (tick.current = e->generic.tick);

  if (!e->is_tempo())
    return false;

  time.usec_per_quarter = e->usec_per_quarter();

  time.per_quarter =
    (double) time.usec_per_quarter /
    TEN_TO_THE_SIXTH;

  time.per_tick = time.per_quarter / (double) division;

  tick.of_last_tempo = tick.current;
  time.of_last_tempo = time.current;

  return true;
}

>> i use double as the type of real time mostly out of laziness; do you
>> think there is too much computational overhead? one could switch to
>> uint.uint then. i don't even have an idea how many cycles a double /
>> takes ...
>
> I don't think it's significant to worry about.

good. i was about to rdtscl it.

.tim


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Feb 07 2001 - 21:34:21 EET