Permalink
Browse files

Added global RJLIB receiver with message sf-samplerate to globally se…

…t the samplerate to use for soundfiles. This allows selecting a different samplerate for soundfiles than the default 22050 in soundfile loading and table playback objects like u_samplebank or s_playtable. Note that u_record or s_fplaytable do not support this as they rely on Pd's current system samplerate (they use tabplay~ rsp. tabwrite~). This is the first global receiver apart from the sssad receivers used in the rj library, but it sounds pretty useful to have here. Also note that of course this will only change the default rate for objects already created, so if you later add another of these objects, you need to send your changed default again.
  • Loading branch information...
1 parent e7aad80 commit 98e54f18e3a51c38b4019b82990058fff2a29800 @footils footils committed Feb 17, 2012
View
4 rj/s_looper-help.pd
@@ -46,6 +46,9 @@ parts.;
#X text 237 355 print info to last outlet;
#X obj 82 52 s_looper;
#X text 239 334 adjust fade time (default 2ms);
+#X obj 686 442 s RJLIB;
+#X msg 686 411 sf-samplerate 44100;
+#X text 679 387 Set soundfile samplerate globally:;
#X connect 0 0 34 0;
#X connect 2 0 34 0;
#X connect 3 0 34 0;
@@ -73,3 +76,4 @@ parts.;
#X connect 34 3 12 0;
#X connect 35 0 34 0;
#X connect 36 0 34 0;
+#X connect 41 0 40 0;
View
8 rj/s_looper.pd
@@ -1,4 +1,4 @@
-#N canvas 174 275 976 607 10;
+#N canvas 174 275 1050 615 10;
#X obj 168 565 outlet~;
#X obj 208 518 outlet~;
#X obj 167 483 s_playtable2;
@@ -117,6 +117,10 @@ License along with this program. If not \, see <http://www.gnu.org/licenses/>.
;
#X restore 812 29 pd LICENSE-GPL;
#X msg 314 443 fade 0 \$1;
+#X obj 713 222 r RJLIB;
+#X obj 713 243 route sf-samplerate;
+#X obj 713 265 s \$0-sr;
+#X text 709 201 Allow global setting of soundfile samplerate;
#X connect 2 0 0 0;
#X connect 2 1 1 0;
#X connect 6 0 5 0;
@@ -173,3 +177,5 @@ License along with this program. If not \, see <http://www.gnu.org/licenses/>.
#X connect 62 0 63 0;
#X connect 63 0 59 0;
#X connect 65 0 2 1;
+#X connect 66 0 67 0;
+#X connect 67 0 68 0;
View
10 rj/s_loopsmooth-help.pd
@@ -1,7 +1,7 @@
-#N canvas 195 231 897 464 10;
+#N canvas 195 231 957 464 10;
#X msg 687 221 help;
#X obj 483 307 soundoutput;
-#X obj 482 171 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+#X obj 482 171 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 619 80 g_nbx dur;
#X obj 619 47 g_nbx loopstart;
@@ -46,7 +46,7 @@
-1 -1;
#X obj 482 273 s_loopsmooth mytable;
#X obj 619 304 spigot;
-#X obj 671 305 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+#X obj 671 305 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 695 85 min. duration: 10 ms;
#N canvas 285 142 696 470 REFERENCE 0;
@@ -79,6 +79,9 @@ looping);
#X msg 630 171 sr 22050;
#X msg 699 171 sr 44100;
#X text 763 170 file samplerate;
+#X obj 762 235 s RJLIB;
+#X msg 762 214 sf-samplerate 44100;
+#X text 708 194 Set soundfile samplerate globally:;
#X connect 0 0 16 1;
#X connect 2 0 16 0;
#X connect 3 0 10 0;
@@ -101,3 +104,4 @@ looping);
#X connect 22 0 13 0;
#X connect 23 0 16 1;
#X connect 24 0 16 1;
+#X connect 27 0 26 0;
View
6 rj/s_loopsmooth.pd
@@ -137,6 +137,10 @@ in individual files.;
#X text 123 148 See the file LICENSE.txt for the full license text.
;
#X restore 674 36 pd LICENSE-BSD;
+#X obj 775 335 r RJLIB;
+#X obj 775 356 route sf-samplerate;
+#X obj 775 378 s \$0-sr;
+#X text 771 314 Allow global setting of soundfile samplerate;
#X connect 0 0 1 1;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
@@ -178,3 +182,5 @@ in individual files.;
#X connect 40 4 0 0;
#X connect 42 0 40 0;
#X connect 42 1 28 0;
+#X connect 44 0 45 0;
+#X connect 45 0 46 0;
View
6 rj/s_playolap-help.pd
@@ -1,4 +1,4 @@
-#N canvas 62 69 995 449 10;
+#N canvas 62 69 999 506 10;
#X msg 787 130 open;
#X floatatom 865 264 8 0 0 3 dur_in_smps - -;
#X floatatom 818 231 8 0 0 3 dur_in_ms - -;
@@ -52,6 +52,9 @@ effect is a latency of duration "chunk-size".;
#X msg 833 130 sr 44100;
#X msg 906 131 info;
#X obj 787 165 u_samplebank \$0-mytable;
+#X obj 626 451 s RJLIB;
+#X msg 626 420 sf-samplerate 44100;
+#X text 619 396 Set soundfile samplerate globally:;
#X connect 0 0 32 0;
#X connect 4 0 3 0;
#X connect 4 1 2 0;
@@ -80,3 +83,4 @@ effect is a latency of duration "chunk-size".;
#X connect 32 0 4 0;
#X connect 32 0 7 0;
#X connect 32 0 25 1;
+#X connect 34 0 33 0;
View
8 rj/s_playolap.pd
@@ -1,4 +1,4 @@
-#N canvas 292 297 800 545 10;
+#N canvas 292 297 905 550 10;
#N canvas 0 0 854 788 playsamp 0;
#X obj 195 215 +~ 1;
#X obj 195 293 *~;
@@ -146,6 +146,10 @@ in individual files.;
#X text 123 148 See the file LICENSE.txt for the full license text.
;
#X restore 488 28 pd LICENSE-BSD;
+#X obj 563 132 r RJLIB;
+#X obj 563 153 route sf-samplerate;
+#X obj 563 175 s \$0-sr;
+#X text 559 111 Allow global setting of soundfile samplerate;
#X connect 0 0 22 0;
#X connect 2 0 4 0;
#X connect 3 0 1 0;
@@ -168,3 +172,5 @@ in individual files.;
#X connect 21 0 0 1;
#X connect 21 1 18 1;
#X connect 22 0 23 0;
+#X connect 27 0 28 0;
+#X connect 28 0 29 0;
View
14 rj/s_playtable-help.pd
@@ -1,9 +1,9 @@
#N canvas 289 87 888 636 10;
-#X obj 664 443 openpanel;
-#X obj 663 518 table play-samp;
-#X msg 664 464 read -resize \$1 play-samp;
-#X obj 664 490 soundfiler;
-#X obj 664 416 bng 20 250 50 0 empty empty open-sample 0 -6 1 10 -262144
+#X obj 692 502 openpanel;
+#X obj 691 577 table play-samp;
+#X msg 692 523 read -resize \$1 play-samp;
+#X obj 692 549 soundfiler;
+#X obj 692 475 bng 20 250 50 0 empty empty open-sample 0 -6 1 10 -262144
-1 -1;
#X obj 122 584 soundoutput;
#X msg 158 209 play-samp 0.5 2;
@@ -48,6 +48,9 @@ is doen by resampling;
#X text 336 471 fade in & out time (default is 0 ms \, 2 ms);
#X floatatom 323 453 5 0 0 0 - - -;
#X obj 270 472 pack 0 2;
+#X obj 508 430 s RJLIB;
+#X msg 508 399 sf-samplerate 44100;
+#X text 501 375 Set soundfile samplerate globally:;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 4 0 0 0;
@@ -71,3 +74,4 @@ is doen by resampling;
#X connect 35 0 31 1;
#X connect 37 0 38 1;
#X connect 38 0 35 0;
+#X connect 40 0 39 0;
View
6 rj/s_playtable.pd
@@ -283,6 +283,10 @@ in individual files.;
#X connect 6 0 1 1;
#X connect 7 0 1 0;
#X restore 456 196 pd calc;
+#X obj 307 382 r RJLIB;
+#X obj 307 403 route sf-samplerate;
+#X obj 307 425 s \$0-sr;
+#X text 303 361 Allow global setting of soundfile samplerate;
#X connect 0 0 21 0;
#X connect 1 0 17 0;
#X connect 3 0 9 0;
@@ -310,3 +314,5 @@ in individual files.;
#X connect 21 0 22 0;
#X connect 22 0 24 0;
#X connect 23 0 6 0;
+#X connect 27 0 28 0;
+#X connect 28 0 29 0;
View
4 rj/s_playtable2-help.pd
@@ -54,6 +54,9 @@ for 8000ms;
#X text 343 462 fade in & out time (default is 0 ms \, 2 ms);
#X floatatom 330 444 5 0 0 0 - - -;
#X obj 277 463 pack 0 2;
+#X obj 512 538 s RJLIB;
+#X msg 512 507 sf-samplerate 44100;
+#X text 505 483 Set soundfile samplerate globally:;
#X connect 0 0 29 0;
#X connect 2 0 0 0;
#X connect 4 0 33 0;
@@ -77,3 +80,4 @@ for 8000ms;
#X connect 39 0 33 1;
#X connect 41 0 42 1;
#X connect 42 0 39 0;
+#X connect 44 0 43 0;
View
18 rj/u_samplebank-help.pd
@@ -1,28 +1,28 @@
-#N canvas 228 72 958 529 10;
+#N canvas 113 88 1001 524 10;
#X declare -path ./;
#N canvas 369 257 911 646 REFERENCE 0;
#X text 24 31 Name: u_samplebank2;
#X text 22 433 Tags: Audio \, Playback;
#X text 23 97 Argument 0: <symbol> Table name - Must be unique.;
#X text 23 117 Argument 1: <path> Soundfile directory (optional).;
-#X text 24 230 Outlet 0: output list if "info" message is sent to Inlet
+#X text 24 240 Outlet 0: output list if "info" message is sent to Inlet
0;
#X text 23 57 Summary: Utility patch to load mono stereo files into
Pd tables.;
-#X text 23 258 Description: Utility patch to load sample stereo files
+#X text 23 268 Description: Utility patch to load sample stereo files
into Pd tables. Also calculates duration in milliseconds. Available
in stereo as [u_samplebank2] as well. Play back the sample via [s_playtable].
;
#X text 23 396 See also: [u_samplebank2] [u_multisamplebank] [s_playtable]
[s_playtable2];
+#X text 23 342 You can add paths to search for soundfiles using "declare".
+Just add [declare -path PATHNAME] to your _main.pd patch.;
#X text 23 141 Inlet 0: <message> "open" - load a sample with opendialog.
<message> "open filename.wav" - load a sample by path. <message> "open
filename.wav" - load a sample by path. <message> "info" - output list
containing: table name \, duration in ms \, duration in samples \,
-samplerate. <message> "sr SAMPLERATE \, info" - change the samplerate
-;
-#X text 23 342 You can add paths to search for soundfiles using "declare".
-Just add [declare -path PATHNAME] to your _main.pd patch.;
+samplerate. <message> "sr SAMPLERATE" - change the samplerate (also
+possible via global RJLIB receiver with "sf-samplerate");
#X coords 0 -1 1 1 450 450 1 10 10;
#X restore 18 45 pd REFERENCE;
#X obj 18 20 cnv 15 450 20 empty empty empty 20 12 0 14 -261234 -66577
@@ -64,6 +64,9 @@ Just add [declare -path PATHNAME] to your _main.pd patch.;
#X text 615 40 Don't forget to declare the path ".";
#X obj 516 275 u_samplebank \$0-sample ../samples/file_not_found.wav
;
+#X obj 733 194 s RJLIB;
+#X msg 733 163 sf-samplerate 44100;
+#X text 726 139 Set soundfile samplerate globally:;
#X connect 9 0 19 0;
#X connect 10 0 19 0;
#X connect 11 0 19 0;
@@ -74,3 +77,4 @@ Just add [declare -path PATHNAME] to your _main.pd patch.;
#X connect 15 2 7 0;
#X connect 15 3 16 0;
#X connect 19 0 15 0;
+#X connect 21 0 20 0;
View
6 rj/u_samplebank.pd
@@ -47,6 +47,10 @@ License along with this program. If not \, see <http://www.gnu.org/licenses/>.
#X text 60 325 See the file LICENSE.txt for the full license text.
;
#X restore 602 49 pd LICENSE-GPL;
+#X obj 513 138 r RJLIB;
+#X obj 513 159 route sf-samplerate;
+#X obj 513 181 s \$0-sr;
+#X text 451 118 Allow global setting of soundfile samplerate;
#X connect 1 0 6 0;
#X connect 2 0 21 0;
#X connect 3 0 1 0;
@@ -79,3 +83,5 @@ License along with this program. If not \, see <http://www.gnu.org/licenses/>.
#X connect 28 1 23 0;
#X connect 29 0 27 0;
#X connect 30 0 29 3;
+#X connect 32 0 33 0;
+#X connect 33 0 34 0;
View
18 rj/u_samplebank2-help.pd
@@ -1,4 +1,4 @@
-#N canvas 104 162 939 537 10;
+#N canvas 104 169 987 530 10;
#X declare -path ./;
#X floatatom 570 373 8 0 0 1 duration_in_samples - -;
#X floatatom 543 393 8 0 0 1 duration_in_ms - -;
@@ -19,21 +19,21 @@
Pd tables.;
#X text 23 97 Argument 0: <symbol> Table name - Must be unique.;
#X text 23 117 Argument 1: <path> Soundfile directory (optional).;
-#X text 23 258 Description: Utility patch to load sample stereo files
+#X text 23 268 Description: Utility patch to load sample stereo files
into Pd tables. Also calculates duration in milliseconds. Available
in mono as [u_samplebank] as well. Left channel will be in table "ARGUMENT-1"
\, right channel is in table "ARGUMENT-2". Play back the sample via
[s_playtable].;
-#X text 24 232 Outlet 0: output list if "info" message is sent to Inlet
+#X text 24 242 Outlet 0: output list if "info" message is sent to Inlet
0;
+#X text 23 342 You can add paths to search for soundfiles using "declare".
+Just add [declare -path PATHNAME] to your _main.pd patch.;
#X text 23 147 Inlet 0: <message> "open" - load a sample with opendialog.
<message> "open filename.wav" - load a sample by path. <message> "open
filename.wav" - load a sample by path. <message> "info" - output list
containing: table name \, duration in ms \, duration in samples \,
-samplerate. <message> "sr SAMPLERATE \, info" - change the samplerate
-;
-#X text 23 342 You can add paths to search for soundfiles using "declare".
-Just add [declare -path PATHNAME] to your _main.pd patch.;
+samplerate. <message> "sr SAMPLERATE" - change the samplerate (also
+possible via global RJLIB receiver with "sf-samplerate");
#X coords 0 -1 1 1 450 450 1 0 0;
#X restore 15 52 pd REFERENCE;
#X obj 15 28 cnv 15 450 20 empty empty empty 20 12 0 14 -261234 -66577
@@ -47,6 +47,9 @@ Just add [declare -path PATHNAME] to your _main.pd patch.;
;
#X obj 676 70 declare -path ./;
#X text 615 40 Don't forget to declare the path ".";
+#X obj 733 194 s RJLIB;
+#X msg 733 163 sf-samplerate 44100;
+#X text 726 139 Set soundfile samplerate globally:;
#X connect 2 0 16 0;
#X connect 3 0 16 0;
#X connect 4 0 16 0;
@@ -57,3 +60,4 @@ Just add [declare -path PATHNAME] to your _main.pd patch.;
#X connect 8 2 0 0;
#X connect 8 3 9 0;
#X connect 16 0 8 0;
+#X connect 20 0 19 0;
View
6 rj/u_samplebank2.pd
@@ -48,6 +48,10 @@ License along with this program. If not \, see <http://www.gnu.org/licenses/>.
#X text 60 325 See the file LICENSE.txt for the full license text.
;
#X restore 522 59 pd LICENSE-GPL;
+#X obj 515 159 r RJLIB;
+#X obj 515 180 route sf-samplerate;
+#X obj 515 202 s \$0-sr;
+#X text 511 138 Allow global setting of soundfile samplerate;
#X connect 0 0 5 0;
#X connect 1 0 19 0;
#X connect 2 0 0 0;
@@ -80,3 +84,5 @@ License along with this program. If not \, see <http://www.gnu.org/licenses/>.
#X connect 27 0 25 0;
#X connect 28 0 27 3;
#X connect 31 0 1 0;
+#X connect 33 0 34 0;
+#X connect 34 0 35 0;

0 comments on commit 98e54f1

Please sign in to comment.