up-sampling in Poly – or VS reduce ?

Aug 10, 2012 at 9:09am

up-sampling in Poly – or VS reduce ?

hi

I am building a simple Karplus-strong thing in max6. So far so good, it works, BUT when I play “higher” notes it goes out of pitch (really badly). I understood it is a problem with the I/O an d signal vector size and how it affects the delay line which creates the sound. So I decided to put the whole delay line (tapin~ / tapout~) into a poly and upsamle it or something (so it is a question about the upsamplig of the poly~)

usually my set up is
I/O vector size 512
signal vector size 258
SR 44100

when i create a [poly~ mypatch vs 2] (the delay being “mypatch”) it seems to work – at least it is WAY better

questions :
_is it “better” to reduce the signal vector size (down to 2 ?) or to increase the sampling Rate (up 2 or up 4 ???)

many thanks

kasper

#63899
Aug 10, 2012 at 10:36am

the issue is vector size and sampling rate. but mainly vector size. so setting your poly~ at vs 2 will enable a far better karplus strong algo. however, it will also increase your cpu load so dramatically that it is almost pointless. it is very difficult (almost impossible) in environments with fixed vectors in signal processing (e.g. MSP, Pd, Supercollider, Csound, Reaktor, etc) to make good quality full range karplus strong algos. some environments have workarounds with varying degrees of success. in MSP the workaround is to write your own externals in C using the SDK.

luckily, in Max6, there is not a workaround but a solution. it is called gen~. it works. there are even karplus strong and waveguide examples for you in the gen~ examples folder that comes with your distro. it is very easy – the patching is almost identical to how you would achieve it in MSP-land.

gen~ operates at 1-sample feedback rate (rather than a variable ‘block’ of samples in a vector) and also offers various means of interpolation etc. so kp algos are just one of the many things possible.

good luck.

#230437
Aug 10, 2012 at 10:58am

hey, thank you!!

even if the “vs 2″ message gives me good results (an does not seem to be THAT heavy on the cpu – it is below 2%, with just one Karplus) it also gives me a good reason/starting point to have a look at gen~

actually I was doing this karplus strong thing just to understand how it’s done and why it was not in tune (and then, who cares if a simili-guitar-string-feedback is in tune ?), but finding a way to start using Gen~ is a great thing

thanks again

kasper

#230438
Aug 10, 2012 at 2:36pm

yes, if i hear “karplus strong” i also say it is both.
the smaller vector is required to be able to make shorter delay times, and the higher samplingrate is a matter of the soundquality required. if you want vectors of 2, 4 or 8, well, depends on the application.
for building a a guitar like instrument where 91 is the highest note a vectorsize of 8 might be cool.

#230439

You must be logged in to reply to this topic.