Is there a mode for stopping current sample when a new sample is started?

Pretty simple question. I’m using the sampler deck and triggering it via a midi controller. I’d like the current sample playing to stop whenever a new sample is triggered. Is that possible?

Yes, you can add that task into the controller script. It’s actually a good idea. I check for my script as well. The controls list was moved from wiki to manual…

This is untested but my modified Sampler code would look like this. I just added the lines between the // marks

var i, j;
for (i = 1; i <= 8; i++) {
    if (control === 0x14 + i - 1 && value >= 0x01) {
        if (engine.getValue("[Sampler" + i + "]", "track_loaded") === 0) {
            engine.setValue("[Sampler" + i + "]", "LoadSelectedTrack", 1);
        } else if (engine.getValue("[Sampler" + i + "]", "track_loaded") === 1) {
            for (j = 1; j <=8; j++) {
                engine.setValue("[Sampler" + j + "]", "cue_gotoandstop", 1);

            engine.setValue("[Sampler" + i + "]", "cue_gotoandplay", 1);
    } else if (control === 0x1C + i - 1 && value >= 0x01) {
        if (engine.getValue("[Sampler" + i + "]", "play") === 1) {
            engine.setValue("[Sampler" + i + "]", "cue_gotoandstop", 1);
        } else {
            engine.setValue("[Sampler" + i + "]", "eject", 1);
            engine.setValue("[Sampler" + i + "]", "eject", 0);

Thanks, this looks like what I want, but which file should I edit and add these lines? Grepping for these lines got me no results in /usr/share/mixxx

first i assume from the path given that you are on Linux… which controller do you use? Each controller has got a xml and a js file linking the Midi inputs with Mixxx controls.

The WIKI got a good, detailed section about how to contribute to map hardware, where the user accessible files are located and how to add or modify the controller related scripts.

Your dedicated controller files (xml and js) should be copied from /usr/share/mixxx/controllers/ to ~/.mixxx/controllers so you will have a 2nd version that you can easily modify and select separately for your hardware within the preferences.

Now I had some time to test and it is working as expected. So you could use the line to stop samplers as I sent it just before starting the new sampler. Just make sure you catch all samplers. My mapping for the MC7000 only provides 8 but if you run 64 samplers let the loop for var j run up to 64. This likely would add latency and you need to try how reliable this will be.

I’m using a Roland Edirol PCR-300, there weren’t any ready made mappings and I assigned the play buttons via midi learn. It seems I’d need to make a new controller script for my interface right? It’s a lot for me to learn right now, but I solved it in a different way.

I editted the .xml controller file generated with midi learning to send a cue and stop event for every sampler each time a button is pressed. It’s a lot of redundant events but I generated them using a find/replace script and it’s working for now.

If there’s any place where I could find mapping for my device os some template scripts I could modify I’d like to know so I can make this work properly in the future.

Thanks for the help.

Yeah, the learning wizard is only useful to start a mapping as the XML file can only handle simple actions. For some more complex stuff Javascript should be used. I didn’t have any idea about coding and still don’t have really but with the many examples from the wiki and other mappings I got my mc7000 programed. Maybe you can open another topic for your device mapping and share the work you already got. Upload your mapping and maybe other people have a same device and could participate or even help to improve your initial work. Anyhow, have fun…

PS: would really like to see your use case running that keyboard with Mixxx.

It’s a really simple use case right now. I use OBS and several Linux software to stream gameplay, music performance and music production videos on Twitch. I wanted a way to configure one time samples to be played for comic effect whenever I felt like and the alternative software made for this use case on Linux are very buggy or lack features (Soundcaster and Soundux). Since I already use Jack Server mixxx fits this use case like a glove and I can slowly integrate other features as I see fit.