From 5aef03b3a165b309622f6d051bd4d53c42b4532d Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Mon, 25 Nov 2002 10:47:53 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r232, which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=233 --- pd/doc/3.audio.examples/01.PART1.sinewave.pd | 36 +- pd/doc/3.audio.examples/02.amplitude.pd | 10 +- pd/doc/3.audio.examples/03.line.pd | 37 +- pd/doc/3.audio.examples/05.output.subpatch.pd | 105 +--- pd/doc/3.audio.examples/06.frequency.pd | 113 +--- pd/doc/3.audio.examples/output~.pd | 62 ++ pd/doc/3.audio.examples/x.ps | 844 ++++++++++++++++++++++++++ 7 files changed, 1000 insertions(+), 207 deletions(-) create mode 100644 pd/doc/3.audio.examples/output~.pd create mode 100644 pd/doc/3.audio.examples/x.ps (limited to 'pd/doc/3.audio.examples') diff --git a/pd/doc/3.audio.examples/01.PART1.sinewave.pd b/pd/doc/3.audio.examples/01.PART1.sinewave.pd index 091d7f6b..42b8aed0 100644 --- a/pd/doc/3.audio.examples/01.PART1.sinewave.pd +++ b/pd/doc/3.audio.examples/01.PART1.sinewave.pd @@ -1,20 +1,32 @@ -#N canvas 6 2 628 515 12; +#N canvas 6 2 588 513 12; #X obj 108 109 osc~ 440; #X obj 108 168 dac~; -#X text 176 110 <-- 440 Hz. sine wave at full blast; -#X text 175 138 <-- reduce volume; +#X text 187 111 <-- 440 Hz. sine wave at full blast; #X obj 108 138 *~ 0.05; -#X text 174 168 <-- send to the audio output device; #X text 202 3 MAKING A SINE WAVE; -#X text 32 195 Audio computation can be turned on and off by sending messages to the global "pd" object as follows:; +#X text 32 195 Audio computation can be turned on and off by sending +messages to the global "pd" object as follows:; #X msg 98 239 \; pd dsp 1; #X msg 202 239 \; pd dsp 0; #X text 113 276 ON; #X text 222 276 OFF; -#X text 29 297 You should see the Pd window change to reflect whether audio is on or off. You can also turn audio on and off using the "audio" menu \, but the buttons are provided as a shortcut.; -#X text 30 368 When DSP is on \, you should hear a tone whose pitch is A 440 and whose amplitude is 0.05. If instead you are greeted with silence \, you might want to read the HTML documentation on setting up audio.; -#X text 28 434 In general when you start a work session with Pd \, you will want to choose "test audio and MIDI" from the help window \, which opens a more comprehensive test patch than this one.; -#X text 32 23 Audio computation in Pd is done using "tilde objects" such as the three below. THey use continuous audio streams to intercommunicate. They can be controlled by sending them messages. A few analysis modules take audio streams in and put control messages back out.; -#X text 378 491 updated for Pd version 0.33; -#X connect 0 0 4 0; -#X connect 4 0 1 0; +#X text 29 297 You should see the Pd window change to reflect whether +audio is on or off. You can also turn audio on and off using the "audio" +menu \, but the buttons are provided as a shortcut.; +#X text 30 368 When DSP is on \, you should hear a tone whose pitch +is A 440 and whose amplitude is 0.05. If instead you are greeted with +silence \, you might want to read the HTML documentation on setting +up audio.; +#X text 28 434 In general when you start a work session with Pd \, +you will want to choose "test audio and MIDI" from the help window +\, which opens a more comprehensive test patch than this one.; +#X text 296 247 <-- click these; +#X text 187 139 <-- reduce amplitude to 0.05; +#X text 160 168 <----- send to the audio output device; +#X text 32 23 Audio computation in Pd is done using "tilde objects" +such as the three below. They use continuous audio streams to intercommunicate +\, as well as communicating with other ("control") Pd objects using +messages.; +#X text 342 490 updated for Pd version 0.36; +#X connect 0 0 3 0; +#X connect 3 0 1 0; diff --git a/pd/doc/3.audio.examples/02.amplitude.pd b/pd/doc/3.audio.examples/02.amplitude.pd index 814d7d7c..d24be18d 100644 --- a/pd/doc/3.audio.examples/02.amplitude.pd +++ b/pd/doc/3.audio.examples/02.amplitude.pd @@ -12,12 +12,11 @@ range \, but when you output a signal via the dac~ object \, the samples should range between -1 and +1. Values out of that range will be "clipped." ; #X obj 64 202 *~ 0; -#X floatatom 103 163 0 0 0; -#X obj 91 130 dbtorms; -#X floatatom 91 98 0 0 80; -#X text 137 98 <-- set amplitude here in dB; +#X floatatom 107 165 0 0 0 0 - - -; +#X obj 95 132 dbtorms; +#X floatatom 95 100 0 0 80 0 - - -; +#X text 141 100 <-- set amplitude here in dB; #X text 211 133 <-- this converts dB to linear units; -#X text 114 282 <-- and out. We'resending to both channels now.; #X text 210 164 <-- this shows the linear gain; #X text 116 204 <-- multiply the sine wave by the gain \, reducing its amplitude. You can also use the "*~" object to multiply two signals. @@ -29,6 +28,7 @@ to one \, and zero dB artificially outputs a true 0; #X text 34 452 Pd assumes you have a two channel audio system unless you tell it otherwise.; #X text 440 486 updated for Pd version 0.33; +#X text 114 282 <-- and out. We're sending to both channels now.; #X connect 0 0 9 0; #X connect 9 0 1 0; #X connect 9 0 1 1; diff --git a/pd/doc/3.audio.examples/03.line.pd b/pd/doc/3.audio.examples/03.line.pd index 535152f2..392df533 100644 --- a/pd/doc/3.audio.examples/03.line.pd +++ b/pd/doc/3.audio.examples/03.line.pd @@ -1,4 +1,4 @@ -#N canvas 30 68 683 481 12; +#N canvas 369 106 647 598 12; #X obj 56 79 osc~ 440; #X obj 56 309 dac~; #X msg 446 79 \; pd dsp 1; @@ -6,38 +6,43 @@ #X text 467 112 ON; #X text 555 112 OFF; #X obj 56 269 *~; -#X obj 72 235 line~; -#X text 129 235 <--- ramp generator; -#X text 124 78 <-- sine wave; +#X obj 72 243 line~; +#X text 129 243 <--- ramp generator; +#X text 132 78 <-- sine wave; #X msg 72 103 0.1 2000; -#X msg 72 169 0 2000; +#X msg 72 177 0 2000; #X msg 72 125 0.1 50; -#X msg 72 191 0 50; +#X msg 72 199 0 50; #X msg 72 147 0.1; -#X msg 72 213 0; +#X msg 72 221 0; #X text 274 124 ON; #X text 154 105 <-- slow; #X text 144 126 <-- fast; #X text 111 146 <-- instantly; -#X text 271 189 OFF; -#X text 136 170 <-- slow; -#X text 129 191 <-- fast; -#X text 109 211 <-- instantly; -#X text 135 159 ----------------------; -#X text 93 268 <-- multiply the sine wave by the ramp. There's no longer -a "0" argument; +#X text 271 197 OFF; +#X text 136 178 <-- slow; +#X text 129 199 <-- fast; +#X text 109 219 <-- instantly; +#X text 112 161 ----------------------; #X text 97 308 <-- out; #X text 103 7 CONTROLLING AMPLITUDE USING LINE~; #X text 38 342 Line~'s left inlet is a target value \; it reaches that target in the time specified (in milliseconds) to its right inlet. ; -#X text 39 396 The line~ object (and its control brother \, line) treat +#X text 34 495 The line~ object (and its control brother \, line) treat their right inlet specially. The inlets don't retain values the way other inlets do but revert to zero whenever a target is received.; #X text 14 27 In this patch \, the multiplier is configured to multiply two signals. The amplitude is now a signal computed by the line~ object. ; -#X text 415 457 updated for Pd version 0.33; +#X text 37 395 (In this example \, message boxes with two numbers each +are connected to line~'s left inlet. Except in some special cases \, +Pd objects with more than one inlet will automatically distribute lists +of numbers across their inlets. In this case \, "0 50" becomes \, "50 +at right and 0 at left."); +#X text 386 557 updated for Pd version 0.36; +#X text 93 268 <-- multiply the sine wave by the ramp. There's no longer +a "0" argument-- this tells Pd to expect a signal here.; #X connect 0 0 6 0; #X connect 6 0 1 0; #X connect 6 0 1 1; diff --git a/pd/doc/3.audio.examples/05.output.subpatch.pd b/pd/doc/3.audio.examples/05.output.subpatch.pd index ab0dc724..d24fdba2 100644 --- a/pd/doc/3.audio.examples/05.output.subpatch.pd +++ b/pd/doc/3.audio.examples/05.output.subpatch.pd @@ -1,97 +1,30 @@ -#N canvas 68 39 635 486 12; -#X floatatom 70 181 0 0 100; -#N canvas 331 136 786 621 output 0; -#X obj 455 510 t b; -#X obj 455 450 f; -#X obj 455 390 inlet; -#X obj 455 540 f; -#X msg 566 532 0; -#X msg 455 420 bang; -#X obj 455 480 moses 1; -#X obj 566 502 t b f; -#X obj 535 460 moses 1; -#X obj 107 121 dbtorms; -#X obj 535 430 r master-lvl; -#X obj 107 28 r master-lvl; -#X obj 455 570 s master-lvl; -#X obj 36 228 inlet~; -#X obj 250 258 inlet; -#X obj 268 283 s master-lvl; -#X msg 119 57 set \$1; -#X obj 119 87 outlet; -#X msg 250 309 \; pd dsp 1; -#X obj 107 181 line~; -#X obj 36 258 *~; -#X obj 36 288 dac~; -#X obj 107 151 pack 0 50; -#X text 23 205 audio in; -#X text 2 313 out both channels; -#X text 273 182 Level input. Send to master-lvl and start DSP (we infer -that if you're changing the level you want to hear the network.) If -you start DSP when it's already running there's no effect.; -#X text 59 542 here is the previous nonzero master-lvl -->; -#X text 98 451 recall previous value of master-lvl -->; -#X text 239 482 test if less than 1 -->; -#X text 203 510 if true convert to bang -->; -#X text 218 351 Mute control. If the master level is zero \, restore -to the last nonzero one \, otherwise zero it.; -#X text 182 86 <-- update the number box to show new level; -#X text 178 120 <-- convert from dB to linear units; -#X text 196 150 <-- make a smooth ramp to avoid clicks or zipper noise -; -#X text 333 318 <-- automatically start DSP; -#X connect 0 0 3 0; -#X connect 1 0 6 0; -#X connect 2 0 5 0; -#X connect 3 0 12 0; -#X connect 4 0 12 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 6 1 7 0; -#X connect 7 0 4 0; -#X connect 8 1 3 1; -#X connect 9 0 22 0; -#X connect 10 0 1 1; -#X connect 10 0 8 0; -#X connect 11 0 9 0; -#X connect 11 0 16 0; -#X connect 13 0 20 0; -#X connect 14 0 15 0; -#X connect 14 0 18 0; -#X connect 16 0 17 0; -#X connect 19 0 20 1; -#X connect 20 0 21 0; -#X connect 20 0 21 1; -#X connect 22 0 19 0; -#X restore 32 214 pd output; -#X msg 108 182 MUTE; +#N canvas 300 159 635 486 12; +#X text 261 20 CONTROLLING OUTPUT AMPLITUDE; #X obj 32 27 osc~ 440; #X obj 54 55 osc~ 550; #X obj 54 116 osc~ 660; #X obj 32 88 +~; #X obj 32 142 +~; -#X text 122 216 <-- this is a subwindow--click on it to see inside. +#X text 108 177 <-- this is a subwindow--right click on it; +#X text 149 197 and select "open" to see inside.; +#X text 30 401 The output control automatically starts DSP whenever +you touch the level control. Hitting "mute" toggles between the current +level and zero.; +#X obj 32 173 output~; +#X text 383 463 updated for Pd version 0.36; +#X text 143 115 <-- Here we make an A major triad as a test signal. ; -#X text 158 182 <-- output amplitude and mute control; -#X text 383 463 updated for Pd version 0.34; -#X text 24 408 The output control automatically starts DSP whenever -you touch the level control. "MUTE" toggles between the current level -and zero.; -#X text 157 115 <-- Here we make a simple triad as a test signal.; -#X text 261 20 CONTROLLING OUTPUT AMPLITUDE; -#X text 25 263 In this and subsequent patches \, we'll use a subwindow +#X text 31 250 In this and subsequent patches \, we'll use a subwindow \, "output" \, to control overall amplitude. The amplitudes are in decibels \, with 100 being full blast. In this example \, you can't actually push the output amplitude past 90 or so without clipping. You'll know you're clipping if \, instead of an A major chord \, you hear a single \, distorted tone two octaves down. The clipping happens -at Pd's last stage of audio output. All audio signals internal to Pd -have essentially no level limit.; -#X connect 0 0 1 1; -#X connect 1 0 0 0; -#X connect 2 0 1 2; -#X connect 3 0 6 0; -#X connect 4 0 6 1; -#X connect 5 0 7 1; -#X connect 6 0 7 0; -#X connect 7 0 1 0; +at Pd's last stage of audio output. Audio signals internal to Pd have +essentially no level limit.; +#X connect 1 0 4 0; +#X connect 2 0 4 1; +#X connect 3 0 5 1; +#X connect 4 0 5 0; +#X connect 5 0 9 0; +#X connect 5 0 9 1; diff --git a/pd/doc/3.audio.examples/06.frequency.pd b/pd/doc/3.audio.examples/06.frequency.pd index 5bc94801..50cff7c0 100644 --- a/pd/doc/3.audio.examples/06.frequency.pd +++ b/pd/doc/3.audio.examples/06.frequency.pd @@ -1,77 +1,15 @@ #N canvas 8 17 693 642 12; -#X graph graph1 0 -1.02 4410 1.02 473 297 673 167; +#N canvas 0 0 450 300 graph1 0; #X array osc-output 4410 float 0; -#X pop; -#X obj 128 259 tabwrite~ osc-output; -#X floatatom 53 294 0 0 100; -#N canvas 331 136 786 621 output 0; -#X obj 455 510 t b; -#X obj 455 450 f; -#X obj 455 390 inlet; -#X obj 455 540 f; -#X msg 566 532 0; -#X msg 455 420 bang; -#X obj 455 480 moses 1; -#X obj 566 502 t b f; -#X obj 521 458 moses 1; -#X obj 107 174 dbtorms; -#X obj 521 428 r master-lvl; -#X obj 107 56 r master-lvl; -#X obj 455 570 s master-lvl; -#X obj 36 228 inlet~; -#X obj 251 229 inlet; -#X obj 269 257 s master-lvl; -#X msg 119 85 set \$1; -#X obj 119 115 outlet; -#X msg 251 283 \; pd dsp 1; -#X obj 107 236 line~; -#X obj 36 258 *~; -#X obj 36 290 dac~; -#X obj 107 204 pack 0 50; -#X text 23 205 audio in; -#X text 2 313 out both channels; -#X text 246 157 Level input. Send to master-lvl and start DSP (we infer -that if you're changing the level you want to hear the network.) If -you start DSP when it's already running there's no effect.; -#X text 59 542 here is the previous nonzero master-lvl -->; -#X text 98 451 recall previous value of master-lvl -->; -#X text 239 482 test if less than 1 -->; -#X text 203 510 if true convert to bang -->; -#X text 218 351 Mute control. If the master level is zero \, restore -to the last nonzero one \, otherwise zero it.; -#X text 182 114 <-- update the number box to show new level; -#X connect 0 0 3 0; -#X connect 1 0 6 0; -#X connect 2 0 5 0; -#X connect 3 0 12 0; -#X connect 4 0 12 0; -#X connect 5 0 1 0; -#X connect 6 0 0 0; -#X connect 6 1 7 0; -#X connect 7 0 4 0; -#X connect 8 1 3 1; -#X connect 9 0 22 0; -#X connect 10 0 1 1; -#X connect 10 0 8 0; -#X connect 11 0 9 0; -#X connect 11 0 16 0; -#X connect 13 0 20 0; -#X connect 14 0 15 0; -#X connect 14 0 18 0; -#X connect 16 0 17 0; -#X connect 19 0 20 1; -#X connect 20 0 21 0; -#X connect 20 0 21 1; -#X connect 22 0 19 0; -#X restore 15 327 pd output; -#X msg 91 295 MUTE; -#X msg 128 230 bang; -#X floatatom 280 66 0 0 0; -#X text 177 229 <-- click to graph; +#X coords 0 1.02 4410 -1.02 200 130 1; +#X restore 473 167 graph; +#X obj 98 261 tabwrite~ osc-output; +#X msg 98 232 bang; +#X floatatom 280 66 0 0 0 0 - - -; +#X text 147 231 <-- click to graph; #X obj 15 206 r frequency; -#X obj 15 232 osc~ 0; #X msg 280 37 set \$1; -#X floatatom 6 66 0 0 0; +#X floatatom 6 66 0 0 0 0 - - -; #X obj 6 8 r frequency; #X msg 6 37 set \$1; #X obj 19 90 s frequency; @@ -99,25 +37,24 @@ its frequency is controlled by connecting an audio signal to its input. #X text 15 553 Note also the "set" messages going to the number boxes so that they can each update the other without bringing on an infinite loop. (get help on number boxes for details.); -#X text 437 619 updated for Pd version 0.34; -#X text 141 295 <-- output level; +#X text 87 291 <-- output level; #X text 51 116 <-- convert frequency; #X text 106 134 to "MIDI" pitch; #X text 327 117 <-- convert "MIDI" pitch to frequency; -#X connect 2 0 3 1; -#X connect 3 0 2 0; -#X connect 4 0 3 2; -#X connect 5 0 1 0; -#X connect 6 0 16 0; -#X connect 6 0 17 0; +#X obj 15 273 output~; +#X text 437 619 updated for Pd version 0.36; +#X obj 15 232 osc~; +#X connect 2 0 1 0; +#X connect 3 0 12 0; +#X connect 3 0 13 0; +#X connect 5 0 31 0; +#X connect 6 0 3 0; +#X connect 7 0 10 0; +#X connect 7 0 16 0; #X connect 8 0 9 0; -#X connect 9 0 1 0; -#X connect 9 0 3 0; -#X connect 10 0 6 0; -#X connect 11 0 14 0; -#X connect 11 0 20 0; -#X connect 12 0 13 0; -#X connect 13 0 11 0; -#X connect 15 0 10 0; -#X connect 17 0 18 0; -#X connect 20 0 19 0; +#X connect 9 0 7 0; +#X connect 11 0 6 0; +#X connect 13 0 14 0; +#X connect 16 0 15 0; +#X connect 31 0 1 0; +#X connect 31 0 29 0; diff --git a/pd/doc/3.audio.examples/output~.pd b/pd/doc/3.audio.examples/output~.pd new file mode 100644 index 00000000..13ae9252 --- /dev/null +++ b/pd/doc/3.audio.examples/output~.pd @@ -0,0 +1,62 @@ +#N canvas 0 0 757 616 12; +#X obj 516 522 t b; +#X obj 516 469 f; +#X obj 516 547 f; +#X msg 630 546 0; +#X obj 516 499 moses 1; +#X obj 630 518 t b f; +#X obj 596 479 moses 1; +#X obj 30 117 dbtorms; +#X obj 83 208 inlet~; +#X msg 341 285 \; pd dsp 1; +#X obj 27 208 line~; +#X obj 61 242 *~; +#X obj 61 272 dac~; +#X obj 30 147 pack 0 50; +#X text 110 184 audio in; +#X text 301 496 test if less than 1 -->; +#X text 267 523 if true convert to bang -->; +#X text 101 116 <-- convert from dB to linear units; +#X floatatom 341 221 3 0 100 0 dB - -; +#X obj 516 449 bng 15 250 50 0 empty empty mute -38 7 0 12 -262144 +-1 -1; +#X text 119 146 <-- make a ramp to avoid clicks or zipper noise; +#X obj 172 209 inlet~; +#X obj 151 241 *~; +#X text 502 399 MUTE logic:; +#X obj 341 193 r \$0-master-lvl; +#X obj 516 573 s \$0-master-lvl; +#X obj 356 248 s \$0-master-out; +#X obj 30 91 r \$0-master-out; +#X obj 596 450 r \$0-master-out; +#X text 60 10 Level control abstraction \, used in many of the Pd example +patches. The "level" and "mute" controls show up on the parent \, calling +patch.; +#X text 229 549 previous nonzero master-lvl -->; +#X text 301 453 recall previous; +#X text 301 471 value of master-lvl -->; +#X text 79 295 automatically start DSP -->; +#X connect 0 0 2 0; +#X connect 1 0 4 0; +#X connect 2 0 25 0; +#X connect 3 0 25 0; +#X connect 4 0 0 0; +#X connect 4 1 5 0; +#X connect 5 0 3 0; +#X connect 6 1 2 1; +#X connect 7 0 13 0; +#X connect 8 0 11 1; +#X connect 10 0 11 1; +#X connect 10 0 22 0; +#X connect 11 0 12 0; +#X connect 13 0 10 0; +#X connect 18 0 9 0; +#X connect 18 0 26 0; +#X connect 19 0 1 0; +#X connect 21 0 22 1; +#X connect 22 0 12 1; +#X connect 24 0 18 0; +#X connect 27 0 7 0; +#X connect 28 0 1 1; +#X connect 28 0 6 0; +#X coords 0 0 1 1 65 55 1; diff --git a/pd/doc/3.audio.examples/x.ps b/pd/doc/3.audio.examples/x.ps new file mode 100644 index 00000000..372dc540 --- /dev/null +++ b/pd/doc/3.audio.examples/x.ps @@ -0,0 +1,844 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: Tk Canvas Widget +%%For: msp +%%Title: Window .x80edcf8.c +%%CreationDate: Thu Aug 8 13:49:09 2002 +%%BoundingBox: 115 319 497 473 +%%Pages: 1 +%%DocumentData: Clean7Bit +%%Orientation: Portrait +%%DocumentNeededResources: font Courier-Bold +%%EndComments + +%%BeginProlog +50 dict begin + +% This is a standard prolog for Postscript generated by Tk's canvas +% widget. +% RCS: @(#) $Id: x.ps,v 1.1.1.1 2002-11-25 10:47:48 ggeiger Exp $ + +% The definitions below just define all of the variables used in +% any of the procedures here. This is needed for obscure reasons +% explained on p. 716 of the Postscript manual (Section H.2.7, +% "Initializing Variables," in the section on Encapsulated Postscript). + +/baseline 0 def +/stipimage 0 def +/height 0 def +/justify 0 def +/lineLength 0 def +/spacing 0 def +/stipple 0 def +/strings 0 def +/xoffset 0 def +/yoffset 0 def +/tmpstip null def + +% Define the array ISOLatin1Encoding (which specifies how characters are +% encoded for ISO-8859-1 fonts), if it isn't already present (Postscript +% level 2 is supposed to define it, but level 1 doesn't). + +systemdict /ISOLatin1Encoding known not { + /ISOLatin1Encoding [ + /space /space /space /space /space /space /space /space + /space /space /space /space /space /space /space /space + /space /space /space /space /space /space /space /space + /space /space /space /space /space /space /space /space + /space /exclam /quotedbl /numbersign /dollar /percent /ampersand + /quoteright + /parenleft /parenright /asterisk /plus /comma /minus /period /slash + /zero /one /two /three /four /five /six /seven + /eight /nine /colon /semicolon /less /equal /greater /question + /at /A /B /C /D /E /F /G + /H /I /J /K /L /M /N /O + /P /Q /R /S /T /U /V /W + /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore + /quoteleft /a /b /c /d /e /f /g + /h /i /j /k /l /m /n /o + /p /q /r /s /t /u /v /w + /x /y /z /braceleft /bar /braceright /asciitilde /space + /space /space /space /space /space /space /space /space + /space /space /space /space /space /space /space /space + /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent + /dieresis /space /ring /cedilla /space /hungarumlaut /ogonek /caron + /space /exclamdown /cent /sterling /currency /yen /brokenbar /section + /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen + /registered /macron + /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph + /periodcentered + /cedillar /onesuperior /ordmasculine /guillemotright /onequarter + /onehalf /threequarters /questiondown + /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla + /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex + /Idieresis + /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply + /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn + /germandbls + /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla + /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex + /idieresis + /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide + /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn + /ydieresis + ] def +} if + +% font ISOEncode font +% This procedure changes the encoding of a font from the default +% Postscript encoding to ISOLatin1. It's typically invoked just +% before invoking "setfont". The body of this procedure comes from +% Section 5.6.1 of the Postscript book. + +/ISOEncode { + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding ISOLatin1Encoding def + currentdict + end + + % I'm not sure why it's necessary to use "definefont" on this new + % font, but it seems to be important; just use the name "Temporary" + % for the font. + + /Temporary exch definefont +} bind def + +% StrokeClip +% +% This procedure converts the current path into a clip area under +% the assumption of stroking. It's a bit tricky because some Postscript +% interpreters get errors during strokepath for dashed lines. If +% this happens then turn off dashes and try again. + +/StrokeClip { + {strokepath} stopped { + (This Postscript printer gets limitcheck overflows when) = + (stippling dashed lines; lines will be printed solid instead.) = + [] 0 setdash strokepath} if + clip +} bind def + +% desiredSize EvenPixels closestSize +% +% The procedure below is used for stippling. Given the optimal size +% of a dot in a stipple pattern in the current user coordinate system, +% compute the closest size that is an exact multiple of the device's +% pixel size. This allows stipple patterns to be displayed without +% aliasing effects. + +/EvenPixels { + % Compute exact number of device pixels per stipple dot. + dup 0 matrix currentmatrix dtransform + dup mul exch dup mul add sqrt + + % Round to an integer, make sure the number is at least 1, and compute + % user coord distance corresponding to this. + dup round dup 1 lt {pop 1} if + exch div mul +} bind def + +% width height string StippleFill -- +% +% Given a path already set up and a clipping region generated from +% it, this procedure will fill the clipping region with a stipple +% pattern. "String" contains a proper image description of the +% stipple pattern and "width" and "height" give its dimensions. Each +% stipple dot is assumed to be about one unit across in the current +% user coordinate system. This procedure trashes the graphics state. + +/StippleFill { + % The following code is needed to work around a NeWSprint bug. + + /tmpstip 1 index def + + % Change the scaling so that one user unit in user coordinates + % corresponds to the size of one stipple dot. + 1 EvenPixels dup scale + + % Compute the bounding box occupied by the path (which is now + % the clipping region), and round the lower coordinates down + % to the nearest starting point for the stipple pattern. Be + % careful about negative numbers, since the rounding works + % differently on them. + + pathbbox + 4 2 roll + 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll + 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll + + % Stack now: width height string y1 y2 x1 x2 + % Below is a doubly-nested for loop to iterate across this area + % in units of the stipple pattern size, going up columns then + % across rows, blasting out a stipple-pattern-sized rectangle at + % each position + + 6 index exch { + 2 index 5 index 3 index { + % Stack now: width height string y1 y2 x y + + gsave + 1 index exch translate + 5 index 5 index true matrix tmpstip imagemask + grestore + } for + pop + } for + pop pop pop pop pop +} bind def + +% -- AdjustColor -- +% Given a color value already set for output by the caller, adjusts +% that value to a grayscale or mono value if requested by the CL +% variable. + +/AdjustColor { + CL 2 lt { + currentgray + CL 0 eq { + .5 lt {0} {1} ifelse + } if + setgray + } if +} bind def + +% x y strings spacing xoffset yoffset justify stipple DrawText -- +% This procedure does all of the real work of drawing text. The +% color and font must already have been set by the caller, and the +% following arguments must be on the stack: +% +% x, y - Coordinates at which to draw text. +% strings - An array of strings, one for each line of the text item, +% in order from top to bottom. +% spacing - Spacing between lines. +% xoffset - Horizontal offset for text bbox relative to x and y: 0 for +% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se. +% yoffset - Vertical offset for text bbox relative to x and y: 0 for +% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se. +% justify - 0 for left justification, 0.5 for center, 1 for right justify. +% stipple - Boolean value indicating whether or not text is to be +% drawn in stippled fashion. If text is stippled, +% procedure StippleText must have been defined to call +% StippleFill in the right way. +% +% Also, when this procedure is invoked, the color and font must already +% have been set for the text. + +/DrawText { + /stipple exch def + /justify exch def + /yoffset exch def + /xoffset exch def + /spacing exch def + /strings exch def + + % First scan through all of the text to find the widest line. + + /lineLength 0 def + strings { + stringwidth pop + dup lineLength gt {/lineLength exch def} {pop} ifelse + newpath + } forall + + % Compute the baseline offset and the actual font height. + + 0 0 moveto (TXygqPZ) false charpath + pathbbox dup /baseline exch def + exch pop exch sub /height exch def pop + newpath + + % Translate coordinates first so that the origin is at the upper-left + % corner of the text's bounding box. Remember that x and y for + % positioning are still on the stack. + + translate + lineLength xoffset mul + strings length 1 sub spacing mul height add yoffset mul translate + + % Now use the baseline and justification information to translate so + % that the origin is at the baseline and positioning point for the + % first line of text. + + justify lineLength mul baseline neg translate + + % Iterate over each of the lines to output it. For each line, + % compute its width again so it can be properly justified, then + % display it. + + strings { + dup stringwidth pop + justify neg mul 0 moveto + stipple { + + % The text is stippled, so turn it into a path and print + % by calling StippledText, which in turn calls StippleFill. + % Unfortunately, many Postscript interpreters will get + % overflow errors if we try to do the whole string at + % once, so do it a character at a time. + + gsave + /char (X) def + { + char 0 3 -1 roll put + currentpoint + gsave + char true charpath clip StippleText + grestore + char stringwidth translate + moveto + } forall + grestore + } {show} ifelse + 0 spacing neg translate + } forall +} bind def + +%%EndProlog +%%BeginSetup +/CL 2 def +%%IncludeResource: font Courier-Bold +%%EndSetup + +%%Page: 1 1 +save +306.0 396.0 translate +0.846 0.846 scale +-224 -91 translate +-1 182 moveto 449 182 lineto 449 0 lineto -1 0 lineto closepath clip newpath +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +231 103 [ +(50.3695) +] 13 -0 0 0 false DrawText +grestore +gsave +230 105 moveto +281 105 lineto +285 101 lineto +285 88 lineto +230 88 lineto +230 105 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +230 89 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +230 105 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +231 125 [ +(set $1) +] 13 -0 0 0 false DrawText +grestore +gsave +230 127 moveto +278 127 lineto +274 123 lineto +274 114 lineto +278 110 lineto +230 110 lineto +230 127 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +230 111 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +230 127 moveto 7 0 rlineto 0 -0.999999999999993 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +16 103 [ +(150) +] 13 -0 0 0 false DrawText +grestore +gsave +15 105 moveto +38 105 lineto +42 101 lineto +42 88 lineto +15 88 lineto +15 105 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +15 89 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +15 105 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +16 148 [ +(r frequency) +] 13 -0 0 0 false DrawText +grestore +gsave +15 150 moveto +94 150 lineto +94 133 lineto +15 133 lineto +15 150 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +15 134 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +16 125 [ +(set $1) +] 13 -0 0 0 false DrawText +grestore +gsave +15 127 moveto +63 127 lineto +59 123 lineto +59 114 lineto +63 110 lineto +15 110 lineto +15 127 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +15 111 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +15 127 moveto 7 0 rlineto 0 -0.999999999999993 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +29 79 [ +(s frequency) +] 13 -0 0 0 false DrawText +grestore +gsave +28 81 moveto +107 81 lineto +107 64 lineto +28 64 lineto +28 81 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +28 81 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +231 148 [ +(r pitch) +] 13 -0 0 0 false DrawText +grestore +gsave +230 150 moveto +281 150 lineto +281 133 lineto +230 133 lineto +230 150 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +230 134 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +240 79 [ +(s pitch) +] 13 -0 0 0 false DrawText +grestore +gsave +239 81 moveto +290 81 lineto +290 64 lineto +239 64 lineto +239 81 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +239 81 moveto 7.00000000000006 0 rlineto 0 -1 rlineto -7.00000000000006 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +231 57 [ +(mtof) +] 13 -0 0 0 false DrawText +grestore +gsave +230 59 moveto +260 59 lineto +260 42 lineto +230 42 lineto +230 59 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +230 43 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +230 59 moveto 7 0 rlineto 0 -1.00000000000003 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +231 33 [ +(s frequency) +] 13 -0 0 0 false DrawText +grestore +gsave +230 35 moveto +309 35 lineto +309 18 lineto +230 18 lineto +230 35 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +230 35 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +16 33 [ +(s pitch) +] 13 -0 0 0 false DrawText +grestore +gsave +15 35 moveto +66 35 lineto +66 18 lineto +15 18 lineto +15 35 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +15 35 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +16 57 [ +(ftom) +] 13 -0 0 0 false DrawText +grestore +gsave +15 59 moveto +45 59 lineto +45 42 lineto +15 42 lineto +15 59 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +15 43 moveto 7 0 rlineto 0 -1 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +15 59 moveto 7 0 rlineto 0 -1.00000000000003 rlineto -7 0 rlineto closepath +0 setlinejoin 2 setlinecap +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +77 103 [ +(<-- set frequency) +] 13 -0 0 0 false DrawText +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +291 102 [ +(<-- set MIDI pitch) +] 13 -0 0 0 false DrawText +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +51 56 [ +(<-- convert frequency) +] 13 -0 0 0 false DrawText +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +92 41 [ +(to "MIDI" pitch) +] 13 -0 0 0 false DrawText +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +269 56 [ +(<-- convert "MIDI" pitch) +] 13 -0 0 0 false DrawText +grestore +gsave +233 88 moveto +242 81 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +233 88 moveto +233 59 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +233 110 moveto +233 105 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +18 88 moveto +31 81 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +18 88 moveto +18 59 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +18 133 moveto +18 127 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +18 110 moveto +18 105 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +233 133 moveto +233 127 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +233 42 moveto +233 35 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +18 42 moveto +18 35 lineto +0 setlinecap +1 setlinejoin +1 setlinewidth +[] 0 setdash +0.000 0.000 0.000 setrgbcolor AdjustColor +stroke +grestore +gsave +/Courier-Bold findfont 10 scalefont ISOEncode setfont +0.000 0.000 0.000 setrgbcolor AdjustColor +351 43 [ +(to frequency) +] 13 -0 0 0 false DrawText +grestore +restore showpage + +%%Trailer +end +%%EOF -- cgit v1.2.1