Skip to content

Commit

Permalink
Merge pull request #740 from tjingboem/7.0
Browse files Browse the repository at this point in the history
different actions
  • Loading branch information
tjingboem authored Jun 2, 2024
2 parents b58b96f + 95d8985 commit 4f68051
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 13 deletions.
4 changes: 3 additions & 1 deletion command/flags.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,9 @@
Start and stop instances of instruments at the nearest
sample to the requested time. This is in contrast to
traditional Csound which rounds the times to the nearest
k-cycle. Note that this does not work with tied notes.
k-cycle. Note that this does not work with tied notes,
nor does it change the Midi timing (as this is only
affected by ksmps size (control rate).
</para>
</listitem>
</varlistentry>
Expand Down
4 changes: 3 additions & 1 deletion command/flagscategory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,9 @@ csound5:output2 (playback right)</screen>
Start and stop instances of instruments at the nearest
sample to the requested time. This is in contrast to
traditional Csound which rounds the times to the nearest
k-cycle. Note that this does not work with tied notes.
k-cycle. Note that this does not work with tied notes,
nor does it change the Midi timing (as this is only
affected by ksmps size (control rate).
</para>
</listitem>
</varlistentry>
Expand Down
130 changes: 130 additions & 0 deletions examples/musical/PhasorTablei_Cucchi.csd
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<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 phasor_tablei.wav -W ;;; for file output any platform

; By Stefano Cucchi 2020


</CsOptions>

<CsInstruments>
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2
0dbfs = 1
instr 1
kamp1 = 1.321
kcps1 = 0.067
krand1 randi kamp1, kcps1, 2
kamp2 = 1.061
kcps2 = 0.0514
krand2 randi kamp2, kcps2, 3
kamp3 = 0.92
kcps3 = 0.0865
krand3 randi kamp3, kcps3, 4
kamp4 = 1.412
kcps4 = 0.135
krand4 randi kamp3, kcps3, 5
krand5 randi 0.31, 0.13
krand6 randi 0.21, 0.132
krand7 randi 0.298, 0.23
krand8 randi 0.287, 0.15
;;;;MORPHING
kftndx linseg p8, p3*0.2, p9, p3*0.4, p10, p3*0.2, p11, p3*0.2, p12
iresfn = 2
iftfn = 1
ftmorf kftndx, iftfn, iresfn
;; p5 = frequenza carrier
;; p6 = frequenza modulator
kenvelopemod linseg 0, 3, p4, p3-6, p4, 6, 0
amodulator1 oscil kenvelopemod+krand5, p5+krand1, 2
acarf1 phasor (p6 + 10*krand7)
ifn = 3
ixmode = 1
ixoff = 0
iwrap = 1
acarrier1 tablei acarf1+amodulator1+42*krand2, ifn, ixmode, ixoff, iwrap
amodulator2 oscil kenvelopemod+krand6, p5+krand5, 2
acarf2 phasor (p6 + 15*krand8)
ifn = 3
ixmode = 1
ixoff = 0
iwrap = 1
acarrier2 tablei acarf2+amodulator2+38*krand4, ifn, ixmode, ixoff, iwrap
amodulator3 oscil kenvelopemod+krand3, p5+krand6, 2
acarf3 phasor (p6 + 15*krand7)
ifn = 3
ixmode = 1
ixoff = 0
iwrap = 1
acarrier3 tablei acarf3+amodulator3+28*krand2, ifn, ixmode, ixoff, iwrap
amodulator4 oscil kenvelopemod+krand6, p5+krand7, 2
acarf4 phasor (p6 + 13*krand5)
ifn = 3
ixmode = 1
ixoff = 0
iwrap = 1
acarrier4 tablei acarf4+amodulator4+(22*krand8), ifn, ixmode, ixoff, iwrap
kgenenvelop expseg 0.001, 1.8, p7, p3-3.6, p7, 1.8, 0.0001
outch 1 ,acarrier1 * kgenenvelop * 2
outch 2 ,acarrier2 * kgenenvelop * 2
outch 1 ,acarrier3 * kgenenvelop * 0.3
outch 2 ,acarrier4 * kgenenvelop * 0.3
endin
</CsInstruments>

<CsScore>
f1 0 8 -2 3 4 5 6 7 8 9 10
f2 0 4096 10 1 /*contents of f4 dont matter */
f3 0 4096 9 1 1 90
f4 0 4096 10 1 0.35 0 1 0.653
f5 0 4096 7 -1 2000 1 2096 -1
f6 0 4096 10 1 1 1
f7 0 4096 10 0 0 0 1
f8 0 4096 10 0 0 1
f9 0 4096 10 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
f10 0 4096 10 1
i1 0 40 0.03 300 200 0.123 0 5 7 6 2
i1 15 10 0.09 9000 3000 0.039 7 0 1 2 3
i1 30 10 0.02 150 100 0.125 4 6 4 7 0
i1 42 12 0.9 80 40 0.34 6 7 6 7 7
i1 54 12 0.9 68 70 0.34 1 7 2 0 6
i1 66 12 4.9 800 40 0.14 6 0 6 0 7
i1 66 12 4.9 1600 41 0.14 6 0 6 0 7
e
</CsScore>

</CsoundSynthesizer>
20 changes: 10 additions & 10 deletions opcodes/bbcutm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<emphasis role="ohdr">nchnls</emphasis> <emphasis role="op">=</emphasis> 2

<emphasis role="oblock">instr</emphasis> 1
asource <emphasis role="opc">diskin</emphasis> "break7.wav",1,0,1 <emphasis role="comment">; a source breakbeat sample, wraparound lest it stop!</emphasis>
asource <emphasis role="opc">diskin</emphasis> "drumsMlp.wav",1,0,1 <emphasis role="comment">; a source breakbeat sample, wraparound lest it stop!</emphasis>

<emphasis role="comment">; cuts in eighth notes per 4/4 bar, up to 4 bar phrases, up to 1</emphasis>
<emphasis role="comment">; repeat in total (standard use) rare stuttering at 16 note speed,</emphasis>
Expand All @@ -123,7 +123,7 @@
<emphasis role="oblock">endin</emphasis>

<emphasis role="oblock">instr</emphasis> 2 <emphasis role="comment">;stereo version</emphasis>
asource1,asource2 <emphasis role="opc">diskin</emphasis> "break7stereo.wav", 1, 0, 1 <emphasis role="comment">; a source breakbeat sample, wraparound lest it stop!</emphasis>
asource1,asource2 <emphasis role="opc">diskin</emphasis> "drumsSlp.wav", 1, 0, 1 <emphasis role="comment">; a source breakbeat sample, wraparound lest it stop!</emphasis>

<emphasis role="comment">; cuts in eighth notes per 4/4 bar, up to 4 bar phrases, up to 1</emphasis>
<emphasis role="comment">; repeat in total (standard use) rare stuttering at 16 note speed,</emphasis>
Expand Down Expand Up @@ -161,16 +161,16 @@

asig <emphasis role="opc">bbcutm</emphasis> asource, 2.6937, p6, 4, 4, p7, 2, 0.1, 1

<emphasis role="opc">out</emphasis> asig
<emphasis role="opc">outs</emphasis> asig, asig
<emphasis role="oblock">endin</emphasis>

<emphasis role="csdtag">&lt;/CsInstruments&gt;</emphasis>
<emphasis role="csdtag">&lt;CsScore&gt;</emphasis>

<emphasis role="comment">; source bps cut repeats</emphasis>
<emphasis role="stamnt">i</emphasis>1 0 10 "break1.wav" 2.3 8 2 <emphasis role="Ccomment">//2.3 is the source original tempo</emphasis>
<emphasis role="stamnt">i</emphasis>1 0 10 "break2.wav" 2.4 8 3
<emphasis role="stamnt">i</emphasis>1 0 10 "break3.wav" 2.5 16 4
<emphasis role="stamnt">i</emphasis>1 0 10 "drumsMlp.wav" 2.3 8 2 <emphasis role="Ccomment">//2.3 is the source original tempo</emphasis>
<emphasis role="stamnt">i</emphasis>1 0 10 "beats.wav" 2.4 8 3
<emphasis role="stamnt">i</emphasis>1 0 10 "fox.wav" 2.5 16 4
<emphasis role="stamnt">e</emphasis>
<emphasis role="csdtag">&lt;/CsScore&gt;</emphasis>
<emphasis role="csdtag">&lt;/CsoundSynthesizer&gt;</emphasis></programlisting>
Expand All @@ -193,7 +193,7 @@
<emphasis role="comment">; ain, bps, subdiv, barlength, phrasebars, numrepeats,</emphasis>
<emphasis role="comment">;stutterspeed, stutterchance, envelopingon</emphasis>
asig <emphasis role="opc">bbcutm</emphasis> asource, 2, 32, 1, 1, 2, 4, 0.6, 1
<emphasis role="opc">outs</emphasis> asig
<emphasis role="opc">outs</emphasis> asig, asig
<emphasis role="oblock">endin</emphasis>

<emphasis role="csdtag">&lt;/CsInstruments&gt;</emphasis>
Expand All @@ -218,14 +218,14 @@
<emphasis role="ohdr">nchnls</emphasis> <emphasis role="op">=</emphasis> 2

<emphasis role="oblock">instr</emphasis> 1
asource <emphasis role="opc">diskin</emphasis> "break7.wav", 1, 0, 1
asource <emphasis role="opc">diskin</emphasis> "drumsMlp.wav", 1, 0, 1

<emphasis role="comment">;16th note cuts- but cut size 2 over half a beat.</emphasis>
<emphasis role="comment">;each half beat will either survive intact or be turned into</emphasis>
<emphasis role="comment">;the first sixteenth played twice in succession</emphasis>

asig <emphasis role="opc">bbcutm</emphasis> asource, 2.6937, 2, 0.5, 1, 2, 2, 1.0, 0
<emphasis role="opc">outs</emphasis> asig
asig <emphasis role="opc">bbcutm</emphasis> asource, 2, 2, 0.5, 1, 2, 2, 1.0, 0
<emphasis role="opc">outs</emphasis> asig, asig
<emphasis role="oblock">endin</emphasis>

<emphasis role="csdtag">&lt;/CsInstruments&gt;</emphasis>
Expand Down
3 changes: 3 additions & 0 deletions opcodes/phasor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
<para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
<xi:include href="examples-xml/phasor.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</example>
<para>
A musical example featuring the phasor opcode: <ulink url="examples/musical/PhasorTablei_Cucchi.csd"><citetitle>PhasorTablei_Cucchi.csd</citetitle></ulink> by Stefano Cucchi.
</para>
</para>
</refsect1>

Expand Down
2 changes: 1 addition & 1 deletion opcodes/sfpassign.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<refsect1>
<title>Performance</title>
<para>
<emphasis>sfpassign</emphasis> assigns all presets of a previously loaded SF2 file to a sequence of progressive index numbers, to be used later with the opcodes <link linkend="sfplay"><citetitle>sfplay</citetitle></link> and <link linkend="sfplaym"><citetitle>sfplaym</citetitle></link>. <emphasis>istartindex</emphasis> specifies the starting index number. Any number of <emphasis>sfpassign</emphasis> instances can be placed in the header section of an orchestra, each one assigning presets belonging to different SF2 files. The user must take care that preset index numbers of different SF2 files do not overlap.
<emphasis>sfpassign</emphasis> assigns all presets of a previously loaded SF2 file to a sequence of progressive index numbers, to be used later with the opcodes <link linkend="sfplay"><citetitle>sfplay</citetitle></link> and <link linkend="sfplaym"><citetitle>sfplaym</citetitle></link>. <emphasis>istartindex</emphasis> specifies the starting index number. Any number of <emphasis>sfpassign</emphasis> instances can be placed in the header section of an orchestra, each one assigning presets belonging to different SF2 files.
</para>

<para>
Expand Down

0 comments on commit 4f68051

Please sign in to comment.