Working with samples

Post Reply
ymerejsasnak
Posts: 69
Joined: Thu Jun 04, 2020 2:08 am

Working with samples

Post by ymerejsasnak »

Hello

I'm using the SamplerVoice and SamplerVoiceProgram classes to make a sampler module. My main question is, is there a built-in/easy way to change the sample start offset? I only see values for loop points. If not, is there any decent way I could achieve this without having to ditch these classes and completely code my own sampler class(es)? I guess, in the long run, that might be best given how many ideas I have for modules based around samples/sampling, but any input on this from any angle from anyone would be appreciated. :)

Also, what is the distinction between the above Sampler classes and the VoltageSound class? I haven't really explored the VoltageSound class at all yet, so maybe it should be obvious. Is the VoltageSound class a more generalized way of working with sampled audio? I guess I'm confused by the apparent overlap and lack of documentation. But I think this class maybe be the answer to my first question...and based on some methods it looks like it may simplify file loading vs SamplerVoiceProgram...hm...

On that note, we ever going to get more detailed documentation on all this stuff? ;)

JK
ymerejsasnak
Posts: 69
Joined: Thu Jun 04, 2020 2:08 am

Re: Working with samples

Post by ymerejsasnak »

ah...so I didn't realize...VoltageSound is a subclass of VoltageComponent...that seems to almost point me to some enlightenment except...nope...I think I'm more confused now, since I generally think of components as knobs, sliders, jacks, etc.
JackOats
Posts: 130
Joined: Sun May 12, 2019 4:09 pm
Location: KENT, UK.

Re: Working with samples

Post by JackOats »

On that note, we ever going to get more detailed documentation on all this stuff? ;)
+1. :!:
iMac 27/Catalina/3.5 GBh Intel Core i7/16 GB Ram/3 TB HD
The masculine includes the feminine (Guys)
Google: 'JackOats' to see my Soundcloud page, 'Brian Watterson - Vimeo' for my Videos.
ymerejsasnak
Posts: 69
Joined: Thu Jun 04, 2020 2:08 am

Re: Working with samples

Post by ymerejsasnak »

Just an update for anyone interested:

Figured out one way at least. When I want the sample offset to change, I recreate the SampleVoiceProgram with a new SampleVoiceProgram.SampleInfo where the ByteBuffer that I feed it is offset by the appropriate number of bytes (bytes! not samples). It seems to be working as I expect, but I have plenty of doubts about whether this method is really the best way to go about this...

I still hope to hear from SOMEONE else on this topic, but even if not I will try to post here again as I go further so there is at least a little bit of forum material about this stuff.

JK
User avatar
Captain
Posts: 103
Joined: Sat Aug 25, 2018 11:12 am

Re: Working with samples

Post by Captain »

Not sure if this is of any help, but when I started working on my granular module (which has been WIP forever now...), I first experimented with VM’s sampler classes. I was also looking for things like being able to start sample playback at any position, etc. Pretty soon I gave up, either because the classes just couldn’t do what I wanted, or because I couldn’t understand how to do that. :D Anyway, I ended up creating my own sample playback code, which also allowed me to fully control things like interpolation, antialias filtering, playback speed and direction, etc. Maybe you are still able to use the classes VM provides, but creating your own from scratch maybe isn’t completely out of the question.
Post Reply

Return to “Module Designer”