On Sun, 07 Jul 2013 13:16:28 -0400 Owen Williams <owilliams-opwvymzfgylytjvyw6y...@public.gmane.org> wrote: > On Sun, 2013-07-07 at 18:26 +0200, petah wrote: > > Yes; the specific problem I'm trying to solve is interfacing my > > "homegrown" CDJ timecode program with Mixxx, "xwax-style". If I could > > pass a high resolution time position to Mixxx's internals then tempo, > > pitch bend, FF/REW, cue recall, etc, are all implicitly handled with > > one single message and the driver will be simple. I'd just need to > > loopback from my app to Javascript using a MIDI SysEx or HID message > > (or a MIDI "bundle"). > > Ah ok now your questions make more sense. > > Just having a time position isn't enough. If you were to pass time > positions but not rate values,
Ok. By "rate" do you mean "tempo"? I use terms as they appear on my CDJs; "tempo" being a lasting rate change (until DJ moves the tempo slider again) and "pitch bend" being a temporary rate/tempo variation for beat matching, say. I can compute tempo fairly reliably; I store rates in a ring buffer and wait <N> ms until the buffer is "stable" before considering a tempo change so other commands don't interfere, especially pitch bend. Pitch bend is a little dicier since I need to detect a sort of curly rate change. And yes, all of the above use lots of constants, i.e. are heavily hardcoded. > Mixxx wouldn't know to scale the audio > and you'd just hear horrific noise as the track reseeks constantly. Sure, you can't reset the audio position at every frame. > Seek operations should never be used during playback except for loop > boundaries, cues, and other actual seeks. So if the DJ is cueing up a new track and searching for a breakdown, say, while monitoring on headphones, "seeking" by changing the play position is a no-no? I can detect FF/REW/cue loop pretty reliably with RedBook correction, at least on CDJ100/1000. > Trying to match up mixxx's > position with a sample-accurate playback position from CDJ is a recipe > for disaster and headache. Right, sample-accurate is probably impossible ("famous last words":) my smallest timestamp is 105 frames/mono samples. > CDJ doesn't really drift so that's a non-issue. I meant that the time position in Mixxx and the one on the CDJ display lose any relationship; the CDJ will just jump around. > What you want is exactly what Mixxx already has in its vinyl control > API, which is rate and position. There is a lot of ugly hard-coding of > vinyl control, but it should be possible to create an interface with > your javascript. Ok, which messages would that be in the mixxxcontrols wiki page? Or am I looking at the wrong doc? > > This would be much more complex, less reliable and because the CDJ > > track position will drift from Mixxx's track position could even hit a > > CD track boundaries at which point it's stuck. > > yes, this is a known problem, and I wrote a lot of code to crate an "end > of timecode" mode (CONST mode) so that playback wouldn't stop when this > happens. On commercial Serato, if you use CDJ and your tracks are > longer than 15 minutes, they just stop! That happened to me too in the first iterations. I use 4 x 15-min tracks by default but can generate single-track CDs too, though by losing some timestamp resolution. It's not a perfect solution but swapping CDs is fast enough. > look instead at vinylcontrolxwax.cpp. It has CD-specific code which > makes it more precise than regular vinyl. Ok just took a quick glance; it looks a lot like my own hackery. Do you suggest I add my timecode format in there? I'm worried we'll get a worst of both worlds. Would it make sense to have a base abstract class with only the interfaces that Mixxx needs, plus a factory method so I can instantiate my derived class & hide all my internal hacks in it? thx! -- p ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Get Mixxx, the #1 Free MP3 DJ Mixing software Today http://mixxx.org Mixxx-devel mailing list Mixxx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mixxx-devel