From 3205058a5327ce31a3493c188c475654184308f9 Mon Sep 17 00:00:00 2001 From: Dan Stowell Date: Sun, 24 Jun 2012 10:48:57 +0100 Subject: [PATCH] DiskIn help: prioritise object-style example over OSC example --- HelpSource/Classes/DiskIn.schelp | 53 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/HelpSource/Classes/DiskIn.schelp b/HelpSource/Classes/DiskIn.schelp index 6054a9be7..8d01a1d1a 100644 --- a/HelpSource/Classes/DiskIn.schelp +++ b/HelpSource/Classes/DiskIn.schelp @@ -41,6 +41,7 @@ Examples:: code:: s.boot; // start the server +// examples below will use this synthdef ( SynthDef("help-Diskin", { arg bufnum = 0; Out.ar(0, DiskIn.ar(1, bufnum)); @@ -48,32 +49,7 @@ SynthDef("help-Diskin", { arg bufnum = 0; ) :: -subsection:: OSC Messaging Style -code:: -// allocate a disk i/o buffer -s.sendMsg("/b_alloc", 0, 65536, 1); - -// open an input file for this buffer, leave it open -s.sendMsg("/b_read", 0, Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 65536, 0, 1); - -// create a diskin node -s.sendMsg("/s_new", "help-Diskin", x = s.nextNodeID, 1, 1); - -s.sendMsg("/b_close", 0); // close the file (very important!) - - -// again -// don't need to reallocate and Synth is still reading -s.sendMsg("/b_read", 0, Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 0, 0, 1); - -s.sendMsg("/n_free", x); // stop reading - -s.sendMsg("/b_close", 0); // close the file. - -s.sendMsg("/b_free", 0); // frees the buffer -:: - -subsection:: Using Buffer (Object Style) +subsection:: Normal usage (with Buffer; "Object Style") code:: b = Buffer.cueSoundFile(s, Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 1); @@ -122,3 +98,28 @@ b = Buffer.cueSoundFile(s,Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff",0 :: +subsection:: OSC Messaging Style +code:: +// allocate a disk i/o buffer +s.sendMsg("/b_alloc", 0, 65536, 1); + +// open an input file for this buffer, leave it open +s.sendMsg("/b_read", 0, Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 65536, 0, 1); + +// create a diskin node +s.sendMsg("/s_new", "help-Diskin", x = s.nextNodeID, 1, 1); + +s.sendMsg("/b_close", 0); // close the file (very important!) + + +// again +// don't need to reallocate and Synth is still reading +s.sendMsg("/b_read", 0, Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 0, 0, 1); + +s.sendMsg("/n_free", x); // stop reading + +s.sendMsg("/b_close", 0); // close the file. + +s.sendMsg("/b_free", 0); // frees the buffer +:: + -- 2.11.4.GIT