From 17a963ca3a7ff26f8e8fe06cbaa14699721f85eb Mon Sep 17 00:00:00 2001 From: Menno Knevel Date: Mon, 17 Jun 2024 21:00:59 +0200 Subject: [PATCH 1/8] Create TivalNstrnum_Yi.csd new musical example --- examples/musical/TivalNstrnum_Yi.csd | 103 +++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 examples/musical/TivalNstrnum_Yi.csd diff --git a/examples/musical/TivalNstrnum_Yi.csd b/examples/musical/TivalNstrnum_Yi.csd new file mode 100644 index 0000000000..f6eccdda73 --- /dev/null +++ b/examples/musical/TivalNstrnum_Yi.csd @@ -0,0 +1,103 @@ + + +; 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 TivalNstrnum_Yi.wav -W ;;; for file output any platform + + + +sr = 44100 +ksmps = 32 +nchnls = 2 +0dbfs = 1 + +;; Author: Steven Yi +;; Date: 2020.10.18 +;; Description: Simple 2-sine tone with modulations and random-walk melody generation + +instr Sine +ifreq = p4 +iamp = p5 +ipan = p6 + +itied = tival() +kamp = port(iamp, 0.1, (itied == 1) ? -1 : iamp) + +if (itied == 0 && p3 < 0) then +kamp *= linseg(0, .1, 1, 1, 1) +elseif (itied == 1 && p3 > 0) then +kamp *= linsegr(1, 0.1, 1, 0.75, 0) +elseif (itied == 0 && p3 > 0) then +kamp *= linsegr(0, 0.5, 1, 0.75, 0) +endif + +kfreq = port(ifreq, 0.1, itied == 1 ? -1 : ifreq) + +;; Vibrato with delayed swell in +ivibamt = random:i(0.13, 0.17) +klfo = lfo(linseg(0, .3, 0, 1, ivibamt, 1, ivibamt), 4.7) +kmod = port(semitone(klfo), 0.01, -itied) +kfreq *= kmod + +asig = oscili(1, kfreq, -1, -itied) +asig += oscili(0.15, kfreq * 2, -1, -itied) + +asig *= kamp * 0.9 + +a1, a2 pan2 asig, ipan + +out(a1, a2) +endin + +;; Random Walk Melody generator +instr Run + +ivoice = p4 +inote_offset = limit(p5, -24, 24) +ipan = p6 + +print ivoice, inote_offset + +inum = nstrnum("Sine") + (ivoice % 100) / 100 + +icount = int(random:i(4, 8)) + +indx = 0 +istart = 0 + +while (indx < icount) do +idur = int(random:i(2, 5)) * .5 +ilast = (indx < icount - 1) ? -1 : 1 + +inn = 72 + inote_offset + +iamp = -18 - limit(inote_offset, 0, 24) / 2 + +schedule(inum, istart, idur * ilast, cpsmidinn(inn), ampdbfs(iamp), ipan) +iadj = int(random:i(2, 5)) +inote_offset += (random:i(0, 1) > 0.5) ? iadj : -iadj +istart += idur +indx +=1 +od + +schedule(p1, istart + int(random:i(4, 8)) * .5, 0, (ivoice + 3) % 100, inote_offset, ipan) + +endin + +instr Main +;; run 3 voices +schedule("Run", 0, 0, 1, 0, 0.25) +schedule("Run", 0, 0, 2, 4, 0.5) +schedule("Run", 0, 0, 3, -7, 0.75) +endin + +;; RUN PROJECT +seed(-1) +schedule("Main", 0, 0) + + + + + From c5274eb29c8bfa6e543c331179e1420db9f19539 Mon Sep 17 00:00:00 2001 From: Menno Knevel Date: Mon, 17 Jun 2024 21:09:14 +0200 Subject: [PATCH 2/8] Update tival.xml new musical example --- opcodes/tival.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opcodes/tival.xml b/opcodes/tival.xml index 5447917d82..8807cdceee 100644 --- a/opcodes/tival.xml +++ b/opcodes/tival.xml @@ -44,6 +44,9 @@ See the sections Real-time Audio and Command Line Flags for more information on using command line flags. + + A musical examples featuring the tival opcode: TivalNstrnum_Yi.csd by Steven Yi. + From 89b2884165de117122dcff34fc31c0089f2e1e8a Mon Sep 17 00:00:00 2001 From: Menno Knevel Date: Mon, 17 Jun 2024 21:10:21 +0200 Subject: [PATCH 3/8] Update nstrnum.xml new musical example --- opcodes/nstrnum.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opcodes/nstrnum.xml b/opcodes/nstrnum.xml index 2aa2306620..ee93414925 100644 --- a/opcodes/nstrnum.xml +++ b/opcodes/nstrnum.xml @@ -54,6 +54,9 @@ See the sections Real-time Audio and Command Line Flags for more information on using command line flags. + + A musical examples featuring the nstrnum opcode: TivalNstrnum_Yi.csd by Steven Yi. + From dfd5a6ec0c78e97de414ecdef20f9b1ebd209bac Mon Sep 17 00:00:00 2001 From: Menno Knevel Date: Fri, 21 Jun 2024 20:16:21 +0200 Subject: [PATCH 4/8] Create Vibes_Pena.csd new musical example --- examples/musical/Vibes_Pena.csd | 144 ++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 examples/musical/Vibes_Pena.csd diff --git a/examples/musical/Vibes_Pena.csd b/examples/musical/Vibes_Pena.csd new file mode 100644 index 0000000000..d44236e31f --- /dev/null +++ b/examples/musical/Vibes_Pena.csd @@ -0,0 +1,144 @@ + + +-odac -d -A -m0 -+msg_color=0 + + + +sr = 44100 +ksmps = 32 +nchnls = 2 +0dbfs = 1.0 +seed 0 + +garev1 init 0 +garev2 init 0 +gktime init 0 + +alwayson 99 ;; reverb + + +instr 1 ;make chord + + iamp = p4 + ifm = p5 + itime = p6 ;phasor time + ifreq1 = p7 + ifreq2 = p8 + iint1 = p9 + iint2 = p10 + innotes = p11 ;number of notes in chord + + kfm randomi ifm, ifm*1.05, 1 + km metro kfm + kdur = 1/kfm + + afreq phasor 1/itime + gkfreq downsamp (ifreq1+afreq*(ifreq2-ifreq1)) + printks "\n freq: %.2f", 1, gkfreq + + ;; p1 p2 p3 p4 p5 p6 p7 + schedkwhen km, 0, 0, 10, 0, kfm, iamp, iint1, iint2, innotes + +endin + + +instr 10; vibes + + indx init 0 + incr = 1 + imax = p7-1 + iamp = db(p4) + + ifreq = i(gkfreq) + + loopit: + + iint=round(random(p5, p6)) + iint=(indx>0?iint:0) + iffactor = 2^((iint)/12) + + ifreq = ifreq * iffactor + iamp random iamp, iamp*1.05 + schedule 11, 0, p3, iamp, ifreq, iffactor, iint + ;;print ifreq, iffactor, indx + loop_le indx, incr, imax, loopit + + prints "\n " + +endin + +instr 11 + + iamp = p4 + ifreq = p5 + ifactor = p6 + iint = p7 + ifreq = ifreq * ifactor + ihrd random 0.1, 0.9 + ipos random 0.0, 1 + imp = 1 + kvibf = 6.0 + kvamp = 0.05 + ivibfn = 2 + idec = 0.1 + + ares vibes iamp, ifreq, ihrd, ipos, imp, kvibf, kvamp, ivibfn, idec + + ;; + if nchnls == 2 then + irpan random 0, 1 + aout1, aout2 pan2 ares, irpan + + ich2 = (nchnls == 2 ? 2: 3) + outch 1, aout1 + outch ich2, aout2 + else + + irpan random 1, nchnls + + ichn = round(irpan) + outch ichn, ares + + endif + + ;;send to reverb + irsend random 0.2, 0.4 + garev1 += irsend * aout1 + garev2 += irsend * aout2 + + prints " %.2f: %.2f int: %.2f", gktime, ifreq, iint + +endin + +instr 99 ;;; reverb + gktime timeinsts + arev1, arev2 reverbsc garev1, garev2, 0.85, sr/2 + ich1 = (nchnls == 2 ? 1: 7) + ich2 = (nchnls == 2 ? 2: 8) + outch ich1, arev1 + outch ich2, arev2 + clear garev1, garev2 +endin + + + +; Table #1, the "marmstk1.wav" audio file. +f 1 0 256 1 "marmstk1.wav" 0 0 0 +; Table #2, a sine wave for the vibrato. +f 2 0 128 10 1 +;; +; amp[dB] metro[Hz] phasor[s] freq1 freq2 int1 int2 nnotes +i1 0 20 -15 5 1 110 110 5 5 4 +i1 + 10 -15 . 1 55 220 4 5 6 +i1 30 10 -15 . 10 220 220 4 4 2 +i1 + 10 -15 . 10 220 220 3 5 3 +i1 + 20 -18 . 20 220 55 2 8 7 +i1 + 10 -12 2 10 55 55 3 5 3 +i1 71 30 -9 6 30 330 330 2 3 2 +i1 + 10 -18 6 10 330 330 1 4 5 +i1 + 9 -18 2 10 30 20 4 8 6 + +e + + + From d73a0b5308af7b2848956decd8501223a31b975b Mon Sep 17 00:00:00 2001 From: Menno Knevel Date: Fri, 21 Jun 2024 20:20:07 +0200 Subject: [PATCH 5/8] Update vibes.xml new musical example --- opcodes/vibes.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opcodes/vibes.xml b/opcodes/vibes.xml index 9276acc0df..90d1fe7381 100644 --- a/opcodes/vibes.xml +++ b/opcodes/vibes.xml @@ -86,13 +86,13 @@ url="ftp://ftp.cs.bath.ac.uk/pub/dream/documentation/sounds/modelling/"> Example of the vibes opcode. - - - See the sections Real-time Audio and Command Line Flags for more information on using command line flags. + + Two musical examples featuring the vibes opcode: Vibes_Pena.csd, by luis Antunes Pena. + From 0ef82e91742ef38dc0e859dd8af73a84a7ba6aa4 Mon Sep 17 00:00:00 2001 From: Menno Knevel Date: Sun, 23 Jun 2024 21:00:50 +0200 Subject: [PATCH 6/8] Update allpole-2.csd Mathews sample --- examples/allpole-2.csd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/allpole-2.csd b/examples/allpole-2.csd index 02e31a87e2..09254dc43d 100644 --- a/examples/allpole-2.csd +++ b/examples/allpole-2.csd @@ -5,19 +5,19 @@ sr = 44100 -ksmps = 64 -nchnls = 1 -0dbfs = 1 +ksmps = 32 +nchnls = 2 +0dbfs = 1 -gifn ftgen 0,0,0,1,"fox.wav",0,0,1 +gifn ftgen 0,0,0,1,"Mathews.wav",0,0,1 gifw ftgen 0,0,1024,20,2,1 instr 1 k1 init 0 kts = p4 kcfs[],krms,kerr,kcps lpcanal k1,1,gifn,1024,ksmps,gifw -if kcps > 180 then - kcps = 180 +if kcps > 120 then + kcps = 120 endif a1 buzz 0dbfs, kcps, sr/(kcps*2), -1 a3 allpole a1*krms*kerr,kcfs @@ -26,13 +26,13 @@ if k1 > ftlen(gifn) then k1 = 0 endif a3 dcblock a3 -out a3 +outs a3*10, a3*10 endin i1 0 10 1 -i1 10 10 .75 +i1 10 10 .2 i1 20 10 1.5 From fee0ed2e7710dda5d0e2e8407d5ea2bbc70a9cd1 Mon Sep 17 00:00:00 2001 From: Menno Knevel Date: Sun, 23 Jun 2024 21:20:11 +0200 Subject: [PATCH 7/8] Update partikkel-2.csd Mathews sample --- examples/partikkel-2.csd | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/examples/partikkel-2.csd b/examples/partikkel-2.csd index 54cc1df3fd..455f5c4b57 100644 --- a/examples/partikkel-2.csd +++ b/examples/partikkel-2.csd @@ -4,7 +4,7 @@ ; Audio out -odac ;;;RT audio ; For Non-realtime ouput leave only the line below: -; -o partikkel.wav -W ;;; for file output any platform +; -o partikkel-2.wav -W ;;; for file output any platform @@ -16,7 +16,7 @@ nchnls = 2 giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine giDisttab ftgen 0, 0, 32768, 7, 0, 32768, 1 ; for kdistribution -giFile ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile for source waveform +giFile ftgen 0, 0, 0, 1, "Mathews.wav", 0, 0, 0 ; soundfile for source waveform giWin ftgen 0, 0, 4096, 20, 9, 1 ; grain envelope giPan ftgen 0, 0, 32768, -21, 1 ; for panning (random values between 0 and 1) @@ -131,21 +131,19 @@ endin ;i1 st dur speed grate gsize cent posrnd cntrnd pan dist -i1 0 2.757 1 200 15 0 0 0 0 0 +i1 0 3 1 200 15 0 0 0 0 0 s -i1 0 2.757 1 200 15 400 0 0 0 0 +i1 0 3 1 200 15 400 0 0 0 0 s -i1 0 2.757 1 15 450 400 0 0 0 0 +i1 0 3 1 15 450 400 0 0 0 0 s -i1 0 2.757 1 15 450 400 0 0 0 0.4 +i1 0 3 1 15 450 400 0 0 0 0.4 s -i1 0 2.757 1 200 15 0 400 0 0 1 +i1 0 3 1 200 15 0 400 0 0 1 s -i1 0 5.514 .5 200 20 0 0 600 .5 1 +i1 0 6 .5 200 20 0 0 600 .5 1 s -i1 0 11.028 .25 200 15 0 1000 400 1 1 - - +i1 0 12 .25 200 15 0 1000 400 1 1 +e - From 3919beb74df9521a4863b7917c6182584c1ea72c Mon Sep 17 00:00:00 2001 From: Menno Knevel Date: Tue, 25 Jun 2024 09:38:31 +0200 Subject: [PATCH 8/8] Update vibes.xml corr --- opcodes/vibes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opcodes/vibes.xml b/opcodes/vibes.xml index 90d1fe7381..4776b0b57a 100644 --- a/opcodes/vibes.xml +++ b/opcodes/vibes.xml @@ -91,7 +91,7 @@ url="ftp://ftp.cs.bath.ac.uk/pub/dream/documentation/sounds/modelling/"> - Two musical examples featuring the vibes opcode: Vibes_Pena.csd, by luis Antunes Pena. + A musical examples featuring the vibes opcode: Vibes_Pena.csd, by luis Antunes Pena.