Sharpest crossfader cut time is coupled to buffer size

Bug #1703475 reported by Ambrosio Barceló
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Confirmed
Low
Daniel Schürmann

Bug Description

When Mixxx controls the crossfader (internal mixer mode / MIDI), although it's set to the fastest cut in preferences, its cuts are too soft for scratching (more aggressive cuts are necessary for it, like on/off sound).

I recorded a video showing this problem, comparing stand-alone mixer mode and MIDI mode with Mixxx: https://www.youtube.com/watch?v=XXktCyWYCs8

I asked in forum if there is some way to make the crossfader more aggressive without modifying code, but they told me there isn't. It would be great to have a more aggressive option for crossfader in next versions! It would be a pleasure to test betas if you want me to do it, to check new values for the cut if someone knows where to modify that in the code and compile it for Windows (unfortunately, Mixxx can't detect my Traktor Z2 as MIDI controller at UbuntuStudio 16.04, but it does under Windows)

- Mixxx 2.0.0 Windows 64-bit (downloaded a few hours ago)
- Windows 7 SP1 64-bit (with latest updates)
- i5-2540M@2.60GHz
- Intel HD Graphics 3000 and Native Instruments Traktor Z2 (ASIO driver)

Tags: engine
Revision history for this message
Be (be.ing) wrote :

Could you try installing this and setting the crossfader to the maximum sharpness in the preferences? Is it sharp enough for you?
https://ci.appveyor.com/api/buildjobs/fapudxr335hsgpc7/artifacts/mixxx-2.1.0-alpha-pre-master-PR1311-git6321-release-x64.msi

You may want to backup your settings and library database before using the installer:
https://mixxx.org/wiki/doku.php/testing#backup_settings_and_database

Note that we currently have some pending issues with the Windows installers:
Bug #1663380
Bug #1662727

If you have issues using the installer linked above, try installing the MSVC 2015 runtime and using the installer again:
https://www.microsoft.com/en-us/download/details.aspx?id=48145

Revision history for this message
Be (be.ing) wrote :

The Kontrol Z2 is a USB class compliant sound card and HID controller and could be used that way on any OS Mixxx runs on. Unfortunately mapping HID controllers is currently quite a bit more complicated than mapping MIDI controllers. Recently work on improving the process of mapping HID controllers has been started, but it will probably be a while before it is ready. If you are curious, you can follow the discussion here:
https://github.com/mixxxdj/mixxx/pull/1308

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

Thanks! Unfortunately, I can't run the installer even with the MSVC 2015 installed. I have a Spanish version, but I'll make an approximate translation of the message that appears just when I execute it: "Can't open this installation pack. Please contact the application developer to verify that it's a good Windows Installer pack."

Do you want me to report it in bug #1663380? It doesn't seem to be a UAC problem (I haven't turned it off and there's no privileges message)

Revision history for this message
Be (be.ing) wrote :

Please report a new bug for that issue.

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

Ok, the last installer in bug #1663380 works fine for installation (but sblaisot is still working for a right unnstallation). I've tested by myself.

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

Ok, I finally could install that alpha you gave me. I set again the crossfader to the fastest cut and it sounds a little better, but I would need more. Could it be? The ideal is like a switch (on/off sound, with no curve). The only need to make a curve is for a technical thing: avoiding "clicks" ("ugly" wave cuts done out of 0dB, specially dangerous when cutting bass, where it's more probable).

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Can you explain your use case?
Which audio buffer size do you use?

With the current master (kTransformMax = 1000.0)
In the GUI, we have already go from -inf to 0 dB in a single step. The same is true for a single precision Midi Slider. On a 14 bit Midi slider we have -6 dB after 12 Steps and -0.01 dB after 100 Steps This is 0.6 % of the slider = 0.6 mm on a 10 cm Slider.
My RMX2 controller has a 14 bit xfader of 4 cm and I cannot manage to set a value between - inf and -0.01 dB.

With Be's latest changes (kTransformMax = 10000.0), we have 10 Steps to -0.01 dB that is 0.06 % of the slider.

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

I'm not sure if I understood right the first question, so I'll answer it a little widely.

I have a Traktor Z2 (but it could be, for example, a Denon X600 or X1600, Traktor capable, but without software included). The crossfader is a mini Innofader (included in the Z2). I want to use a MixVibes control vinyl for scratching and, without another sound card, I can do it with Mixxx only in internal mixer mode (MIDI/HID). Scratching, beyond the called "baby scratch" (that hasn't any cut in its procedure), needs a crossfader that cuts the sound (not fading). Cuts could be so fast (scratch DJ's use cut-capable crossfaders since 90's at least), you can check it in any scratching video, like in this one: https://www.youtube.com/watch?v=y8b6TiXYAFQ And there is already commercial DJ software that make crossfaders cut-capable in internal mixer mode (Serato DJ, Traktor Scratch Pro, Cross, etc.). Nowadays scratch DJ's use them a lot since several years ago (because DVS).

The buffer size is set to 21.3 ms.

As I saw when testing (I looked for the cut point in the crossfader), I think this is not actually a movement distance problem in the crossfader, but in speed fading (cutting or "switching on") the sound by software when the crossfader sends the value for the change. The distance works, as I could see, exactly the same as in external mixer mode. Can't make Mixxx faster for this? I can test it with less steps than 10 (if possible) anyway.

Revision history for this message
Be (be.ing) wrote :

> I think this is not actually a movement distance problem in the crossfader, but in speed fading (cutting or "switching on") the sound by software when the crossfader sends the value for the change.

...

Here is your problem:
> The buffer size is set to 21.3 ms.

That is a bit high for scratching. Your buffer should be as small as your system can handle reliably without audible glitches.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

I the video in the initial post, do you use a time coded vinyl? I assume the buffer size is 21.3 ms I'm both cases?
I will analyze the recorded sound a and try to compare to compare the ramps. Maybe we can reduce the ramp internally for big buffers in the scratching case.t

An other idea, could be a mapping issue.
Mixxx suffers the issue that the we engine is not synced with midi. So it might happen, that it receives a LSB midi message first. Which leads to a 42.6 ms fade.
I will check that.
Please post the link and js file of the used mapping.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

One unrelated question:
Did you notice a difference between vinyl scratching and time code scratching regarding gain by tempo changes? I have done a pull request that is trying to fix that:
https://github.com/mixxxdj/mixxx/pull/602
Does it has any value for you?

Revision history for this message
Be (be.ing) wrote :

> An other idea, could be a mapping issue.
Mixxx suffers the issue that the we engine is not synced with midi. So it might happen, that it receives a LSB midi message first. Which leads to a 42.6 ms fade.

If Ambrosio is using the Z2 with MIDI, then he is using it through Native Instruments' proprietary driver that translates HID to MIDI. I do not know whether that uses 14-bit MIDI. It is plausible the driver may introduce some extra latency.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

I have measured the Video from the first post and I can clearly measure the 21.3 ms ramp up and down. While the first part only has ~3 ms.
The syncing is no issue, but it can be in theory.
So I think the best solution is to limit the ramp to 3 ms and remove all fading from the xfader curve at 1000 to avoid the theoretical midi race condition issue from above.
The 3 ms should be only applied for these hard -Inf t 0 transitions. Else a continuously fading is broken.
@Be: Do you have fun to adopt this, or should I take a look?

Revision history for this message
Be (be.ing) wrote :

Do you mean limiting the ramp time to 3 ms with the crossfader at maximum sharpness regardless of the configured buffer size?

> @Be: Do you have fun to adopt this, or should I take a look?

Finishing up the branches I have in progress already and mentoring Anast is enough work for me for now. Your proposed solution is more complicated than changing a constant, so I don't want to take it up right now.

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

Be, it's true: I set the audio buffer to 5.3 ms and it improved a lot (now it's acceptable for me). I didn't expect this, because with Traktor, cuts always sound practically like the real crossfader, no matter what buffer audio size use. Could anyone tell me why, please? Audio buffer in Mixxx is for actual processing audio instead of for already processed audio?

Anyway, I tested again and made screenshots of waveforms to check visually the difference: as you can see in the attached photo, Mixxx has always more ramp, even with 5.3 ms (but so long with 21.3 ms). It would be great to improve this: I agree with Daniel, that it would be great to reduce the ramp internally for big buffers. I tested with real and control vinyl, but I don't see the difference between real audio and DVS for this (I'll attach another one after this post).

Daniel, in the video, I used a real vinyl in both examples (because I just wanted to test the crossfader control). First, without software; and second with Mixxx 2.0.0@21.3ms.

Forget the beggining of the waveforms, the rest of sileneces (even the end) are cut by me with the crossfader.

The tags in the attached waveforms screenshot are:

No software: Z2 connected via USB to the computer, but with no DJ software opened.

Traktor 11.7: Scratch done with Traktor in internal mode, with 5.3 ms for processing and 6.4 ms for output (= 11.7 m)

Traktor 28.7: Scratch done with Traktor in internal mode, with 5.3 ms for processing and 23.4 ms for output (= 28.7)

Mixxx2-5.3: Scratch done with last official Mixxx realease (2.0.0) with 5.3 ms of audio buffer

Mixxx2-21.3: Scratch done with last official Mixxx realease (2.0.0) with 21.3 ms of audio buffer

Mixxx21-5.3: Scratch done with Ben's alpha Mixxx (PR1311-git6321) with 5.3 ms of audio buffer

Mixxx21-21.3: Scratch done with Ben's alpha Mixxx (PR1311-git6321) with 21.3 ms of audio buffer

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

This is with DVS. The wave is a human scream, so it's more irregular; anyway, the cuts are only when you see clearly the gaps (the end is not cut)

The tags are the same, but there is a difference: in Traktor 28.7, it has 21.3 ms of processing and 7.4 ms of output.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

> Do you mean limiting the ramp time to 3 ms with the crossfader at maximum sharpness regardless of the configured buffer size?

Yes.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

> Could anyone tell me why, please?

If you move the xfader in smooth settings from one end to an other, the user expects a smooth steady gain change.
The engine is only processed every 21.3 ms, it reads the current xfader position and calculates the samples played for the next 21.3 ms. So the only chance for a smooth gain change is to assume a constant steady xfader moment and put a 21.3 ms ramp on the gain signal.

This strategy fails in your case, where the opposite is expected.

Revision history for this message
Be (be.ing) wrote :

> limiting the ramp time to 3 ms with the crossfader at maximum sharpness regardless of the configured buffer size?

This seems like a reasonable solution and I think it would also make sense to do the same for the volume faders. Implementing this will require some complicated refactoring of the mixing engine,

Ambrosio, can your computer handle running Mixxx at a low latencies? Is that a workable solution for you for now? Why are you wanting to use internal mixing with the Z2?

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

Yes, it's workable for now, Ben, thanks. Besides, now I see it's more complicated than I expected to fix that (not just changing values)...

Well, because I purchased a Traktor Z2 with its software, I don't really need it; but I think that make a open source and free DJ software is great. Before the Z2, I purchased a second hand MixVibes DVS set, but had no software (it was lost). At that moment, if Mixxx already existed, it didn't support the MixVibes control vinyls yet. Besides, I didn't purchase the Denon X600 because it was ceased and I didn't find it when I had already the money, and it didn't include any software (and would need to use it in internal mode as well for DVS).

The short version: because I want to support Mixxx. I found that crossfader problem because I want to make a video scratching with it, so scratch DJ's without software can know that there is another (workable) option.

Thanks to both.

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

By the way, Daniel, to be honest, I didn't notice that; but now I was paying attention to that, it's true that the wave dooesn't sound louder when scratching, like with real vinyl. I compared scratching the "aaah" sound between Traktor, Mixxx and real vinyl, and both software achieve it! It's nice!

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

Ok, maybe that gain change it's too much in Mixxx... I'll tell you in the pull.

Revision history for this message
Be (be.ing) wrote :

I mean, why don't you use the unmixed Deck 1 & 2 outputs and use the Z2 for mixing instead of mapping the faders to Mixxx's software controls?

Revision history for this message
Be (be.ing) wrote :

Hmm, nevermind it seems the Z2 can't work that way unless you use another sound card. That's unusual.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Thank you very much for the picture.
I like to verify my magic formular using you vinyl player.
Could you record time code sound using your record player? Stating with normal speed, and then playing with minimum and maximum pitch, spin down and up cycle and finally a slow 0 to Max speed scratch.

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

Sure! Here you have it with the Traktor MKII...

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

...and here with the MixVibes (argh, dup MK2 comment!)

If you need more quality, another scratch pattern or something, let me know.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Thank you for the very useful recordings.
Did you use a phono preamp with a the Riaa curve applied?
I am asking, because gain increases much more in the fast region before the needle starts loosing vinyl contact. The curve applied in Traktor does just the opposite, less gain changing in the fast region.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Maybe Traktor uses such a curve because they want to avoid clipping at fast scratches?
From my test, when I have first worked on the vinyl gain PR, I notices less gain chaining in the fast regions but that happens by far later.
Your recording has an almost linear change up to 3 x speed.
You maximum speed is ~5x my curve will apply 5.5 dB in that case which should not clip with a reasonable gain leveling (headroom).

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

> Did you use a phono preamp with a the Riaa curve applied?
My turntables are directly connected to my Traktor Z2 mixer (of course with the input line switch in phono mode). I have no idea about its internal preamps, but as I can read in the first post in the link above, it seems that the answer to this question is yes.

https://www.native-instruments.com/forum/threads/very-low-line-phono-volume.186089/page-2

I don't know if the internal soundcard of the Z2 acts different with a MK2 control vinyl signal than the rest. Do you want another recordings with a different soundcard to be sure? I can record it with a M-Audio Audiophile 2496 or a Focus Scarlett 2i2 (1st generation)...

Revision history for this message
Daniel Schürmann (daschuer) wrote :

No, there is no need to do a recording with other gear. I believe the Z2 does the things just right.

We have now only the "issue" that probably no one likes to have insain gain on speeds > x 5.

So we have to bend the applied curve away from your turn tables model to not reach the clipping region, which is surly an undesired sound. Isn't it? Do you like the idea to not go above 6 dB ?

Revision history for this message
Ambrosio Barceló (bronxio) wrote :

Yes, I think that's a good shot, to limit it to 6 dB.

Be (be.ing)
summary: - Fastest cut for crossfader too soft for scratching
+ Sharpest crossfader cut time is coupled to buffer size
Changed in mixxx:
status: New → Confirmed
Be (be.ing)
Changed in mixxx:
importance: Undecided → Low
Be (be.ing)
Changed in mixxx:
milestone: none → 2.2.0
assignee: nobody → Daniel Schürmann (daschuer)
Revision history for this message
Daniel Schürmann (daschuer) wrote :

This is a mandatory basic function.

This should be a bug fix for 2.1 beta.
I hope it doesn't touch to much to still be considered as a bug-fix.

Changed in mixxx:
milestone: 2.2.0 → 2.1.0
Revision history for this message
Be (be.ing) wrote :

I agree that this is a basic function, but I think it will require quite a bit of complicated refactoring and I'm not sure it should be rushed for 2.1. But discussing this any further may be premature without seeing the code.

Be (be.ing)
Changed in mixxx:
milestone: 2.1.0 → 2.2.0
Be (be.ing)
Changed in mixxx:
milestone: 2.2.0 → 2.3.0
Be (be.ing)
Changed in mixxx:
milestone: 2.3.0 → none
tags: added: engine
removed: crossfader scratching
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8899

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.