Plug-ins, Hosts, Apps,
Hardware, Soundware
Developers
(Brands)
Videos Groups
Whats's in?
Banks & Patches
Download & Upload
Music Search
KVR
   
KVR Forum » Modular Synthesis
Thread Read
code your own sampler (SynthEdit)
Goto page 1, 2, 3, 4, 5, 6, 7  Next
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Fri Aug 31, 2012 9:18 am reply with quote
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 Wink

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 Smile
----
neither a follower nor a leader be
http://www.xoxos.net - free vst

Last edited by xoxos on Fri Aug 31, 2012 9:42 am; edited 1 time in total
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
Nantonos
KVRist
- profile
- pm
- e-mail
PostPosted: Fri Aug 31, 2012 9:38 am reply with quote
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
^ Joined: 13 Aug 2012  Member: #286018  Location: France
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Fri Aug 31, 2012 9:43 am reply with quote
ty much for catching that.. changed links in first post Wink

"coffee" is what i say
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Fri Aug 31, 2012 11:13 am reply with quote
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.
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
RunBeerRun
KVRAF
- profile
- pm
- www
PostPosted: Fri Aug 31, 2012 11:58 am reply with quote
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.
----
Free MIDI arpeggiators, clearest amp sims on the net: http://runbeerrun.blogspot.com
^ Joined: 02 Aug 2005  Member: #76855  Location: Katie Couric blasters
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Fri Aug 31, 2012 1:57 pm reply with quote
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.
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Fri Aug 31, 2012 5:01 pm reply with quote
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 Smile
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Sat Sep 01, 2012 8:34 am reply with quote
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.
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Sat Sep 01, 2012 1:05 pm reply with quote
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:


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;
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Sat Sep 01, 2012 2:20 pm reply with quote
(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)
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Sun Sep 02, 2012 11:36 am reply with quote
these were presented to inspire development.. they should still be serviceable Smile #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 Smile

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.
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
acousmod
KVRist
- profile
- pm
- www
PostPosted: Mon Sep 03, 2012 4:11 am reply with quote
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 !
----
Jean-Marc Duchenne
http://acousmodules.free.fr
^ Joined: 27 Jan 2004  Member: #12041  Location: France
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Mon Sep 03, 2012 12:12 pm reply with quote
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)
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
xoxos
Mr Entertainment
- profile
- pm
- www
PostPosted: Tue Sep 04, 2012 9:37 am reply with quote
can anyone verify that these modules do run on anyone else's system? ty Very Happy
----
neither a follower nor a leader be
http://www.xoxos.net - free vst
^ Joined: 29 Apr 2002  Member: #2639  Location: i might peeramid
spacedad
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Tue Sep 04, 2012 1:55 pm reply with quote
been lookin fwd to testing this,the kids r back at skool tomorrow.
----
^ Joined: 25 Apr 2002  Member: #2606  Location: the bottom of the barrel
All times are GMT - 8 Hours

Printable version
Page 1 of 7
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Display posts from previous:   
ReplyNew TopicPrevious TopicNext Topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Username: Password:  
KVR Developer Challenge 2012