Debian Codegraph @

src/Examples/McCurdy Collection/MIDI/MIDIOneControllerTwoOutputs.csd

raw
1 ;Writen by Iain McCurdy, 2006
2
3 ; Modified for QuteCsound by René, February 2011
4 ; Tested on Ubuntu 10.04 with csound-float 5.13.0 and QuteCsound svn rev 817
5
6 ;Notes on modifications from original csd:
7 ; Add scope for fun
8
9
10 ;my flags on Ubuntu: -dm0 -odac -+rtaudio=alsa -b1024 -B2048 -+rtmidi=alsa -Ma
11 <CsoundSynthesizer>
12 <CsOptions>
13
14 </CsOptions>
15 <CsInstruments>
16 sr = 44100 ;SAMPLE RATE
17 ksmps = 2 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE
18 nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
19 0dbfs = 1 ;MAXIMUM AMPLITUDE REGARDLESS OF BIT DEPTH
20
21
22 instr 1 ; SIMPLE BEEP INSTRUMENT - CAN BE ACTIVATED VIA A CONNECTED MIDI KEYBOARD
23
24 ;OUTPUT OPCODE CHANNEL | CTRLNUMBER | MINIMUM | MAXIMUM
25 koct1 ctrl7 1, 1, 8, 9 ;READ CONTROLLER INFORMATION FROM CONTINUOUS CONTROLLER NUMBER 1 ON MIDI CHANNEL 1 AND RESCALE TO BE WITHIN THE RANGE 8 - 9. BOTH CTRL7S REFERENCE THE SAME MIDI CONTROLLER
26 koct2 ctrl7 1, 1, 8, 7 ;READ CONTROLLER INFORMATION FROM CONTINUOUS CONTROLLER NUMBER 1 ON MIDI CHANNEL 1 AND RESCALE TO BE WITHIN THE RANGE 8 - 7. BOTH CTRL7S REFERENCE THE SAME MIDI CONTROLLER
27
28 ;OUTPUT OPCODE AMPLITUDE | FREQUENCY | F.N.
29 asig1 oscili 0.25, cpsoct(koct1), 1 ;TWO OSCILLATORS ARE CREATED WITH DIFFERENT FREQUENCIES - FREQUENCY VARIABLES MUST BE CONVERTED INTO CPS FORMAT FROM OCT FORMAT
30 asig2 oscili 0.25, cpsoct(koct2), 1 ;TWO OSCILLATORS ARE CREATED WITH DIFFERENT FREQUENCIES - FREQUENCY VARIABLES MUST BE CONVERTED INTO CPS FORMAT FROM OCT FORMAT
31
32 outs (asig1 + asig2), (asig1 + asig2) ;THE TWO OSCILLATORS ARE MIXED AND SENT TO THE OUTPUT
33 endin
34 </CsInstruments>
35 <CsScore>
36 f 1 0 129 10 1 ; SINE WAVE
37 i 1 0 3600 ; INSTRUMENT 1 PLAYS A NOTE FOR 1 HOUR
38 </CsScore>
39 </CsoundSynthesizer>
40 <bsbPanel>
41 <label>Widgets</label>
42 <objectName/>
43 <x>1172</x>
44 <y>505</y>
45 <width>498</width>
46 <height>298</height>
47 <visible>true</visible>
48 <uuid/>
49 <bgcolor mode="nobackground">
50 <r>170</r>
51 <g>170</g>
52 <b>170</b>
53 </bgcolor>
54 <bsbObject version="2" type="BSBLabel">
55 <objectName/>
56 <x>2</x>
57 <y>2</y>
58 <width>492</width>
59 <height>292</height>
60 <uuid>{c37e13f6-7642-465f-9b2a-f059eef7bce8}</uuid>
61 <visible>true</visible>
62 <midichan>0</midichan>
63 <midicc>0</midicc>
64 <label>A Single MIDI controller creates two Csound variables</label>
65 <alignment>center</alignment>
66 <font>Liberation Sans</font>
67 <fontsize>18</fontsize>
68 <precision>3</precision>
69 <color>
70 <r>0</r>
71 <g>0</g>
72 <b>0</b>
73 </color>
74 <bgcolor mode="background">
75 <r>244</r>
76 <g>248</g>
77 <b>200</b>
78 </bgcolor>
79 <bordermode>border</bordermode>
80 <borderradius>5</borderradius>
81 <borderwidth>2</borderwidth>
82 </bsbObject>
83 <bsbObject version="2" type="BSBLabel">
84 <objectName/>
85 <x>5</x>
86 <y>25</y>
87 <width>484</width>
88 <height>170</height>
89 <uuid>{e41f02b8-6ad4-46dc-805c-0b2eeafbd476}</uuid>
90 <visible>true</visible>
91 <midichan>0</midichan>
92 <midicc>0</midicc>
93 <label>------------------------------------------------------------------------------------------------------------------------
94 Move controller 1 on MIDI channel 1 or the modulation wheel on a MIDI keyboard set to channel 1. There is nothing to prevent you from using several instances of ctrl7 which reference the same MIDI controller. In this example the frequencies of two different oscillators are both driven by MIDI controller 1 on MIDI channel 1. The ranges of the two ctrl7s outputs are different however. As controller 1 is moved from minimum to maximum the pitch of oscillator 1 moves from C4 up to C5 but the pitch of oscillator 2 move from C4 down to C3.</label>
95 <alignment>left</alignment>
96 <font>Liberation Sans</font>
97 <fontsize>14</fontsize>
98 <precision>3</precision>
99 <color>
100 <r>0</r>
101 <g>0</g>
102 <b>0</b>
103 </color>
104 <bgcolor mode="nobackground">
105 <r>255</r>
106 <g>255</g>
107 <b>255</b>
108 </bgcolor>
109 <bordermode>noborder</bordermode>
110 <borderradius>1</borderradius>
111 <borderwidth>1</borderwidth>
112 </bsbObject>
113 <bsbObject version="2" type="BSBScope">
114 <objectName/>
115 <x>8</x>
116 <y>193</y>
117 <width>480</width>
118 <height>94</height>
119 <uuid>{eae32263-3d06-4f56-8de0-7386f6c41439}</uuid>
120 <visible>true</visible>
121 <midichan>0</midichan>
122 <midicc>0</midicc>
123 <value>-255.00000000</value>
124 <type>scope</type>
125 <zoomx>2.00000000</zoomx>
126 <zoomy>1.00000000</zoomy>
127 <dispx>1.00000000</dispx>
128 <dispy>1.00000000</dispy>
129 <mode>0.00000000</mode>
130 </bsbObject>
131 </bsbPanel>
132 <bsbPresets>
133 </bsbPresets>