• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • More work on looper software

    April 26th, 2010
    looper, music, tech  [html]
    I've now (after talking to chris jacoby and blake) got the software for a three loop synchronizing system working. The problem I had last week was that I needed the loops to sync: now I understand what I needed to do. Calculating how long you need to wait until the beginning of the loop comes around is somewhat tricky. The issue was that LiSa buffers have several attributes: duration, play/record positions, and loop start/ends. Waiting for loopEnd - position samples is pretty good, unless the loop happens to go off the end of the buffer and come back on the other side, in which case loopEnd will be less than position and we can't wait for negative intervals. So in those cases we want to add on the duration of the loop. To cover both cases, we calculate the result modulo duration, so we're always between 0 and duration, which gives:
    (duration + loopEnd - position) % duration
    Unfortunately, this isn't quite right. There's latency involved in the system, with buffers in several places. This means that the samples that you are recording at time T were created to go along with samples that you played at time T - latency where latency is small but noticible. If I were able to get jack working with chuck in realtime mode (and the usb mouse driver too) then I might be able to get latency down to perhaps 2ms (64 samples) and be able to ignore it. That approach didn't seem to be working. Talking to blake, though, I realized I could simply start recording a little early to compensate. So really the number of samples to wait for is:
    (duration + loopEnd - position - latency) % duration
    Then the question is, what to set latency to. I put jack on its default setting, where it performed pretty well. This turned out to be using two buffers of 1024 samples each. So I started with latency set to 2048. Some trial and error showed that really what I wanted was 1024+1024+512. Where does the 512 come from? I'm not sure. It might be jack's input buffer, or perhaps a chuck buffer. Regardless, I can now play one loop and then put another one on top of it totally synchronized. Very exciting.

    Comment via: facebook

    Recent posts on blogs I like:

    Collections: The Queen’s Latin or Who Were the Romans? Part IV: The Color of Purple

    This is the fourth part (I, II, III) of our series asking the question “Who were the Romans?” and contrasting the answer we get from the historical evidence with the pop-cultural image of the Romans as a culturally and ethnically homogeneous society typic…

    via A Collection of Unmitigated Pedantry July 23, 2021

    The Leakage Problem

    I’ve spent more than ten years talking about the cost of construction of physical infrastructure, starting with subways and then branching on to other things, most. And yet there’s a problem of comparable size when discussing infrastructure waste, which, …

    via Pedestrian Observations July 23, 2021

    Songs about terrible relationships

    [Spoilers for several old musicals.] TV Tropes lists dozens of examples of the “I want” song (where the hero of a musical sings about their dream of escaping their small surroundings). After watching a bunch of musicals on maternity leave, I’m wondering h…

    via The whole sky July 17, 2021

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact