code your own sampler (SynthEdit)

Modular Synth design and releases (Reaktor, SynthEdit, Tassman, etc.)
Post Reply New Topic
RELATED
PRODUCTS

Post

released two sampler sems both with source -

http://www.xoxos.net/sem/sample0.zip
this is an elementary file.. loads wav, triggers play on gate, changes pitch. you should be able to look at the source and figure out what's what, and what you can change in order to add the features you want.

it's not optimised or particularly informed (it works but may not be the best or the conventional way of doing things) so don't take the code as scripture, but it's simple ;)

it loads all the 8 and 16 bit wav i tested... the wav loading routine is definately not coded with proper consideration for the variety of wav formats, and it has a real crappy, cheeky bit of code that will load a few more.


http://www.xoxos.net/sem/sample1.zip
this version is not optimised et c. either. it adds loop and start and end points, and wrap/bounce looping modes. reverse play is accomplished by making the start position higher than the end position. i finished late, so hopefully i caught everything...

neither have interpolation (there's code in the pdf on the sem page) both have sleep added, so they ought to work as a basis for modding :)
Last edited by xoxos on Fri Aug 31, 2012 5:42 pm, edited 1 time in total.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

xoxos wrote:released two sampler sems both with source
Cool. Nice to see worked examples.

Is it just me, or is SynthEdit seeing a revival of interest after SynthMaker turned into an 'also for musicians, honest' robotics project?

The links above didn't work, but a peek into the directory revealed that the actual zipfiles have no 'r' (sample, not sampler):

http://www.xoxos.net/sem/sample0.zip
http://www.xoxos.net/sem/sample1.zip

Post

ty much for catching that.. changed links in first post ;)

"coffee" is what i say
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

1 sounds like http://www.xoxos.net/sem/sample1.mp3

samples are:
feed pellets poured into a ~snaredrum sized plastic bowl
previously fft processed voice made more interesting
70's tv voice recorded off youtube through laptop headphone jack back into soundcard

interpolation and optimisations are next.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

Cool, thanks for the modules, I loaded them real quick to look, haven't tried them yet.

I generally use ck for drum samples and dh waveplayer for audio effects testing.
The only site for experimental amp sim freeware & MIDI FX: http://runbeerrun.blogspot.com
https://m.youtube.com/channel/UCprNcvVH6aPTehLv8J5xokA -Youtube jams

Post

source code + fft module:

http://www.xoxos.net/sem/fft0.zip

the fft doesn't do anything in the included module except delay the signal and use a ton of cpu. the source code includes the cartesian > polar transform so you can process the signal spectrally.

i recommend dspguide.com for an introduction to fft.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

next version:

http://www.xoxos.net/sem/sample2.zip

this adds 3 interpolation options: round down (none), linear and cubic. there's still no crossfading on looping but i think today's ears are more used to that sound.

maybe some of this will be useful to people for the developer challenge :)
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

if you d'led 2 yesterday, it's been updated (one line, phase increment) to handle reversed loop points in wrap mode

(eg. if
start is 3
end is 10
loopstart is 9
loop end is 7

it used to jump to inside the loop at trigger.. now it play to 9, then loops (reverse plays to 7).

a crossfaded version is about finished, i'm fiddling with a 2nd xfade mode that crossfades up to the length of the loop.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

here's sample3, which adds two modes of crossfading. one is in ms, the other is 0-10v relative to the length of the loop. note that crossfading only applies in wrap mode, not in bounce mode.

http://www.xoxos.net/sem/sample3.zip

sounds like
http://www.xoxos.net/sem/sample3.mp3

you can hear the crossfading.. should be useful for creative effects, like a 2 position granular :p

it should be pretty much end-user enjoyable now. there may still be clicks/discontinuity artifacts in two cases:

1) when the loop start and end points become the same
2) when the loop wraps again before the crossfade has expired (never happens in loop-relative mode)

(there are a few ways to address these, i'll probably add a mass-spring that gets fed the step value.. oh yeah and when you switch between crossfade modes if it's playing it will make noise)


UPDATES to sample1 and sample2:

the source and module have been updated - i discovered that when loop start was higher than loop end, the play position was jumping straight into the loop when triggered.

the first time i tried to fix this (previous post..) if you swept the loop points past the read position, it would tug the read position with the loop points and cause nasty squiggly audio. (i remember seeing someone else find this out too..)

i fixed this by adding a bool to indicate whether the loop had been entered after the sample was triggered. this modification produces desirable performance when loop points are scrubbed with no distorted audio.

source and modules updated:
http://www.xoxos.net/sem/sample1.zip
http://www.xoxos.net/sem/sample2.zip

IF you have already started modifying these modules for your use, here are step-by-step instructions to add the improvement (you can spot these in the new source code) -

1) add bool inloop; variable in header
2) add inloop = 0; statements to gate trigger, wav loading, and file opening.
3) replace "wrap" section of code in "if (loop)" statement with this:

Code: Select all

if (!(pf < looplow || pf > loophigh)) inloop = 1;
if (inloop) {
	i = dir * swap;
	pf += inc * i;
	if (i > 0 && pf > loophigh) pf = looplow;
	if (i < 0 && pf < looplow) pf = loophigh;
}
else pf += inc * dir;
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

(updated sample3.. crossfade did bad things when switching between wrap and bounce.. source and module updated)

*edit*
(updated sample3 again.. some list entries were sticking)
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

these were presented to inspire development.. they should still be serviceable :) #3 should give you click free loop manipulation as long as you use the crossfade.. the ability to use up to the entire loop for crossfading gives different creative options than dave's module :)

i didn't have it in mind to release a vst with these because hopefully there are enough like this already. if there's a feature you think it's missing let me know.

the only one i could think of was a loop position out (functioning as an envelope for cutoff or other effects).

i could also add internal controls so that loop position can be curved and routed to pitch.. easy to add but would use a bit of cpu.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

xoxos wrote: if there's a feature you think it's missing let me know.
Hi,

It is very nice to see this new development !

One thing I have asked to Dave and to Chris Kerry was to support multichannel wav files.
It didn't seemed to be too complicated, but also not a massive request...
The simplest way was to allow to play all the channels present in the wav, and let the user choose how much audio outputs he wants.

So it would be wonderful if you can add it, either wave_extensible or standard PCM !

Post

ty. the wav loading function i use is minimal.. it loads all of my 8 and 16s, but it doesn't start to deal with different formats. (it loads whatever it gets into floats between -1 and +1)

i'm not prepared to code it to handle every kind of wav out there (mainly since all i see are intimations that there is no inclusive definition of form). if one knew what kind of file one was loading, it would be simple to add multichannel.

a se list user reported that sample2 crashes when it receives a gate. haven't heard anything else about this.. it did occur to me that the wav loading function may load the wav separately for each voice of polyphony at present.. i'll look into that, it's not something i've done well before.

no crashes here.. i made a next version but i'll check the crash and poly before i post more.

next one adds:
reset file on gate option
loop position out
loop point smoothing (i commented this out.. it doesn't make a significant difference)
hermite interpolation
switched to doubles for loop coefficients (better loop point resolution and crossfade in short loops in long samples)
alternate wrap mode (decommented.. pointer wrapped by loop length, not reset to loop point, the only place i could hear the difference was loop lengths less than two samples, so nyquist is okay)
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

can anyone verify that these modules do run on anyone else's system? ty :D
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

been lookin fwd to testing this,the kids r back at skool tomorrow.

Post Reply

Return to “Modular Synthesis”