Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharpest crossfader cut time is coupled to buffer size #8899

Open
mixxxbot opened this issue Aug 23, 2022 · 34 comments
Open

Sharpest crossfader cut time is coupled to buffer size #8899

mixxxbot opened this issue Aug 23, 2022 · 34 comments

Comments

@mixxxbot
Copy link
Collaborator

Reported by: bronxio
Date: 2017-07-10T23:33:40Z
Status: Confirmed
Importance: Low
Launchpad Issue: lp1703475
Tags: engine
Attachments: [Scratch waveforms (with real vinyl).jpg](https://bugs.launchpad.net/bugs/1703475/+attachment/4914309/+files/Scratch waveforms (with real vinyl).jpg), [Scratch waveforms (with control vinyls).jpg](https://bugs.launchpad.net/bugs/1703475/+attachment/4914317/+files/Scratch waveforms (with control vinyls).jpg), [scratch gain comparison.JPG](https://bugs.launchpad.net/bugs/1703475/+attachment/4914336/+files/scratch gain comparison.JPG), [pitch changes@10, 20 & 50%](https://bugs.launchpad.net/bugs/1703475/+attachment/4914901/+files/pitch changes@10, 20 & 50%), [pitch changes at 10, 20 & 50 percent](https://bugs.launchpad.net/bugs/1703475/+attachment/4914902/+files/pitch changes at 10, 20 & 50 percent), [pitch changes at 10, 20 & 50 percent](https://bugs.launchpad.net/bugs/1703475/+attachment/4914903/+files/pitch changes at 10, 20 & 50 percent)


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)
  • [email protected]
  • Intel HD Graphics 3000 and Native Instruments Traktor Z2 (ASIO driver)
@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-07-11T00:14:34Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-07-11T00:23:56Z


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:
#1308

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-11T12:04:33Z


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)

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-07-11T12:26:40Z


Please report a new bug for that issue.

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-11T12:49:42Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-12T17:00:06Z


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).

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-12T21:20:37Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-12T22:29:52Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-07-12T22:52:55Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-13T06:32:12Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-13T08:23:26Z


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:
#602
Does it has any value for you?

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-07-13T14:01:12Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-13T19:44:17Z


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?

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-07-13T21:28:43Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-13T21:31:42Z
Attachments: [Scratch waveforms (with real vinyl).jpg](https://bugs.launchpad.net/mixxx/+bug/1703475/+attachment/4914309/+files/Scratch waveforms (with real vinyl).jpg)


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 [email protected].

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

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-13T21:36:54Z
Attachments: [Scratch waveforms (with control vinyls).jpg](https://bugs.launchpad.net/mixxx/+bug/1703475/+attachment/4914317/+files/Scratch waveforms (with control vinyls).jpg)


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-13T21:53:19Z


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

Yes.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-13T21:59:14Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-07-13T22:26:58Z


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?

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-13T23:04:25Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-13T23:22:50Z
Attachments: [scratch gain comparison.JPG](https://bugs.launchpad.net/mixxx/+bug/1703475/+attachment/4914336/+files/scratch gain comparison.JPG)


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!

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-13T23:28:50Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-07-14T01:15:45Z


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?

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-07-14T01:36:13Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-14T12:00:59Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-15T00:11:51Z
Attachments: [pitch changes@10, 20 & 50%](https://bugs.launchpad.net/mixxx/+bug/1703475/+attachment/4914901/+files/pitch changes@10, 20 & 50%)


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

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-15T00:20:31Z
Attachments: [pitch changes at 10, 20 & 50 percent](https://bugs.launchpad.net/mixxx/+bug/1703475/+attachment/4914903/+files/pitch changes at 10, 20 & 50 percent)


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

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

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-30T21:44:04Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-30T22:11:07Z


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).

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-30T23:59:19Z


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)...

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-07-31T06:15:41Z


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 ?

@mixxxbot
Copy link
Collaborator Author

Commented by: bronxio
Date: 2017-07-31T16:48:36Z


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

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-12-28T10:12:59Z


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.

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-12-28T14:53:25Z


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant