SCDoc: Use proper static string constants instead of comparing string literals.
[supercollider.git] / Help / Control / NoteOnResponder.html
blobff0086f22cb5baefd50b15ca30d13eac248f26d1
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.43">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #001fe8}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
16 p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #0000bf}
17 p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
18 p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000; min-height: 12.0px}
19 span.s1 {color: #000000}
20 span.s2 {text-decoration: underline}
21 span.s3 {color: #0000bf}
22 span.Apple-tab-span {white-space:pre}
23 </style>
24 </head>
25 <body>
26 <p class="p1"><b>NoteOnResponder</b></p>
27 <p class="p2"><br></p>
28 <p class="p3"><span class="s1">see also <a href="SC://MIDIResponder"><span class="s2">MIDIResponder</span></a></span></p>
29 <p class="p2"><br></p>
30 <p class="p4"><b>NoteOnResponder(function, src, chan, num, value, install = true,swallowEvent = false)</b></p>
31 <p class="p5"><br></p>
32 <p class="p6">(</p>
33 <p class="p7"><span class="s1"><span class="Apple-tab-span"> </span>c = </span>NoteOnResponder<span class="s1">({ </span>|src,chan,note,vel|</p>
34 <p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[src,chan,note,vel].postln;</p>
35 <p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>},</p>
36 <p class="p8"><span class="s1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><span class="s3">nil</span><span class="s1">, </span>// any source</p>
37 <p class="p8"><span class="s1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><span class="s3">nil</span><span class="s1">, </span>// any channel</p>
38 <p class="p8"><span class="s1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><span class="s3">nil</span><span class="s1">, </span>// any note</p>
39 <p class="p8"><span class="s1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><span class="s3">nil</span><span class="s1"> </span>// any vel</p>
40 <p class="p6"><span class="Apple-tab-span"> </span>)</p>
41 <p class="p6">)</p>
42 <p class="p9"><br></p>
43 <p class="p6">c.remove</p>
44 <p class="p9"><br></p>
45 <p class="p9"><br></p>
46 <p class="p6">(</p>
47 <p class="p7"><span class="s1"><span class="Apple-tab-span"> </span>c = </span>NoteOnResponder<span class="s1">({ </span>|src,chan,num,value|</p>
48 <p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[src,chan,num,value].postln;</p>
49 <p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>},</p>
50 <p class="p8"><span class="s1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><span class="s3">nil</span><span class="s1">, </span>// any source</p>
51 <p class="p8"><span class="s1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><span class="s3">nil</span><span class="s1">, </span>// any channel</p>
52 <p class="p8"><span class="s1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>(50..60), </span>// within this note range</p>
53 <p class="p8"><span class="s1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><span class="s3">nil</span><span class="s1"> </span>// any vel</p>
54 <p class="p6"><span class="Apple-tab-span"> </span>)</p>
55 <p class="p6">)</p>
56 <p class="p9"><br></p>
57 <p class="p6">c.remove</p>
58 <p class="p2"><br></p>
59 <p class="p4"><b>learn</b></p>
60 <p class="p2"><br></p>
61 <p class="p4">wait for the next midi note.<span class="Apple-converted-space">  </span>reset self to match to that src and chan</p>
62 <p class="p6">(</p>
63 <p class="p7"><span class="s1"><span class="Apple-tab-span"> </span>c = </span>NoteOnResponder<span class="s1">({ </span>|src,chan,num,value|</p>
64 <p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[src,chan,num,value].postln;</p>
65 <p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>});</p>
66 <p class="p8"><span class="s1"><span class="Apple-tab-span"> </span>c.learn; </span>// wait for the first note</p>
67 <p class="p6">)</p>
68 <p class="p9"><br></p>
69 <p class="p7">NoteOnResponder<span class="s1">.removeAll</span></p>
70 <p class="p9"><br></p>
71 </body>
72 </html>