Forums > MaxMSP

Physical Modelling system problem

August 22, 2006 | 10:55 am

The signal doesn’t seem to like being plugged back into the [+~] element- no sound goes through to the [dac~]. How come? Everything else works fine. The second argument of [delay~] sets the inital delay time to about 11 ms, which should produce some kind of decayed, plucked sound.

max v2;
#N vpatcher 0 0 1024 702;
#P origin 0 24;
#P window setfont "Sans Serif" 9.;
#P flonum 195 282 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 178 305 27 9109513 *~;
#P newex 178 246 82 9109513 delay~ 44100 400;
#P newex 123 200 27 9109513 +~;
#P newex 388 138 62 9109513 receive~ dac;
#P newex 122 393 51 9109513 send~ dac;
#P message 340 137 26 9109513 stop;
#P message 340 110 56 9109513 startwindow;
#P newex 370 187 28 9109513 dac~;
#P newex 124 119 34 9109513 *~;
#P message 166 64 58 9109513 0 , 1 10 0 10;
#P newex 148 93 27 9109513 line~;
#P newex 125 64 35 9109513 noise~;
#P connect 9 0 7 0;
#P fasten 11 0 9 0 183 364 86 364 86 192 128 192;
#P connect 0 0 3 0;
#P fasten 3 0 9 1 129 145 145 145;
#P fasten 2 0 1 0 171 86 153 86;
#P connect 1 0 3 1;
#P fasten 9 0 10 0 128 228 183 228;
#P connect 10 0 11 0;
#P connect 12 0 11 1;
#P fasten 8 0 4 0 393 177 375 177;
#P fasten 6 0 4 0 345 161 375 161;
#P fasten 5 0 4 0 345 131 375 131;
#P connect 8 0 4 1;
#P pop;



jln
August 22, 2006 | 12:19 pm


August 22, 2006 | 12:30 pm

Perfect, thankyou.

So the signal path has to be delayed by one sample – yet the [delay~] object is already delaying it by 400? I don’t understand…


August 22, 2006 | 12:37 pm

a dsp chain (ie a serie of msp object connected one to the other) can’t loop on itself.
using a combination of tapin~ tapout~ instead of delay~ solves this as well.
//yac

>
> Perfect, thankyou.
>
> So the signal path has to be delayed by one sample – yet the [delay~] object is already delaying
> it by 400? I don’t understand…
>


August 22, 2006 | 1:48 pm

The trouble with tapin~ and tapout~ is that small delay times don’t register. Plus, a [delay~] module is more elegant and fitting with the algorithmic descript of Karplus-Strong.

One limitation of this system seems to be that even the shortest delay time (1 sample) doesn’t produce a particularly high pitch. Any suggestions? Here is an expanded model, just hit the preset to get going:

max v2;
#N vpatcher 0 0 1024 702;
#P window setfont "Sans Serif" 9.;
#P flonum 78 575 34 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 61 596 27 9109513 *~;
#P newex 61 548 27 9109513 +~;
#N vpreset 3;
#X append 1 2 18 427 181 flonum float 0.99 ; 22 369 182 number int 2213 ; 23 293 183 number int 76 ; 26 369 409 number int 77 ; 27 369 290 flonum float 0.15 ; 28 369 371 flonum float;
#X append 1 2 1. ; 29 369 447 flonum float 0.23 ; 31 369 559 number int 40 ; 32 369 521 flonum float 1. ; 33 369 597 flonum float 1. ; 35 369 710 number int 14 ; 36 369 672;
#X append 1 2 flonum float 1. ; 37 369 748 flonum float 0.21 ; 41 575 78 flonum float 0.85 ;;
#X append 2 2 18 427 181 flonum float 0.99 ; 22 369 182 number int 2213 ; 23 293 183 number int 76 ; 26 369 409 number int 77 ; 27 369 290 flonum float 0.15 ; 28 369 371 flonum float;
#X append 2 2 1. ; 29 369 447 flonum float 0.23 ; 31 369 559 number int 40 ; 32 369 521 flonum float 1. ; 33 369 597 flonum float 1. ; 35 369 710 number int 14 ; 36 369 672;
#X append 2 2 flonum float 1. ; 37 369 748 flonum float 0.21 ; 41 575 78 flonum float 0.85 ;;
#X append 3 2 18 427 181 flonum float 0.99 ; 22 369 182 number int 2213 ; 23 293 183 number int 76 ; 26 369 409 number int 77 ; 27 369 290 flonum float 0.15 ; 28 369 371 flonum float;
#X append 3 2 1. ; 29 369 447 flonum float 0.23 ; 31 369 559 number int 40 ; 32 369 521 flonum float 1. ; 33 369 597 flonum float 1. ; 35 369 710 number int 14 ; 36 369 672;
#X append 3 2 flonum float 1. ; 37 369 748 flonum float 0.21 ; 41 575 78 flonum float 0.85 ;;
#P preset 631 180 47 27;
#P flonum 748 369 35 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 672 369 34 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 710 369 35 9 0 3000 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 634 396 125 9109513 reson~;
#P flonum 597 369 35 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 521 369 34 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 559 369 35 9 0 3000 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 483 396 125 9109513 reson~;
#P flonum 447 369 35 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 371 369 34 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 290 369 34 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 409 369 35 9 0 3000 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 273 395 27 9109513 *~;
#P newex 333 396 125 9109513 reson~;
#P number 183 293 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 182 369 35 9 0 15000 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 134 394 58 9109513 onepole~;
#P window linecount 2;
#P newex 64 244 43 9109513 receive~ fdbk;
#P window linecount 1;
#P newex 134 499 58 9109513 send~ fdbk;
#P flonum 181 427 38 9 0. 1. 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 134 450 57 9109513 *~;
#P newex 134 322 59 9109513 delay~ 2000;
#P newex 64 284 69 9109513 +~;
#P newex 607 142 76 9109513 receive~ dac;
#P newex 60 629 51 9109513 send~ dac;
#P message 559 141 26 9109513 stop;
#P message 559 114 75 9109513 startwindow;
#P newex 589 191 28 9109513 dac~;
#P newex 124 230 34 9109513 *~;
#P message 163 176 48 9109513 0 , 1 1 0 1;
#P newex 148 205 27 9109513 line~;
#P newex 125 175 35 9109513 noise~;
#P comment 220 293 100 9109513 Delay time (Pitch);
#P comment 124 156 66 9109513 Inital impulse;
#P comment 221 369 39 9109513 Cutoff;
#P comment 222 427 50 9109513 Feedback;
#P comment 369 354 114 9109513 Gain , Cutoff , Resonance;
#P comment 115 575 100 9109513 Master gain;
#P connect 40 0 13 0;
#P fasten 25 0 39 0 278 537 66 537;
#P fasten 24 0 39 0 338 537 66 537;
#P fasten 30 0 39 0 488 537 66 537;
#P fasten 34 0 39 0 639 537 66 537;
#P connect 39 0 40 0;
#P connect 20 0 15 0;
#P connect 41 0 40 1;
#P connect 9 0 15 1;
#P connect 6 0 9 0;
#P fasten 15 0 16 0 69 312 139 312;
#P connect 16 0 21 0;
#P connect 21 0 17 0;
#P connect 17 0 19 0;
#P fasten 8 0 7 0 168 199 153 199;
#P connect 7 0 9 1;
#P connect 18 0 17 1;
#P connect 22 0 21 1;
#P connect 23 0 16 1;
#P fasten 16 0 25 0 139 349 278 349;
#P connect 27 0 25 1;
#P fasten 16 0 24 0 139 349 338 349;
#P connect 28 0 24 1;
#P connect 26 0 24 2;
#P connect 29 0 24 3;
#P fasten 16 0 30 0 139 349 488 349;
#P connect 32 0 30 1;
#P connect 31 0 30 2;
#P fasten 14 0 10 0 612 181 594 181;
#P fasten 11 0 10 0 564 135 594 135;
#P fasten 12 0 10 0 564 165 594 165;
#P connect 33 0 30 3;
#P connect 14 0 10 1;
#P fasten 16 0 34 0 139 349 639 349;
#P connect 36 0 34 1;
#P connect 35 0 34 2;
#P connect 37 0 34 3;
#P pop;


August 22, 2006 | 3:57 pm

On 22-Aug-2006, at 14:19, r.julien wrote:
> The signal path has to be delayed by one sample (if I’m correct).

Almost.

There has to be a break of one sample *vector*. That is typically a
lot longer than one sample. This has been covered on the list dozens
of times, for instance:

http://www.cycling74.com/forums/index.php?
t=msg&goto=64824&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_64824

http://www.cycling74.com/forums/index.php?
t=msg&goto=63688&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_63688

http://www.cycling74.com/forums/index.php?
t=msg&goto=59586&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_59586

http://www.cycling74.com/forums/index.php?
t=msg&goto=58165&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_58165

http://www.cycling74.com/forums/index.php?
t=msg&goto=54963&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_54963

BTW: you can set the sample vector size to a single sample with an
msp;-message. Watch your CPU usage go up.

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de


August 22, 2006 | 5:31 pm

You could put the section of the DSP graph that has feedback into a
separate patch, load it using poly~, and set the vector size of the
poly~ to be small, rather than your whole graph.

The inputs of the sub-patch for poly~ will need to be in~ objects
(and the outlet will be out~ objects). If you saved it as
KarplusStrong.pat, and load it in poly~ like this:

poly~ KarplusStrong vs 2

Then that section of the dsp graph will process at a vector size of
2. Actually I expect a vector size of 4 or 8 will give you plenty of
headroom for high frequencies; Nyquist for a vector size of 8 at
44.1kHz gives a theoretical max frequency of 2,756.25 Hz.

See the help on poly~

HTH

On Aug 22, 2006, at 8:57 AM, Peter Castine wrote:

> On 22-Aug-2006, at 14:19, r.julien wrote:
>> The signal path has to be delayed by one sample (if I’m correct).
>
> Almost.
>
> There has to be a break of one sample *vector*. That is typically a
> lot longer than one sample. This has been covered on the list
> dozens of times, for instance:
>
> http://www.cycling74.com/forums/index.php?
> t=msg&goto=64824&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_64824
>
> http://www.cycling74.com/forums/index.php?
> t=msg&goto=63688&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_63688
>
> http://www.cycling74.com/forums/index.php?
> t=msg&goto=59586&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_59586
>
> http://www.cycling74.com/forums/index.php?
> t=msg&goto=58165&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_58165
>
> http://www.cycling74.com/forums/index.php?
> t=msg&goto=54963&rid=0&S=ddb91f73fbf711b63acae91df9099b42#msg_54963
>
> BTW: you can set the sample vector size to a single sample with an
> msp;-message. Watch your CPU usage go up.
>
>
>
> ————– http://www.bek.no/~pcastine/Litter/ ————-
> Peter Castine +–> Litter Power & Litter Bundle for Jitter
> Universal Binaries on the way
> iCE: Sequencing, Recording &
> Interface Building for |home | chez nous|
> Max/MSP Extremely cool |bei uns | i nostri|
> http://www.dspaudio.com/ http://www.castine.de
>
>


August 26, 2006 | 10:56 am

lists@grahamwakefield.net wrote:
> Then that section of the dsp graph will process at a vector size of 2.
> Actually I expect a vector size of 4 or 8 will give you plenty of
> headroom for high frequencies; Nyquist for a vector size of 8 at
> 44.1kHz gives a theoretical max frequency of 2,756.25 Hz.

The problem isn’t the highest available pitch, its the resolution of the
pitches. You won’t get them tuned (even if you relate your key to the
sample rate…). But inside a poly you can also use a higher sample rate
which helps, but needs even more CPU…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


August 26, 2006 | 10:51 pm

> > Then that section of the dsp graph will process at a vector size of 2.
> > Actually I expect a vector size of 4 or 8 will give you plenty of
> > headroom for high frequencies; Nyquist for a vector size of 8 at
> > 44.1kHz gives a theoretical max frequency of 2,756.25 Hz.

well the nyquist at 44.1khz samplingrate is always the same,
the vector size will not help much here. :)

it seems you mixed up downsampling with vector size, because
2.7 khz nyquist is what you get at [poly~ foo down 8]

-poly~ up 110


August 31, 2006 | 10:42 pm


Viewing 10 posts - 1 through 10 (of 10 total)