[PD] Help - filters & band limited oscillators!

Roman Haefeli reduzierer at yahoo.de
Wed Mar 14 17:49:58 CET 2007


hello again

i improved guenter's bandlimited square a bit. i noticed that it is
hardcoded to 48kHz and accidently i was running pd at 48kHz, that's why
it sounded quite good here. however, how far i can see it, the part,
that selects the appropriate table, is not working as it should. i
couldn't completely follow, how it works, but it seems to switch only
correct from tab1 to tab2. for other tabs it switches at too high
frequencies, which might introduce a bit aliasing. 
in my version the tables are generated on loadbang, which makes the file
much smaller and easier to adapt for other waveforms. the tabselector is
now dependent on the sampling rate, so it should sound well at different
rates now.  in order to provide the full spectrum even in low
frequencies, i added a raw square generator. below a certain frequency,
the oscillator switches to the raw square version, so that it should
sound good at arbitrary low frequencies. the number of tables generated
on loadbang can be changed. a bigger value lowers the frequency, at
which the oscillator switches to the raw version and vice versa.

i hope you'll have fun with it.

roman
  

On Wed, 2007-03-14 at 04:46 -0600, David Powers wrote:
> I found those, but are they really band-limited? I'm fairly sure I
> hear ugly digital artifacts in the saw. The square appears to be
> broken, unless I made a mistake cutting and pasting those 1500 lines
> of code into my text editor (kinda hard to tell).
> 
> It's 5 30 am here and I've not slept yet :-(
> 
> I can't believe there's STILL no readily available
> external/abstraction for such a common synthesis task, I just want a
> "nice sounding" example that will compare with the VST's which I will
> be hosting from within PD; right now "ASynth" sounds about 100x better
> than anything made in PD itself ...
> 
> Oh and I don't see any "J" example PD patches, my PD patches don't go
> that high.
> 
>  ~David
> 
> On 3/14/07, Roman Haefeli <reduzierer at yahoo.de> wrote:
> > hello david
> >
> > i found examples for a bandlimited saw and bandlimited square by g.
> > geiger in the archives. might this is what you are looking for.
> >
> > http://lists.puredata.info/pipermail/pd-list/2006-05/038681.html
> >
> > cheers
> > roman
> >
> > On Wed, 2007-03-14 at 03:05 -0600, David Powers wrote:
> > > Hello everyone,
> > >
> > > I tried google and it was no help, and the server for the list archive
> > > seems to be down temporarily.
> > >
> > > Anyway, I'm giving a free (as in free beer) workshop in Chicago in
> > > about 16 hours, on the basics of digital synthesis. I have decided to
> > > use Pure Data to give my presentation, and use mostly non-commercial
> > > software.
> > >
> > > However, I'm still missing the following for demonstrating "proper"
> > > subtractive synthesis:
> > > 1. Good, out of the box "analog-sounding" filters. I'm using [moog~]
> > > right now, but I'm not all that satisfied with the sound compared to
> > > the filters in my favorite VST's ...
> > > 2. Band-limited square and sawtooth waveforms.
> > >
> > > For teaching purposes PD is great, and ideal for my demonstrations.
> > > But as it is, I'm having to use VST's within PD in order to
> > > demonstrate a "nice sounding" synth. It would be nice to show that PD
> > > can do it without using stuff built in Steinberg's format. That would
> > > also let the Mac people replicate my work, if they are interested.
> > > Note, nobody in the workshop has ever tried Linux, except me, so Linux
> > > plugins are not helpful in this case.
> > >
> > > I will post my patches after I give the workshop, though they are
> > > nothing fancy ... just basic:
> > > sequencer - oscillator - vca - filter. Good for demoing though, I'm
> > > starting with additive first, then subtractive.
> > >
> > > ~David
> > >
> > > _______________________________________________
> > > PD-list at iem.at mailing list
> > > UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
> >
> >
> >
> >
> >
> >
> > ___________________________________________________________
> > Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
> >
> >
> 
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-------------- next part --------------
#N canvas 706 177 528 492 10;
#N canvas 647 5 291 900 lookup-tables 0;
#X obj 10 10 table 1021-square1 512;
#X obj 10 30 table 1021-square3 512;
#X obj 10 50 table 1021-square5 512;
#X obj 10 70 table 1021-square7 512;
#X obj 10 90 table 1021-square9 512;
#X obj 10 110 table 1021-square11 512;
#X obj 10 130 table 1021-square13 512;
#X obj 10 150 table 1021-square15 512;
#X obj 10 170 table 1021-square17 512;
#X obj 10 190 table 1021-square19 512;
#X obj 10 210 table 1021-square21 512;
#X obj 10 230 table 1021-square23 512;
#X obj 10 250 table 1021-square25 512;
#X obj 10 270 table 1021-square27 512;
#X obj 10 290 table 1021-square29 512;
#X obj 10 310 table 1021-square31 512;
#X obj 10 330 table 1021-square33 512;
#X obj 10 350 table 1021-square35 512;
#X obj 10 370 table 1021-square37 512;
#X obj 10 390 table 1021-square39 512;
#X obj 10 410 table 1021-square41 512;
#X obj 10 430 table 1021-square43 512;
#X obj 10 450 table 1021-square45 512;
#X obj 10 470 table 1021-square47 512;
#X obj 10 490 table 1021-square49 512;
#X obj 10 510 table 1021-square51 512;
#X obj 10 530 table 1021-square53 512;
#X obj 10 550 table 1021-square55 512;
#X obj 10 570 table 1021-square57 512;
#X obj 10 590 table 1021-square59 512;
#X restore 21 53 pd lookup-tables;
#N canvas 0 0 505 412 lookup-table-creation 1;
#N canvas 535 94 265 461 bandlimited_square_sinesum 0;
#X obj 43 67 until;
#X obj 21 38 t b f b;
#X obj 84 67 1;
#X obj 43 99 f 1;
#X obj 84 99 + 1;
#X obj 43 125 t f f;
#X obj 43 153 % 2;
#X obj 43 176 sel 0 1;
#X obj 43 203 0;
#X obj 69 203 f;
#X obj 69 227 t b f;
#X obj 69 249 pack 1 f;
#X obj 69 274 /;
#X obj 43 306 list prepend;
#X obj 142 307 list;
#X obj 21 335 list;
#X obj 154 252 b;
#X obj 21 380 list trim;
#X obj 21 16 inlet;
#X obj 21 402 outlet;
#X obj 21 358 list prepend sinesum 512;
#X connect 0 0 3 0;
#X connect 1 0 15 0;
#X connect 1 1 0 0;
#X connect 1 2 2 0;
#X connect 1 2 16 0;
#X connect 2 0 3 1;
#X connect 3 0 4 0;
#X connect 3 0 5 0;
#X connect 4 0 3 1;
#X connect 5 0 6 0;
#X connect 5 1 9 1;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 7 1 9 0;
#X connect 8 0 13 0;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 10 1 11 1;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 13 0 15 1;
#X connect 14 0 13 1;
#X connect 15 0 20 0;
#X connect 16 0 15 1;
#X connect 16 0 13 1;
#X connect 17 0 19 0;
#X connect 18 0 1 0;
#X connect 20 0 17 0;
#X restore 19 327 pd bandlimited_square_sinesum;
#X obj 19 92 until;
#X obj 19 114 f;
#X obj 54 114 + 1;
#X obj 62 92 1;
#X obj 19 135 * 2;
#X obj 19 157 - 1;
#X obj 84 293 s pd-lookup-tables;
#X msg 84 271 obj 10 \$1 table \$2 512;
#X obj 135 220 makefilename \$0-square%d;
#X obj 84 242 pack f s;
#X obj 19 70 t f b b;
#X msg 140 167 clear;
#X obj 84 218 * 10;
#X obj 19 179 t b f f;
#X obj 19 304 f;
#X obj 19 371 send;
#X obj 19 44 r \$0-num_of_tables;
#X obj 319 35 loadbang;
#X obj 319 61 \$0;
#X msg 319 86 \; \$1-num_of_tables 30;
#X connect 0 0 16 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 2 0 5 0;
#X connect 3 0 2 1;
#X connect 4 0 2 1;
#X connect 5 0 6 0;
#X connect 6 0 14 0;
#X connect 8 0 7 0;
#X connect 9 0 10 1;
#X connect 9 0 16 1;
#X connect 10 0 8 0;
#X connect 11 0 1 0;
#X connect 11 1 4 0;
#X connect 11 2 12 0;
#X connect 12 0 7 0;
#X connect 13 0 10 0;
#X connect 14 0 15 0;
#X connect 14 1 13 0;
#X connect 14 2 9 0;
#X connect 14 2 15 1;
#X connect 15 0 0 0;
#X connect 17 0 11 0;
#X connect 18 0 19 0;
#X connect 19 0 20 0;
#X restore 21 28 pd lookup-table-creation;
#X floatatom 26 109 5 0 0 0 - - -;
#X obj 29 379 dac~;
#X obj 29 88 hsl 128 15 20 17000 1 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X obj 28 350 *~;
#X obj 98 304 pow 2;
#X obj 101 279 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 3000 1;
#X obj 26 152 line~;
#X obj 98 350 line~;
#X obj 98 327 pack f 20;
#N canvas 340 190 333 233 bandlimited_square 0;
#N canvas 314 100 500 478 number_of_harmonics_allowed 0;
#X obj 135 68 / 2;
#X obj 15 151 /;
#X obj 15 174 int;
#X obj 135 44 samplerate~;
#X obj 15 241 * 0.5;
#X obj 15 261 int;
#X obj 15 282 * 2;
#X obj 15 221 - 1;
#X obj 15 305 + 1;
#X obj 15 397 makefilename \$0-square%d;
#X obj 15 373 change;
#X obj 15 199 change;
#X msg 15 422 set \$1;
#X obj 15 98 t b f;
#X text 241 49 sr / 2 = nyquist frequency;
#X obj 15 450 outlet;
#X obj 206 370 b;
#X obj 239 371 b;
#X obj 206 392 0;
#X obj 239 392 1;
#X obj 206 420 change;
#X obj 206 444 outlet;
#X obj 14 18 inlet~;
#X obj 15 121 f;
#X obj 135 21 loadbang;
#X text 119 216 harmonics never should exceed the nyquist frequency
;
#X obj 15 49 snapshot~;
#X obj 78 21 bang~;
#X obj 15 72 change;
#X obj 15 329 moses;
#X obj 78 263 r \$0-num_of_tables;
#X obj 78 287 * 2;
#X obj 78 309 + 1;
#X connect 0 0 23 1;
#X connect 1 0 2 0;
#X connect 2 0 11 0;
#X connect 3 0 0 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 6 0 8 0;
#X connect 7 0 4 0;
#X connect 8 0 29 0;
#X connect 9 0 12 0;
#X connect 10 0 9 0;
#X connect 11 0 7 0;
#X connect 12 0 15 0;
#X connect 13 0 23 0;
#X connect 13 1 1 1;
#X connect 16 0 18 0;
#X connect 17 0 19 0;
#X connect 18 0 20 0;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 22 0 26 0;
#X connect 23 0 1 0;
#X connect 24 0 3 0;
#X connect 26 0 28 0;
#X connect 27 0 26 0;
#X connect 28 0 13 0;
#X connect 29 0 10 0;
#X connect 29 0 16 0;
#X connect 29 1 17 0;
#X connect 30 0 31 0;
#X connect 31 0 32 0;
#X connect 32 0 29 1;
#X restore 87 61 pd number_of_harmonics_allowed;
#X obj 190 90 == 0;
#N canvas 499 174 280 152 raw_square 0;
#N canvas 186 124 192 145 switchable_part 0;
#X obj 17 38 <~ 0.5;
#X obj 17 62 -~ 0.5;
#X obj 17 84 *~ 1.9;
#X obj 17 109 outlet~;
#X obj 109 48 inlet;
#X obj 109 73 switch~;
#X obj 17 12 inlet~;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 4 0 5 0;
#X connect 6 0 0 0;
#X restore 20 66 pd switchable_part;
#X obj 19 13 inlet~;
#X obj 19 91 outlet~;
#X obj 141 34 inlet;
#X obj 19 39 phasor~;
#X connect 0 0 2 0;
#X connect 1 0 4 0;
#X connect 3 0 0 1;
#X connect 4 0 0 0;
#X restore 89 143 pd raw_square;
#N canvas 0 0 305 193 bandlimited_square 0;
#X obj 16 31 inlet~;
#X obj 71 36 inlet;
#X obj 17 74 tabosc4~ \$0-square1;
#X obj 162 44 inlet;
#X obj 17 132 outlet~;
#X obj 16 105 *~;
#X connect 0 0 2 0;
#X connect 1 0 2 0;
#X connect 2 0 5 0;
#X connect 3 0 5 1;
#X connect 5 0 4 0;
#X restore 40 111 pd bandlimited_square;
#X obj 40 20 inlet~;
#X obj 39 175 outlet~;
#X connect 0 0 3 1;
#X connect 0 1 1 0;
#X connect 0 1 2 1;
#X connect 1 0 3 2;
#X connect 2 0 5 0;
#X connect 3 0 5 0;
#X connect 4 0 3 0;
#X connect 4 0 0 0;
#X connect 4 0 2 0;
#X restore 27 232 pd bandlimited_square;
#X obj 26 129 pack f 100;
#X floatatom 242 111 5 0 0 0 - - -;
#X obj 245 381 dac~;
#X obj 245 90 hsl 128 15 20 17000 1 0 empty empty empty -2 -8 0 10
-262144 -1 -1 0 1;
#X obj 244 352 *~;
#X obj 314 306 pow 2;
#X obj 317 281 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X obj 242 154 line~;
#X obj 314 352 line~;
#X obj 314 329 pack f 20;
#X obj 242 131 pack f 100;
#N canvas 499 174 280 152 raw_square 0;
#X obj 18 16 inlet~;
#X obj 17 128 outlet~;
#X obj 18 39 phasor~;
#X obj 18 61 <~ 0.5;
#X obj 18 85 -~ 0.5;
#X obj 18 107 *~ 1.9;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 5 0 1 0;
#X restore 243 236 pd raw_square;
#X connect 2 0 12 0;
#X connect 4 0 2 0;
#X connect 5 0 3 0;
#X connect 5 0 3 1;
#X connect 6 0 10 0;
#X connect 7 0 6 0;
#X connect 8 0 11 0;
#X connect 9 0 5 1;
#X connect 10 0 9 0;
#X connect 11 0 5 0;
#X connect 12 0 8 0;
#X connect 13 0 22 0;
#X connect 15 0 13 0;
#X connect 16 0 14 0;
#X connect 16 0 14 1;
#X connect 17 0 21 0;
#X connect 18 0 17 0;
#X connect 19 0 23 0;
#X connect 20 0 16 1;
#X connect 21 0 20 0;
#X connect 22 0 19 0;
#X connect 23 0 16 0;


More information about the Pd-list mailing list