Re: [Loopdub-devel] Synchronizing MIDI controls with LoopDub
Brought to you by:
radarsat1
From: Stephen S. <rad...@gm...> - 2008-01-02 03:10:58
|
Hi, Sorry for the delayed response.. :) I was preparing to play a set at a new year's party, so I didn't want to give you a quick answer. You put a lot of thought into your posts so I like to give myself time to consider carefully before answering. (ps. the set went well, though i played so late in the night that there weren't many people left... loopdub worked perfectly however! First time doing a set using Linux on a borrowed MacBook Pro.) I did do a little more work on my midisync branch and I have come to the conclusion that perhaps it was a bad way to start. I still kind of like the idea of the MidiValue class, but the way I was linking the values to specific GUI sliders was probably a bad decision. For instance, it didn't play well when I went to implement the button-mode selection. > Okay, I read your code, and it mostly makes sense to me. One question: > I can't seem to discern the purpose of NEEDSYNC. What is it used for, > precisely? That was just to keep some state information about a given midi value. It wasn't completely thought out yet. > My button goes to 64 when I turn it on, and > 0 when I turn it off, so I can never get to 32. I'm stuck in pick-up > mode; my button is rendered useless. Pick-up mode doesn't need to detect proximity to the current value. It only needs to remember which side the MIDI control was on (relative to the GUI value) before going into pick-up mode. Example, if K is the knob value (which the software remembers from the last CC message) and G is the last GUI value. Let's say Kp and Gp are the previous values. Starting with the button off, and the GUI is moved to position 32. Step 1: K = 0 (button off); G = 32 (slider moved); mode = 'pickup'; Step 2: Kp = 0, Gp = 32; K = 64 (button pressed); If ((Kp <= Gp) == (K >= Gp)) then G = K; else G = Gp; Hm... something like that anyways. > The essential problem here is that it just makes no sense to have MIDI > pick-up for a controller that can move in a non-stepwise manner; Perhaps, but I think it's best to assume that any control can move in a non-stepwise manner. I haven't tested it, but I assume that some MIDI controllers will send non-successive values if you move the knob fast enough. > two concepts are mutually exclusive, since one is designed to avoid > jumps in control values, and the other inherently results in jumps in > control values. Pick-up is only designed to avoid jumps _caused by context switches_ internal to the software. A stream of incoming CC messages with no state change in the software should be processed as if they are always valid. > The complex solution is to allow pick-up to be disabled selectively. I think this isn't a bad idea. > The reason it is necessary to disable MIDI pick-up > entirely for these controllers is the possibility of loading presets > on the controller; this results in jumps in all of the control values, > and would create conflicts if there were pick-up on any controls. I don't really think it would cause problems to load a preset on a controller and have all the values change, they should just be processed as any other incoming CC message. However, I think you're right that it might be useful to be able to disable pick-up for controllers that have controllable knobs. One situation however comes to mind: what about those controllers where the settable knobs are magnetically controlled? If you send a MIDI value to one of the knobs, it swings into place over some amount of time. During this particular delta time, wouldn't you want to ignore values during the slide? It seems pick-up mode might be useful for saying "go to this value, but ignore incoming CC messages until that value is reached." > As I said before, I think that, for now, we should simply not support > non-stepwise movement of controls. We can add support for that later, > but for now let's focus on getting the basic pick-up and sync working. I just don't really think it's even a good idea to differentiate between stepwise and non-stepwise control. Or, put differently, I think it's best to assume that any control can be non-stepwise. For example, in your situation, for configuring a CC to a button. It would be a shame not to support this situation. Steve |