surge-synthesizer / shortcircuit-xt

Will be a sampler when its done!
GNU General Public License v3.0
253 stars 30 forks source link

Sample mapping: what it is, how it used to work, and how it should work #63

Open mkruselj opened 3 years ago

mkruselj commented 3 years ago

image

SC1 had this mapping editor view (keygroup view), which is way better than SC2 to be honest (and also in line with pretty much any other sampler - pitch horizontally, velocity vertically).

You drop a sample in (or multiple samples), and then you can drag them by the edges to change the key and velocity boundaries. In SC1 shift+dragging a boundary added key or velocity fade. Multiselection of zones was not possible but this is obviously a must.

It also used a kludgey < - + > setup for scrolling and zooming. Let's use horizontal/vertical scrollbars and mousewheel for this instead!

You can see the virtual keyboard there. You could click on a key and it plays that note. You can see that one of the keys in the virtual keyboard there is gray instead of black or white. That's the root key for the currently selected zone. We should be able to drag and drop that gray key elsewhere in order to change the root key (neither SC1 nor SC2 could do this, annoyingly).

You can see the top info line (where < - + > buttons are) has some info about the currently selected zone. This was just text in SC1, but we should make it editable (numfields) in SC3. This is in line with samplers such as Kontakt. Super handy to have it there. It doesn't mention velocity or key fades here but it should. We have enough room.

There are no right-click context menu options here whatsoever, which is a shame. We could improve things a lot by adding useful zone mapping features in here, let's take hints from Kontakt:

image

Most things in that screenshot should make logical sense even if you've never used Kontakt (disregard the AET stuff, that's very Kontakt specific).

You can see that Kontakt's mapping editor has some buttons in the toolbar. Those are some very handy functions, like auto-stretching the selected zones horizontally or vertically in order to fill the "holes" in the mapping:

image

resolving overlapped zones horizontally or vertically:

image

setting the keyrange or velocity range of selected zone via MIDI (by playing two successive notes):

image

locking the mapping (so that you don't mess it up accidentally by a mouse drag):

image

and so on.

You can also see the filename of the sample loaded into the selected zone, and also exchange it by jogging prev-next across the folder in which that sample originates:

image

It shows just the filename, but full path to the sample shows up when you hover above the filename in the tooltip.

I guess this is enough for starters. We can add stuff as we see fit later on through separate issues.

mkruselj commented 3 years ago

Oh yeah. Here's another great thing from Kontakt:

Kontakt_zone_drop

If your drag-and-drop consists of up to 127 samples, they can be dynamically mapped from all-on-one-key through to one-sample-per-key to all-samples-overlapping simply by using vertical mouse cursor position in the mapping area. Super handy stuff!

djtuBIG-MaliceX commented 3 years ago

That drag and drop def looks like an excellent workflow idea.... though based on how the sample loading behaviour currently works, some refactoring may be required to allow this kind of behaviour. I think at the moment the key ranges are fixed or otherwise predetermined on initial load of samples, so some additional handling will be necessary.

Also with more larger sample sets, this can also blow out load times too during drag and drop operation, though I'm not sure how Kontakt manages this. Does it just render zone hints based on the patch metadata, and only load the samples after releasing mouse button?

baconpaul commented 3 years ago

The keys ranges are a parameter you can edit, just we need to figure out the messages synth -> ui to set up the shadow zones and ui -> synth to modify them, just FYI

rudeog commented 3 years ago

My opinion is that when we get a drop, we should determine whether it's a single wave file, or an import (with multiple zones, etc) and if the latter, we should give the user some options. Eg. blow away existing patch, let the user pick individual samples from the imported patch, etc. So really for individual waves, it makes sense to let the user drop these on a specific key (as the existing sc1 works) but for multi, the user will probably want to do something different.

baconpaul commented 3 years ago

I agree with all of that.

I think also, though, getting some of those bidirectional property edits into the UI would be super good. I had started that with the proxy thing (and that code’s all merged) but didn’t get to the point of actually making it do much as far as editing a zone.

With @djtuBIG-MaliceX ’s change to remove all the ASM and yours and their change to fix up the other sample formats, I think the engine is actually doing OK now; just we need to think about the window on the oven and deal with the somewhat ... persnickety ... but nonetheless clever bidirectional message bus between the UI and the synth.

mkruselj commented 3 years ago

Also with more larger sample sets, this can also blow out load times too during drag and drop operation, though I'm not sure how Kontakt manages this. Does it just render zone hints based on the patch metadata, and only load the samples after releasing mouse button?

No, nothing like that! The drag and drop that I showed above is just a simple linear scaling of zone widths or heights based on vertical mouse position and number of samples dropped in (with a maximum of 127 samples supported in the drop, for obvious reasons of having a maximum of 127 velocities to map to). Easy stuff, no metadata scanning.

mkruselj commented 3 years ago

My opinion is that when we get a drop, we should determine whether it's a single wave file, or an import (with multiple zones, etc) and if the latter, we should give the user some options. Eg. blow away existing patch, let the user pick individual samples from the imported patch, etc. So really for individual waves, it makes sense to let the user drop these on a specific key (as the existing sc1 works) but for multi, the user will probably want to do something different.

We should add these extra options on a key modifier, like in UVI Falcon. By default, multi file drop works exactly as in Kontakt (as in that GIF above), and only if you hold Alt you get extra options for automapping based on filename tokens or metadata.

rudeog commented 3 years ago

So in that situation, what would be the default behavior if eg the user had already mapped a few waves onto the keyboard and then dropped eg an akai patch with samples already mapped across keys?

mkruselj commented 3 years ago

Dropping a patch is something else, the above GIF pertains purely to user sample mapping. Dropping a patch should pop a query to ask for replacing current state of SC, or merging that patch with what is already loaded in a new part (multitimbral/multichannel workflow).