-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #745 from tjingboem/7.0
several new examples
- Loading branch information
Showing
17 changed files
with
336 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<CsoundSynthesizer> | ||
<CsOptions> | ||
; Select audio/midi flags here according to platform | ||
;Anna.mid is a midi file, a song by The Beatles and can be found on the internet | ||
-odac -T -F Anna.mid;;;realtime audio I/O and midifile in | ||
;-iadc ;;;uncomment -iadc if realtime audio input is needed too | ||
; For Non-realtime ouput leave only the line below: | ||
; -o fluidControl-advanced.csd.wav -W ;;; for file output any platform | ||
</CsOptions> | ||
<CsInstruments> | ||
sr = 44100 | ||
ksmps = 32 | ||
nchnls = 2 | ||
0dbfs = 1 | ||
; Example by Istvan Varga | ||
; disable triggering of instruments by MIDI events | ||
ichn = 1 | ||
lp1: | ||
massign ichn, 0 | ||
loop_le ichn, 1, 16, lp1 | ||
pgmassign 0, 0 | ||
; initialize FluidSynth | ||
gifld fluidEngine | ||
gisf2 fluidLoad "sf_GMbank.sf2", gifld, 1 | ||
; k-rate version of fluidProgramSelect | ||
opcode fluidProgramSelect_k, 0, kkkkk | ||
keng, kchn, ksf2, kbnk, kpre xin | ||
igoto skipInit | ||
doInit: | ||
fluidProgramSelect i(keng), i(kchn), i(ksf2), i(kbnk), i(kpre) | ||
reinit doInit | ||
rireturn | ||
skipInit: | ||
endop | ||
instr 1 | ||
; initialize channels | ||
kchn init 1 | ||
if (kchn == 1) then | ||
lp2: | ||
fluidControl gifld, 192, kchn - 1, 0, 0 | ||
fluidControl gifld, 176, kchn - 1, 7, 100 | ||
fluidControl gifld, 176, kchn - 1, 10, 64 | ||
loop_le kchn, 1, 16, lp2 | ||
endif | ||
; send any MIDI events received to FluidSynth | ||
nxt: | ||
kst, kch, kd1, kd2 midiin | ||
if (kst != 0) then | ||
if (kst != 192) then | ||
fluidControl gifld, kst, kch - 1, kd1, kd2 | ||
else | ||
fluidProgramSelect_k gifld, kch - 1, gisf2, 0, kd1 | ||
endif | ||
kgoto nxt | ||
endif | ||
; get audio output from FluidSynth | ||
ivol init 3 ;a bit louder | ||
aL, aR fluidOut gifld | ||
outs aL*ivol, aR*ivol | ||
endin | ||
</CsInstruments> | ||
<CsScore> | ||
i 1 0 3600 | ||
e | ||
</CsScore> | ||
</CsoundSynthesizer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<CsoundSynthesizer> | ||
<CsOptions> | ||
; Select audio/midi flags here according to platform | ||
-odac ;;;realtime audio out | ||
;-iadc ;;;uncomment -iadc if RT audio input is needed too | ||
; For Non-realtime ouput leave only the line below: | ||
; -o Poisson_Cucchi -W ;;; for file output any platform | ||
|
||
; By Stefano Cucchi - 2024 | ||
|
||
</CsOptions> | ||
<CsInstruments> | ||
sr = 44100 | ||
ksmps = 32 | ||
nchnls = 2 | ||
0dbfs = 1 | ||
instr 1 | ||
klambda1 linseg p4, p3, p5 | ||
kindex poisson klambda1 | ||
klambda2 linseg p6, p3, p7 | ||
ktrigfreq poisson klambda2 | ||
ksig poscil 1, ktrigfreq | ||
ktrig trigger ksig, 0, 0 | ||
schedkwhen ktrig, 0, 20, 10, 0, 0.2, kindex, 10 | ||
endin | ||
instr 10 | ||
kcnt = p4 | ||
kpc table kcnt, p5 | ||
kcps = cpspch(kpc) | ||
asig1 oscil 0.5, kcps, 1 | ||
kenvelope linseg 0, p3*0.5, 1, p3*0.5, 0 | ||
asig1 = asig1*kenvelope | ||
outs asig1, asig1 | ||
endin | ||
</CsInstruments> | ||
<CsScore> | ||
f 1 0 4096 10 1 0 1 0 1 0 0 1 1 | ||
f 10 0 24 -2 8.00 8.01 8.02 8.03 8.04 8.05 8.06 8.07 8.08 8.09 8.10 8.11 9.00 9.01 9.02 9.03 9.04 9.05 9.06 9.07 9.08 9.09 9.10 9.11 | ||
i1 0 30 0 23 2 17 | ||
e | ||
</CsScore> | ||
</CsoundSynthesizer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<CsoundSynthesizer> | ||
<CsOptions> | ||
; Select audio/midi flags here according to platform | ||
-odac ;;;realtime audio out | ||
;-iadc ;;;uncomment -iadc if realtime audio input is needed too | ||
; For Non-realtime ouput leave only the line below: | ||
; -o Signum_Welsh.wav -W ;;; for file output any platform | ||
</CsOptions> | ||
<CsInstruments> | ||
sr = 44100 | ||
ksmps = 32 | ||
nchnls = 2 | ||
0dbfs = 1 | ||
; by tgrey - 2020 | ||
instr 1 | ||
iFreq = p4 | ||
iMode = p5 | ||
; generate a sine lfo @5hz | ||
kMod lfo 1, 5 | ||
; if p5 is non-zero, take the negative/positive sign of the lfo | ||
; this squares off the lfo! | ||
if(iMode!=0) then | ||
kMod signum kMod | ||
endif | ||
; gerate signal with modulation included | ||
aSig poscil kMod, iFreq | ||
outs aSig, aSig | ||
endin | ||
</CsInstruments> | ||
<CsScore> | ||
i1 0 .5 440 0 | ||
i1 + . 550 0 | ||
i1 + . 660 1 ; this event gets "squared" modulation due to non-zero p5 | ||
</CsScore> | ||
</CsoundSynthesizer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<CsoundSynthesizer> | ||
<CsOptions> | ||
; Select audio/midi flags here according to platform | ||
-odac ;;;realtime audio out | ||
;-iadc ;;;uncomment -iadc if RT audio input is needed too | ||
; For Non-realtime ouput leave only the line below: | ||
; -o poisson2.wav -W ;;; for file output any platform | ||
|
||
; By Stefano Cucchi - 2024 | ||
</CsOptions> | ||
<CsInstruments> | ||
sr = 44100 | ||
ksmps = 1024 | ||
nchnls = 2 | ||
0dbfs = 1 | ||
instr 1 | ||
kpitch poisson p4 | ||
printk (ksmps/sr),kpitch ;prints every k-period | ||
a1 oscili 0.3, kpitch, 1 | ||
outs a1, a1 | ||
endin | ||
</CsInstruments> | ||
<CsScore> | ||
f1 0 4096 10 1 0.1 0 0.2 0 0.3 0 0.1 | ||
i 1 0 5 100 | ||
i 1 + 5 200 | ||
e | ||
</CsScore> | ||
</CsoundSynthesizer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<CsoundSynthesizer> | ||
<CsOptions> | ||
; Select audio/midi flags here according to platform | ||
-odac ;;;realtime audio out | ||
;-iadc ;;;uncomment -iadc if realtime audio input is needed too | ||
; For Non-realtime ouput leave only the line below: | ||
; -o signum2.wav -W ;;; for file output any platform | ||
</CsOptions> | ||
<CsInstruments> | ||
sr = 44100 | ||
kr = 4410 | ||
ksmps = 10 | ||
nchnls = 2 | ||
0dbfs = 1 | ||
gaArr[] init 2 | ||
instr 1 | ||
kEnv transeg 1, p3, -3, 0 | ||
a_pi = 4 * taninv(1.0); | ||
a1 phasor 440; | ||
a2 = sin(2 * a_pi * 1/ksmps * a1); | ||
a3 dcblock2 a2 | ||
asig = signum(a3) | ||
gaArr[0] = a2 * 0.6 * kEnv | ||
gaArr[1] = asig * 0.6 * kEnv | ||
outs gaArr[0], gaArr[1] | ||
endin | ||
</CsInstruments> | ||
<CsScore> | ||
i 1 0 3 | ||
</CsScore> | ||
</CsoundSynthesizer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.