Debian Codegraph @

examples/JackoFreewheel.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 csound -m255 -M0 -+rtmidi=null -RWf --midi-key=4 --midi-velocity=5 -o jacko_test.wav
4 </CsOptions>
5 <CsInstruments>
6
7 ; NOTE: this csd must be run after starting the software synthesizer "aeolus -t".
8
9 sr = 48000 ; The control rate must be BOTH a power of 2 (for Jack)
10 ksmps = 128
11 nchnls = 2
12 0dbfs = 1
13
14 JackoInit "default", "csound"
15 ; JackoMidiInConnect "alsa_pcm:in-131-0-Master", "midiin"
16 JackoAudioInConnect "aeolus:out.L", "leftin"
17 JackoAudioInConnect "aeolus:out.R", "rightin"
18 JackoMidiOutConnect "midiout", "aeolus:Midi/in"
19
20 ; Note that Jack enables audio to be output to a regular Csound soundfile and, at the same time, to a
21 ; soundcard in real time to the system client via Jack.
22
23 JackoAudioOutConnect "leftout", "system:playback_1"
24 JackoAudioOutConnect "rightout", "system:playback_2"
25 JackoInfo
26
27 JackoFreewheel 1 ; Turning freewheeling on seems automatically to turn system playback off. This is good!
28
29 alwayson "jackin"
30
31 instr 1
32
33 ichannel = p1 - 1
34 itime = p2
35 iduration = p3
36 ikey = p4
37 ivelocity = p5
38 JackoNoteOut "midiout", ichannel, ikey, ivelocity
39 print itime, iduration, ichannel, ikey, ivelocity
40 endin
41
42 instr jackin
43
44 JackoTransport 3, 1.0
45 aleft JackoAudioIn "leftin"
46 aright JackoAudioIn "rightin"
47
48 ; Aeolus uses MIDI controller 98 to control stops. Only 1 data value byte is used, not the 2 data
49 ; bytes often used with NRPNs. The format for control mode is
50 ; 01mm0ggg: mm 10 to set stops, 0, ggg group (or Division, 0 based).
51 ; The format for stop selection is 000bbbbb: bbbbb for button number (0 based).
52
53 ; Mode to enable stops for Divison I: b1100010 (98) [this controller VALUE is a pure coincidence]).
54 JackoMidiOut "midiout", 176, 0, 98, 98
55
56 ; Stops: Principal 8 (0), Principal 4 (1) , Flote 8 (8) , Flote 2 (10)
57 JackoMidiOut "midiout", 176, 0, 98, 0
58 JackoMidiOut "midiout", 176, 0, 98, 1
59 JackoMidiOut "midiout", 176, 0, 98, 8
60 JackoMidiOut "midiout", 176, 0, 98, 10
61
62 ; Sends audio coming in from Aeolus out not only to the Jack system out (sound card), but also to the output soundfile.
63 ; Note that in freewheeling mode, "leftout" and "rightout" simply go silent.
64 JackoAudioOut "leftout", aleft
65 JackoAudioOut "rightout", aright
66 outs aright, aleft
67 endin
68
69 </CsInstruments>
70 <CsScore>
71 f 0 30
72 i 1 1 30 60 60
73 i 1 2 30 64 60
74 i 1 3 30 71 60
75 e 2
76 </CsScore>
77 </CsoundSynthesizer>