8 voices Sample Player


#41

thank you so much!
It is way more understandable for me now!
Env is perfect for VCA, it is just that it was not working right outside the subpatch and it was cutting the sound very short.
I added the HQ filter inside the subpatch and the 12bit quantizer and the mutable chorus in the main and it is perfect!!!
What's the difference between the HQ and normal filter?

It sounds super nice!
:heart_eyes:
sampleUPDTE.axp (8.3 KB)


#42

hello @thetechnobear I encounter a weird behavior, when i load a sample in the table it sometimes plays the one previously loaded in the table when the currently loaded one reaches its end. the part of the sample seems be shorter at each stroke.

sampleur2.axp (8.0 KB)

mp3


#43

Could this be linked to the way things are positioned and therefor computing order?
it was like this

Should it be more like this?


#44

regarding the problem when loading a new sample, anyone knows if there's a way to "flush" the buffer before doing it?


#45

Very interested in that too. Following.


#46

@krikor sorry, not had time to look at this... since to give you a proper answer would require me to decipher you patch.

this could be execution order, but if you are using table/load (or using an object which uses the same logic) it could also be down to the fact that the load is done asynchronously with respect to the audio thread. this is because its a very big no no to do IO (e.g. access sdcard) in the audio thread, as it can block it and cause audio glitches.
so what could be happening is your asking it to be loaded, and then triggering the sample before it has completed loading.
Ive been meaning to add a 'loaded' output on the table/load so patches know when its fully loaded.

practically (as in its not theoretically correct, but should work), you can workaround this by using two tables, that you alternate between i.e. you load into one, whilst doing playback on the other, and then switch this around. (often referred to as double buffering) you'll have to use a 'guestimate' delay to decide when to switch buffers, due to the table/load not telling you when loading is complete.

it would actually be quite trivial to create a new object which does this 'behind the scenes' if you know c++.

what do you mean by flush? you mean set all samples to zero?
this is trivial to do, but its probably not the right solution, as it wastes cpu cycles.
I assume your use cases are

a) to have an empty buffer... but in this case, you just need to know the buffer should be empty, and not play it

b) because the new sample is shorter than the old sample
I guess this is the main case...
again, set the whole buffer to zero before hand is wasteful, there are two solutions to this
after the load, we could set the remaining bytes of the table to zero... (so less bytes that doing entire buffer), but better still would be to report the end position after table/load such that when you playback a sample, you don't ever playback past the endpoint (this saves even more cpu cycles)

ive actually been meaning to add the 'end position' to table/load as well, but again, not been a pressing priority for me, so not got around to it. (honestly, i don't do much sample playback)


#47

thanks.
The end position function would the best indeed!
A workaround for me will be to add some silence after the audio in each sample, which would be like setting the remaining bytes or part of the remaining bytes of the table to zero.
The double buffer would add some ram/cpu usage, as I'm trying to save some to add effects to the chain, the sample modification with silence still seems a better option.


#48

Silence won't help you on the table load not being completed in time.

Memory should not be an issue if you are using sdram ( unless your doing really long samples/delay lines) , double buffering will not increase CPU usage.

Another , even simpler alternative, is to use a mux which is routing silence on one inlet, and whilst you 'think' loading is taking place , switch to silence.

The thing is with audio programming, particularly with limited resources, the most obvious solution is not always the best - unlike programming on , say, a PC you can't afford to squander CPU cycles.

( that said memset won't cost much , though it makes the object operate in non linear time , which again is against audio programming discipline)


#49

Hello,
I've been away from my Axolotl for a few month and I'm back at it.
I'm gonna try to do the double buffer thing, but I'm a bit unsure, should I make two tableplay or should I go for something that will string which buffer table to use in a tableplay (is this possible actually?)
best
K


#50

actually I just rechecked this, table/load is doing the load synchronously in the audio thread... I got this wrong, as this is pretty much a no-no - so I'm really surprised its been done like this (and I know other code is doing this kind of activity in a separate thread!) ... its bound to cause audio glitches if you start loading large samples, or your patch is cpu intensive.
this also means double buffering wont help, since the load is already stalling the audio thread, and therefore also the table/play

as for your glitch, yeah ideally, you should create samples the 'right' size, and then put silence on the end, at least till this gets revisited, and somewhere the length is known, so table/play can stop when it gets to the end.


#51

Ok. I already did, with 2 seconds it helps sometimes. The glitch is quite weird, like some ghost patch playing on note release, it actually makes sometimes nice things :slight_smile:


#52

hey,how could table/load be done in a different thread?
I'm looking for a solution for this since quite some time,but it definitely exceeds my coding skills :expressionless:


#53

I'm trying to add some reverb presets loading with each sound (different preset for each sound).
I'm using the fx/lmnts/reverb cause it sounds quite nice and all controls are assignable.
The idea would be to use the same program change to select presets of the 5 parameters.
I must say i really don't know which way to handle this