Recording samples and playing them at random in Bespokesynth

Link to good samples/soundfonts at http://wiki.linuxaudio.org/wiki/free_audio_data

Moderators: MattKingUSA, khz

Post Reply
mcord
Established Member
Posts: 38
Joined: Mon Jul 03, 2023 10:32 am
Has thanked: 21 times
Been thanked: 8 times

Recording samples and playing them at random in Bespokesynth

Post by mcord »

In one of my Bespoke sessions, I reached the point where I started getting xruns just by letting a sequence play on loop. I soon realised the cause: I had a patch loaded in Cardinal that became a CPU hog. Since it only generated short percussive sounds and I didn't want to let them go, I turned them into samples.

Here's the workflow I applied:

  1. Have a basic pattern in drumsequencer, such as a four on the floor, and have it trigger Cardinal.
  2. Let it play for about 30 seconds, then hit 'write audio' (which exports the last 30 minutes).
  3. To save up free space, cut the exported audio with ffmpeg so that most of the unrelevant parts are discarded right away.
  4. Load the exported file in Ardour, chop up all (or the favourable) takes into individual regions, and export them.
  5. Back in Bespoke, load LSP Sampler Mono, and add several of the edited takes into the Sample Matrix, which are triggered depending on the incoming note's velocity.
  6. Use Bespoke's velocitysetter to randomise the velocity.

This works pretty well, although I'm curious if there's a simpler way to achieve this, preferably by using Bespoke's modules only.

Here are the modules I've considered so far:

  • sampler: The recorded sample sounds slightly different from the original. It plays the sample back in a pitch depending on the pitch of the incoming note, and I can't figure out the 'right' note to match the original.
  • sampleplayer: After exporting, I could load the recording back into this module and set cue points, which can be triggered by notes. (Hopefully I could also figure out how to randomise notes.) However, the problem is that when a cue point is triggered, playback starts about half a second before it. I would like to start right at where a cue point is.

Edit: I've just noticed that sampleplayer can also record and I got its name wrong.

User avatar
LAM
Established Member
Posts: 992
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 141 times
Been thanked: 349 times

Re: Recording samples and playing them at random in Bespokesynth

Post by LAM »

mcord wrote: Mon Dec 11, 2023 4:56 pm

However, the problem is that when a cue point is triggered, playback starts about half a second before it. I would like to start right at where a cue point is.

Make sure you have set up the cue points correctly (start and length times). If you have recorded a loop you can split the sample in multiple cues by clicking on the auto-slice buttons.

Attachments
sampleplayer.png
sampleplayer.png (234.34 KiB) Viewed 6024 times

in mix, nobody can hear your screen

mcord
Established Member
Posts: 38
Joined: Mon Jul 03, 2023 10:32 am
Has thanked: 21 times
Been thanked: 8 times

Re: Recording samples and playing them at random in Bespokesynth

Post by mcord »

LAM wrote: Mon Dec 11, 2023 5:37 pm
mcord wrote: Mon Dec 11, 2023 4:56 pm

However, the problem is that when a cue point is triggered, playback starts about half a second before it. I would like to start right at where a cue point is.

Make sure you have set up the cue points correctly (start and length times). If you have recorded a loop you can split the sample in multiple cues by clicking on the auto-slice buttons.

I double checked the start and length times, and they are all correct.

But here's the funny thing: If I use a drumsequencer to trigger the samplerplayer, like you did in the screenshot, it plays and stops the cues on time. On the other hand, if I use a MIDI keyboard, both the start and stop time are offset by half a second.

User avatar
LAM
Established Member
Posts: 992
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 141 times
Been thanked: 349 times

Re: Recording samples and playing them at random in Bespokesynth

Post by LAM »

mcord wrote: Mon Dec 11, 2023 5:44 pm
LAM wrote: Mon Dec 11, 2023 5:37 pm
mcord wrote: Mon Dec 11, 2023 4:56 pm

However, the problem is that when a cue point is triggered, playback starts about half a second before it. I would like to start right at where a cue point is.

Make sure you have set up the cue points correctly (start and length times). If you have recorded a loop you can split the sample in multiple cues by clicking on the auto-slice buttons.

I double checked the start and length times, and they are all correct.

But here's the funny thing: If I use a drumsequencer to trigger the samplerplayer, like you did in the screenshot, it plays and stops the cues on time. On the other hand, if I use a MIDI keyboard, both the start and stop time are offset by half a second.

That's because you are sending a note not associated to a cue. Cue 0 is triggered by MIDI note 0, Cue 1 is triggered by MIDI note 1 and so on. So when you send a note without a corresponding Cue it will trigger the entire sampleplayer content from the beginning.

in mix, nobody can hear your screen

mcord
Established Member
Posts: 38
Joined: Mon Jul 03, 2023 10:32 am
Has thanked: 21 times
Been thanked: 8 times

Re: Recording samples and playing them at random in Bespokesynth

Post by mcord »

LAM wrote: Mon Dec 11, 2023 5:53 pm

That's because you are sending a note not associated to a cue. Cue 0 is triggered by MIDI note 0, Cue 1 is triggered by MIDI note 1 and so on.

Actually, I did notice that. :) I used a noteoctaver, set it to -3, and pressed the keys C2, C#2, D2 etc. (but changing the octave on the keyboard itself also works). So in the end, the MIDI notes did match the cue numbers, but their play positions were offset still. To confirm this, I tried manually shifting the start and stop positions (e.g. changed 0.396 to 0.896) and sure enough, they played correctly.

I'm going to say this though: Initially, I had trouble autoslicing the recording because the cue points didn't line up for me. Then I noticed the checkbox 'record as clips' on your screenshot. I also had to increase threshold a bit, but enabling the checkbox not only took care of slicing the cues automatically, but the offset problem also went away! So now, every cue starts right on time when triggered by either the MIDI keyboard or the drumsequencer.

Edit: I've just tried again. First, I loaded an external sample in a sampleplayer, then I played and routed it into a second sampleplayer while in record mode. I can still reproduce the problem in the first module, but not the second one.

LAM wrote: Mon Dec 11, 2023 5:53 pm

So when you send a note without a corresponding Cue it will trigger the entire sampleplayer content from the beginning.

OK, that's good to know! :)

Thank you for your help!

User avatar
LAM
Established Member
Posts: 992
Joined: Thu Oct 08, 2020 3:16 pm
Has thanked: 141 times
Been thanked: 349 times

Re: Recording samples and playing them at random in Bespokesynth

Post by LAM »

mcord wrote: Mon Dec 11, 2023 6:23 pm

Edit: I've just tried again. First, I loaded an external sample in a sampleplayer, then I played and routed it into a second sampleplayer while in record mode. I can still reproduce the problem in the first module, but not the second one.

It looks like a bug, I can't reproduce it though. Would be nice to report it with a savestate.

in mix, nobody can hear your screen

Post Reply