mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.39k stars 1.26k forks source link

Support Traktor Scratch MK2 Vinyl Control #6260

Open mixxxbot opened 2 years ago

mixxxbot commented 2 years ago

Reported by: mgloiber Date: 2012-01-29T15:40:21Z Status: Triaged Importance: Wishlist Launchpad Issue: lp923389 Tags: vinylcontrol


Mixxx 1.10.0 on Win 7 (32 bit, English), Up2date MS patches. Intel Core2 Quad CPU Q6600, 4GB RAM Using ASIO4All sound API or Audio 6 interface -> same result/problem NI Audio 6 USB Audio interface ATI Radeon HD 3870 X2, Catalyst 12.1 drivers

Vinyl control in Traktor Scratch Duo 2 works so it seems to be a Mixxx-related problem.

After some testing and discussions in the chatroom the problem seems that I got new(/unsupported?) Traktor MK2 timecode vinyl. Not sure if xwax supports the new format already or if Mixxx needs to make the already supported format selectable in the settings dialogue.

Difference seems to be that the new MK2 is using 2400Hz instead of 2000 Hz.

Enabling Vinyl Control with Traktor Scratch plays the track too fast. As soon as I switch to Serato CV02 Vinyl without changing anything else (except the timecode vinyl, of course) it plays the track at normal speed.

I don't have a Linux system here.

mixxxbot commented 2 years ago

Commented by: ywwg Date: 2012-01-29T15:59:21Z


xwax does not support the new traktor vinyl, so the MK2 will need to be reverse-engineered. I talked to the xwax guy about this and he doesn't seem eager to work on it. I would guess that, given the existing xwax code, it's not going to be too hard for someone to add support for it. I don't really understand the algorithm at all, so it would be an uphill battle for me. But I'm willing to give it a shot.

Would it be possible for you to record each side of the MK2 vinyl and post it online? That way developers can take a look at the sound wave and try to figure it out.

mixxxbot commented 2 years ago

Commented by: rryan Date: 2012-02-02T16:03:18Z


Owen -- can you comment on what would be necessary to support this?

mixxxbot commented 2 years ago

Commented by: rryan Date: 2012-02-02T16:03:51Z


I fail at reading -- you already did. Need coffee.

mixxxbot commented 2 years ago

Commented by: miss-julia Date: 2012-03-14T08:09:48Z


I am willing to record the MK2 vinyl and share it with the developers.

  1. Which file format and sampling rate should I use?
  2. My turntables are connected to a Snow Leopard Macbook Pro via Native Instrument Audio 6. Is Audacity okay for this task? If not what other free/open source software could I use?
  3. I guess that the resulting files will be quite big. What's the best way to share them with the developers?
mixxxbot commented 2 years ago

Commented by: ywwg Date: 2012-03-14T13:24:20Z


Hi Julia, thanks for helping out! Please record the tracks as uncompressed 44.1Khz 16-bit WAV or AIFF files. You can zip the files when you are done to get the file size down a little. Audacity should be fine for the task. The files will probably be around 100 megs, maybe you can post them to sendspace or use yousendit or something? Just post the url to this bug and I'll see it.

mixxxbot commented 2 years ago

Commented by: miss-julia Date: 2012-03-14T19:08:32Z


Hi Owen, the two files are here http://www.sendspace.com/filegroup/ZUkFT%2F482HTxTXvt3EBudg or better: Side A http://www.sendspace.com/file/2s0c82 Side B http://www.sendspace.com/file/xpsyab

A quick analisys: side B is about 3 minutes longer than side A. The last minute (approximately) is the track selection area. If the option is activated in traktor one can scroll thru the playlist by manually spinning the record and stopping on the track that one wants to be loaded in the deck....forget about it, it's kind of a useless feature: when the pickup is in that area it's too close to the hand anyway and it will be hit and displaced by the hand while trying to spin the record. The lead in area where traktor rewinds to the start of the tracks is the few first grooves, approximately 3 to 5 seconds. At the end of the record there is an infinite loop track, the pickup will not move further towards the center and your track will keep on playing even if you forget to touch the record. On side B you can hear a click and see it quite clearly on the waveform when the infinite groove starts.

Unfortunately on my record on side A there is a long radial scratch, but it has no influence, Traktor works properly even though the record is heavily scratched, if you find something strange happening 33 times a minute in the signal then probably it's the scratch, tho the timecode software is insensitive to that. Side B is clean and healthy.

I played the record into a software spectrum analyzer (iSpectrum) and I can see only a strong carrier signal at around 2.5 kHz (plus harmonics at 5 and 7.5 kHz). The frequency moves around 2.5 kHz up and down in a sinusoidal fashion. I can't see anything else, but I definitely hear digital noise superimposed on the carrier with my "naked" ear. You should try to use some better software to analyze the signal or even better a lab instrument, a true spectrum analyzer. Probably the digital modulation is much weaker than the carrier and it's not picked up by the iSpectrum.

Cheers, J

mixxxbot commented 2 years ago

Commented by: ywwg Date: 2012-03-14T21:00:07Z


Hi,

The xwax developer (Mark Hills) informed me there's a potential copyright / trademark issue with posting digitized vinyl online. In the name of playing by the rules, please take down the sendspace links. Instead I (or Mark) will have to work with a copy of the vinyl itself.

mixxxbot commented 2 years ago

Commented by: miss-julia Date: 2012-03-14T23:14:28Z


Hi Owen, the files are removed. Let me know if there's any analisys that I can do on the vinyls on your behalf.

mixxxbot commented 2 years ago

Commented by: funkydrummar Date: 2013-05-12T19:18:50Z


hi, i own an MK2 with a Traktor Audio 6 and recently switch to linux with realtime kernel for trying xwax. i would like to reverse engine the MK2.

i don't understand ANYTHING about harmonics and related stuff but i am a little bit able with coding:

i figured out that in the source code the file "timecoder.c" is the responsible to make the time code profiles.

"
{
        .name = "traktor_a",
        .desc = "Traktor Scratch, side A",
        .resolution = 2000,
        .flags = SWITCH_PRIMARY | SWITCH_POLARITY | SWITCH_PHASE,
        .bits = 23,
        .seed = 0x134503,
        .taps = 0x041040,
        .length = 1500000,
        .safe = 1480000,
        .lookup = false
    },
    {
        .name = "traktor_b",
        .desc = "Traktor Scratch, side B",
        .resolution = 2000,
        .flags = SWITCH_PRIMARY | SWITCH_POLARITY | SWITCH_PHASE,
        .bits = 20,
        .seed = 0x32066c,
        .taps = 0x041040, /* same as side A */
        .length = 2110000,
        .safe = 2090000,
        .lookup = false
    },

"

i am playing in the traktor_b section and changing the resoultion to 2500 seems to set the speed of the vinyl in the right way (so i figured out that could be the kHz setting of 2,5). But what about bits, seed, taps???

mixxxbot commented 2 years ago

Commented by: ywwg Date: 2013-05-12T22:46:05Z


Unfortunately the MK2 vinyl uses a very different system than xwax was designed for. We could probably get a very rudimentary Relative mode working, but there would be a lot of problems. Just filling out new numbers is not going to be enough. Getting it to work would involve serious reverse-engineering.

mixxxbot commented 2 years ago

Commented by: jonthebagel Date: 2013-10-21T00:36:41Z


I recorded the side A of the MK2 Vinyl, here's what I found out. The carrier wave as stated before is at 2.5KHz, it is functionally the same as the Serato carrier wave, relative mode should be extremely easy to implement in that sense. See http://i.imgur.com/ITzc7f8.png

The trickier, part, however, would obviously be absolute mode. I believe it's encoded in the waveform itself. I found some periodicity, about 100ms apart. See http://i.imgur.com/n6m57uR.png

I counted each zero crossing as a "bit" and came out ~60 bits. Does this sound reasonable? What is the periodicity for the Serato vinyls?

mixxxbot commented 2 years ago

Commented by: jonthebagel Date: 2013-10-21T00:51:45Z


DJ Julia is correct about hearing the "digital" signal, it is encoded directly below 1KHz, if you look at the spectrogram I linked earlier, you'll see a big hole there, everything below that line is the digital encoding.

I decided to run a band-pass filter between 0-1KHz to see what the resulting waveform would look like: This is what I got, with the same periodicity: http://i.imgur.com/Fm77jlF.png

The filtered spectrogram doesn't yield anything too interesting: http://imgur.com/z2xAGFM,Fm77jlF

I think I'm on the right track but we'll see how it pans out.

mixxxbot commented 2 years ago

Commented by: ywwg Date: 2013-10-21T02:58:11Z


Here is what Mark Hills, the xwax author, has said about the new format:

It's different to existing timecodes: instead of modulating the amplitude, the offset is modulated.

The result is two circles in an X-Y scope; eg.
    __
  /     \
  |      |__
  \__/     \
        |       |
         \__/

The 2.4KHz of the sine wave is not matched by the bistream which only runs at 1.2KHz, it seems. I didn't do anything to decode the bitstream, but most things like this will generalise to an LFSR like before.

Decoding the wave would involve tracking the offset. But because the timecode is no longer balanced in the + and - direction, even the high-pass filtering of the stylus defeats it. See attached. Look at how the signal is 'bent' back into being aligned at zero every time it changes value.

It's certainly beyond the scope of timecoder.c and would need its own decoder.

And in all probability, a much less robust timecode (with respect to bitstream) because of the above, as well as a fiddly implmentation.


On Sun, 6 May 2012, Owen Williams wrote:

I'm very new to this sort of signal analysis so I have a bunch of questions:

On Sun, 2012-05-06 at 21:38 +0100, Mark Hills wrote:

It's different to existing timecodes: instead of modulating the amplitude, the offset is modulated. So in this graph, what does a 1 look like and what does a 0 look like?

A zero is two full revolutions of the top circle. A one is two full revolutions of the bottom circle.

The problem with the high pass filtering, it that the circles will always gravitate towards the centre. So you can't get two clean circles, only a blur between them.

mixxxbot commented 2 years ago

Commented by: ywwg Date: 2013-10-21T02:58:23Z


ps, thanks for taking a look at this!

mixxxbot commented 2 years ago

Commented by: ywwg Date: 2013-10-21T02:59:38Z


Another attempt at the ascii art:

   __
  /  \
  |  |__
  \__/  \
     |  |
     \__/
mixxxbot commented 2 years ago

Commented by: jonthebagel Date: 2013-10-21T14:46:31Z


Thanks for the detailed response Owen!

It seems my initial estimate of where the bit-stream lies was off, I haven't looked at the signal again to verify.

Are you aware of any documentation regarding the reverse-engineering of the other DVS implemented in XWax? I'm familiar with LFSR however I'm not entirely sure exactly how they tie into this, scrambling?

I'm definitely up for the challenge for looking into it; another friend would like to help as well. At the very least we can try to get a rudimentary implementation going.
mixxxbot commented 2 years ago

Commented by: jonthebagel Date: 2013-10-21T15:27:10Z


Bah..., I had a lengthy follow up but I accidentally refreshed the page.

Anyways, I took a look at the signal again and I'm not really seeing the bit-stream at 1.2KHz.

See http://i.imgur.com/MZrDHOw.png and http://i.imgur.com/QEF0O0i.png

There's some activity at 2KHz, however I haven't isolated it, it could be harmonics.

mixxxbot commented 2 years ago

Commented by: jonthebagel Date: 2013-10-21T15:30:06Z


I should mention that it seems that 0-1KHz and 1-2KHz are harmonically equivalent.

mixxxbot commented 2 years ago

Commented by: ywwg Date: 2013-10-21T17:27:41Z


Take a look at the serato waveform (freely available online) for an example of an easier-to-understand example. Mapping left and right to an x-y circular plot helps, too. I think the idea is that the zero crossings encode a binary stream, and the binary stream is an LFSR timecode. ie, you can take any X-bit section of the binary stream and get a unique value. That value is the timecode value for that position of timecode.

I don't think looking at a spectral graph is helpful, it's that XY plot that is important.