Re: [Mixxx-devel] absolute position ?
Hi Owen, Like I said, we do playback based on pitch, not position. I assume you mean pitch adjustments, not an 11-bit MIDI pitch message. Is there a problem you're trying to solve? 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). However, if I cannot send an absolute time position, I'll need a slew of different messages for tempo, pitch bend, FF/REW, etc., synthesized on my end, which is likely to be much less precise, then pass those individual messages to Javascript. 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. Btw I did look at xwax but due to its focus it's lacking some features that Mixxx has, so I'm between a rock and a hard place. Is there something wrong with how absolute position playback is working? AFAIK there currently is no absolute position playback. The closest is the playPosition message but the position is normalized over the track's length, i.e. I'd have to retrieve the track length from Mixxx and unscale my absolute position but that doesn't tell me how much resolution comes through, i.e. if a pitch bend on the CDJ would even be registered by Mixxx. If you can help me with the above, say by adding such an absolute playMsPosition message or showing me how to hook an alternative communication path to Mixxx (Unix pipe, shared lib/DLL, OSC, etc.) then please contact me offline so we talk code instead of semantics :) I'm guessing a shared lib binary plug-in model would be most efficient since it'd bypass Javascript at runtime (could still have a JS load-time hook). I'd be willing to implement an OSC server in this first shared lib so it's for the benefit of all. thx cheers, -- p On Sat, 2013-07-06 at 19:08 +0200, petah wrote: On Sat, 06 Jul 2013 11:14:13 -0400 Owen Williams owilliams-opwvymzfgylytjvyw6y...@public.gmane.org wrote: I'm confused, what are you trying to do? For vinylcontrol absolute mode, we mostly use the pitch value and then nudge the speed up or down if it drifts too far from the reported timecode position.For CDs, if it's more than .1 seconds off then we just seek to that position. I don't really see the point of having 22 bit resolution. 22-bits is the maximum resolution the CDJ timecode returns for a single-track CD. On a 4-track CD a timestamp is 2.38ms or a worst-case latency of ~5ms. OTOH nudging +/- 0.1 second is 100ms or 20x worse. Dropping seek commands based on acceptable drift is fine on full-resolution incoming timecode at the receiver end, but doing roundtrips and diffs to reach an absolute position makes no sense if the timecode is absolute to begin with. I'd turn the comment around: I don't see the point of truncating bits in the protocol to later try recovering them by chasing the needle :) -- p On Sat, 2013-07-06 at 11:56 +0200, petah wrote: What message should be used to set the absolute position of the virtual needle of a loaded track given an absolute time position, f.ex. 2mins 34secs 567millisecs? I went through all the relevant docs (I think), incl. controls and HID mappings and didn't find a clear solution. I need to match an analog CDJ's time display with Mixxx's via a timecode CD using absolute timestamps (4 tracks x 15min), i.e. time scale between CDJ/Mixxx needs to be 1:1 and clamp, not stretch. F.ex. vinylcontrol_mode is a 3-way switch, one being absolute, but I don't see the set absolute time message. playPosition is scaled over the length of the track loaded in mixxx, which won't match a timecode CD's track. scratch2 affects the absolute speed, hence the relative position. The absolute time position needs to have at least 22-bit resolution so a gentle pitch bend can go through the engine via that cursor position and behave as expected, i.e. if any scaling/compression is applied along the way it wouldn't chop off the lower bits. It's just to control track position. Precision is critical but right now latency isn't. 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-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org
Re: [Mixxx-devel] absolute position ?
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, Mixxx wouldn't know to scale the audio and you'd just hear horrific noise as the track reseeks constantly. Seek operations should never be used during playback except for loop boundaries, cues, and other actual seeks. Trying to match up mixxx's position with a sample-accurate playback position from CDJ is a recipe for disaster and headache. CDJ doesn't really drift so that's a non-issue. 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. However, if I cannot send an absolute time position, I'll need a slew of different messages for tempo, pitch bend, FF/REW, etc., synthesized on my end, which is likely to be much less precise, then pass those individual messages to Javascript. A rate parameter should be enough to get you all four of those messages. Really, rate and position are all you need. 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! Btw I did look at xwax but due to its focus it's lacking some features that Mixxx has, so I'm between a rock and a hard place. look instead at vinylcontrolxwax.cpp. It has CD-specific code which makes it more precise than regular vinyl. Is there something wrong with how absolute position playback is working? AFAIK there currently is no absolute position playback. The closest is the playPosition message but the position is normalized over the track's length, i.e. I'd have to retrieve the track length from Mixxx and unscale my absolute position but that doesn't tell me how much resolution comes through, i.e. if a pitch bend on the CDJ would even be registered by Mixxx. I meant absolute mode in vinylcontrolxwax.cpp. -- 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
[Mixxx-devel] absolute position ?
What message should be used to set the absolute position of the virtual needle of a loaded track given an absolute time position, f.ex. 2mins 34secs 567millisecs? I went through all the relevant docs (I think), incl. controls and HID mappings and didn't find a clear solution. I need to match an analog CDJ's time display with Mixxx's via a timecode CD using absolute timestamps (4 tracks x 15min), i.e. time scale between CDJ/Mixxx needs to be 1:1 and clamp, not stretch. F.ex. vinylcontrol_mode is a 3-way switch, one being absolute, but I don't see the set absolute time message. playPosition is scaled over the length of the track loaded in mixxx, which won't match a timecode CD's track. scratch2 affects the absolute speed, hence the relative position. The absolute time position needs to have at least 22-bit resolution so a gentle pitch bend can go through the engine via that cursor position and behave as expected, i.e. if any scaling/compression is applied along the way it wouldn't chop off the lower bits. It's just to control track position. Precision is critical but right now latency isn't. 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
Re: [Mixxx-devel] absolute position ?
I'm confused, what are you trying to do? For vinylcontrol absolute mode, we mostly use the pitch value and then nudge the speed up or down if it drifts too far from the reported timecode position. For CDs, if it's more than .1 seconds off then we just seek to that position. I don't really see the point of having 22 bit resolution. owen On Sat, 2013-07-06 at 11:56 +0200, petah wrote: What message should be used to set the absolute position of the virtual needle of a loaded track given an absolute time position, f.ex. 2mins 34secs 567millisecs? I went through all the relevant docs (I think), incl. controls and HID mappings and didn't find a clear solution. I need to match an analog CDJ's time display with Mixxx's via a timecode CD using absolute timestamps (4 tracks x 15min), i.e. time scale between CDJ/Mixxx needs to be 1:1 and clamp, not stretch. F.ex. vinylcontrol_mode is a 3-way switch, one being absolute, but I don't see the set absolute time message. playPosition is scaled over the length of the track loaded in mixxx, which won't match a timecode CD's track. scratch2 affects the absolute speed, hence the relative position. The absolute time position needs to have at least 22-bit resolution so a gentle pitch bend can go through the engine via that cursor position and behave as expected, i.e. if any scaling/compression is applied along the way it wouldn't chop off the lower bits. It's just to control track position. Precision is critical but right now latency isn't. 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 -- 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
Re: [Mixxx-devel] absolute position ?
On Sat, 06 Jul 2013 11:14:13 -0400 Owen Williams owilliams-opwvymzfgylytjvyw6y...@public.gmane.org wrote: I'm confused, what are you trying to do? For vinylcontrol absolute mode, we mostly use the pitch value and then nudge the speed up or down if it drifts too far from the reported timecode position.For CDs, if it's more than .1 seconds off then we just seek to that position. I don't really see the point of having 22 bit resolution. 22-bits is the maximum resolution the CDJ timecode returns for a single-track CD. On a 4-track CD a timestamp is 2.38ms or a worst-case latency of ~5ms. OTOH nudging +/- 0.1 second is 100ms or 20x worse. Dropping seek commands based on acceptable drift is fine on full-resolution incoming timecode at the receiver end, but doing roundtrips and diffs to reach an absolute position makes no sense if the timecode is absolute to begin with. I'd turn the comment around: I don't see the point of truncating bits in the protocol to later try recovering them by chasing the needle :) -- p On Sat, 2013-07-06 at 11:56 +0200, petah wrote: What message should be used to set the absolute position of the virtual needle of a loaded track given an absolute time position, f.ex. 2mins 34secs 567millisecs? I went through all the relevant docs (I think), incl. controls and HID mappings and didn't find a clear solution. I need to match an analog CDJ's time display with Mixxx's via a timecode CD using absolute timestamps (4 tracks x 15min), i.e. time scale between CDJ/Mixxx needs to be 1:1 and clamp, not stretch. F.ex. vinylcontrol_mode is a 3-way switch, one being absolute, but I don't see the set absolute time message. playPosition is scaled over the length of the track loaded in mixxx, which won't match a timecode CD's track. scratch2 affects the absolute speed, hence the relative position. The absolute time position needs to have at least 22-bit resolution so a gentle pitch bend can go through the engine via that cursor position and behave as expected, i.e. if any scaling/compression is applied along the way it wouldn't chop off the lower bits. It's just to control track position. Precision is critical but right now latency isn't. 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-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org https://lists.sourceforge.net/lists/listinfo/mixxx-devel -- 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-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org https://lists.sourceforge.net/lists/listinfo/mixxx-devel -- 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
Re: [Mixxx-devel] absolute position ?
On Sat, 06 Jul 2013 11:14:13 -0400 Owen Williams owilliams-opwvymzfgylytjvyw6y...@public.gmane.org wrote: I'm confused, what are you trying to do? For vinylcontrol absolute mode, we mostly use the pitch value and then nudge the speed up or down if it drifts too far from the reported timecode position.For CDs, if it's more than .1 seconds off then we just seek to that position. I don't really see the point of having 22 bit resolution. 22-bits is the maximum resolution the CDJ timecode returns for a single-track CD. On a 4-track CD a timestamp is 2.38ms or a worst-case latency of ~5ms. OTOH nudging +/- 0.1 second is 100ms or 20x worse. Dropping seek commands based on acceptable drift is fine on full-resolution incoming timecode at the receiver end, but doing roundtrips and diffs to reach an absolute position makes no sense if the timecode is absolute to begin with. I'd turn the comment around: I don't see the point of truncating bits in the protocol to later try recovering them by chasing the needle :) -- p On Sat, 2013-07-06 at 11:56 +0200, petah wrote: What message should be used to set the absolute position of the virtual needle of a loaded track given an absolute time position, f.ex. 2mins 34secs 567millisecs? I went through all the relevant docs (I think), incl. controls and HID mappings and didn't find a clear solution. I need to match an analog CDJ's time display with Mixxx's via a timecode CD using absolute timestamps (4 tracks x 15min), i.e. time scale between CDJ/Mixxx needs to be 1:1 and clamp, not stretch. F.ex. vinylcontrol_mode is a 3-way switch, one being absolute, but I don't see the set absolute time message. playPosition is scaled over the length of the track loaded in mixxx, which won't match a timecode CD's track. scratch2 affects the absolute speed, hence the relative position. The absolute time position needs to have at least 22-bit resolution so a gentle pitch bend can go through the engine via that cursor position and behave as expected, i.e. if any scaling/compression is applied along the way it wouldn't chop off the lower bits. It's just to control track position. Precision is critical but right now latency isn't. 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-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org https://lists.sourceforge.net/lists/listinfo/mixxx-devel -- 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-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org https://lists.sourceforge.net/lists/listinfo/mixxx-devel -- 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
Re: [Mixxx-devel] absolute position ?
Like I said, we do playback based on pitch, not position. Is there a problem you're trying to solve? Is there something wrong with how absolute position playback is working? On Sat, 2013-07-06 at 19:08 +0200, petah wrote: On Sat, 06 Jul 2013 11:14:13 -0400 Owen Williams owilliams-opwvymzfgylytjvyw6y...@public.gmane.org wrote: I'm confused, what are you trying to do? For vinylcontrol absolute mode, we mostly use the pitch value and then nudge the speed up or down if it drifts too far from the reported timecode position.For CDs, if it's more than .1 seconds off then we just seek to that position. I don't really see the point of having 22 bit resolution. 22-bits is the maximum resolution the CDJ timecode returns for a single-track CD. On a 4-track CD a timestamp is 2.38ms or a worst-case latency of ~5ms. OTOH nudging +/- 0.1 second is 100ms or 20x worse. Dropping seek commands based on acceptable drift is fine on full-resolution incoming timecode at the receiver end, but doing roundtrips and diffs to reach an absolute position makes no sense if the timecode is absolute to begin with. I'd turn the comment around: I don't see the point of truncating bits in the protocol to later try recovering them by chasing the needle :) -- p On Sat, 2013-07-06 at 11:56 +0200, petah wrote: What message should be used to set the absolute position of the virtual needle of a loaded track given an absolute time position, f.ex. 2mins 34secs 567millisecs? I went through all the relevant docs (I think), incl. controls and HID mappings and didn't find a clear solution. I need to match an analog CDJ's time display with Mixxx's via a timecode CD using absolute timestamps (4 tracks x 15min), i.e. time scale between CDJ/Mixxx needs to be 1:1 and clamp, not stretch. F.ex. vinylcontrol_mode is a 3-way switch, one being absolute, but I don't see the set absolute time message. playPosition is scaled over the length of the track loaded in mixxx, which won't match a timecode CD's track. scratch2 affects the absolute speed, hence the relative position. The absolute time position needs to have at least 22-bit resolution so a gentle pitch bend can go through the engine via that cursor position and behave as expected, i.e. if any scaling/compression is applied along the way it wouldn't chop off the lower bits. It's just to control track position. Precision is critical but right now latency isn't. 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-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org https://lists.sourceforge.net/lists/listinfo/mixxx-devel -- 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-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org https://lists.sourceforge.net/lists/listinfo/mixxx-devel -- 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 -- 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