lsp-plugins icon indicating copy to clipboard operation
lsp-plugins copied to clipboard

Sampler: support pitching sample

Open Bleuzen opened this issue 3 years ago • 10 comments

So currently you can set one midi note in the sampler plugin which plays the sample. But sometimes I want to use the sample in different pitches. So the other midi notes could be used for that instead of doing nothing, playing the sample pitch shifted.

Bleuzen avatar Nov 18 '21 18:11 Bleuzen

At this moment, we have no pitch algorithm implemented in the DSP libraries. This can be done but not soon and after 1.2.0 release.

sadko4u avatar Nov 18 '21 23:11 sadko4u

Would it be easier to implement pitching but without time stretch correction? (only changing sample rate?) So that the sample played at a lower note is also longer and played at a higher note is shorter. This is the implementation I'm used to because this is what LMMS does, so this is fine. In the long run, there could be a toggle to apply time/length correction or not.

Bleuzen avatar Nov 19 '21 11:11 Bleuzen

This is the implementation I'm used to because this is what LMMS does, so this is fine.

I think samplv1 does this as well.

IcedQuinn avatar Apr 12 '22 00:04 IcedQuinn

Lsp-samplers are very good but what we miss (on linux at least) is something like samplv1 but with multisample (and multiout) support.

Daniele71 avatar Jun 02 '22 11:06 Daniele71

A simple sample pitching algorithm has been introduced in the LSP Sampler tool. It allows to ptich the sample in range of -24..+24 semitones by applying the resampling to the original sample. Here's the related pull request: https://github.com/lsp-plugins/lsp-plugins-sampler/pull/2 This change will be available in 1.2.2. Still, mapping the sample to the range is not possible at this moment.

sadko4u avatar Jun 02 '22 12:06 sadko4u

So if there is a pitching algorithm, we just need a mode where the user can select the root note and other incoming midi notes pitch the sample accordingly

derkrasseleo avatar Nov 12 '22 23:11 derkrasseleo

So, is this possible by now? And would this be implemented in the "normal" sampler plugin or would it require a separate plugin? For me, an option in the current sampler plugin for "pitch according to midi note", which can be set as default, would be sufficient.

derkrasseleo avatar Jan 09 '24 19:01 derkrasseleo

At this moment we still have no pitching algorithm. No idea about when this happens as we have set of more prioritized tasks to do.

sadko4u avatar Jan 09 '24 22:01 sadko4u

At this moment we still have no pitching algorithm. No idea about when this happens as we have set of more prioritized tasks to do.

Thanks for the update. How does the pitching in the sampler plugin work then? Because you mentioned in your last comment that a pitching algorithm has been implemented, I assumed that was it.

derkrasseleo avatar Jan 10 '24 08:01 derkrasseleo

There is a difference between real-time sample pitching and pitching samples in offline. Pitching samples in offline can be simply done by oversampling. The final sample becomes a bit longer. With online processing it is not so trivial. Here's a good video about implementation of different pitch algorithms:

https://www.youtube.com/watch?v=fJUmmcGKZMI

As we see, they can be pretty greedy to CPU resources and introduce additional latency, especially if you're playing multiple samples at the same time.

sadko4u avatar Jan 10 '24 12:01 sadko4u