-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opcodes no examples #737
Comments
Simple example for "schedulek" <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 schedulek.wav -W ;;; for file output any platform
; By Stefano Cucchi 2024
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 10
nchnls = 2
0dbfs = 1
instr 1
kfreqnote randomh 0.1, 6.3, 2
kTrigger metro kfreqnote
if kTrigger == 1 then ;
schedulek 10, 0, 0.1 ;call the instrument
endif
endin
instr 10
a1 oscili 0.2, 440, 2
outs a1, a1
endin
</CsInstruments>
<CsScore>
f 2 0 4096 10 1 0.9 0.8 0.7 0.6
i 1 0 10
</CsScore>
</CsoundSynthesizer> |
Simple example for "tableicopy" Copying the source table to destination tables with different dimensions and reading with no interpolating opcode. <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 tableicopy.wav -W ;;; for file output any platform
; By Stefano Cucchi 2024
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 10
nchnls = 2
0dbfs = 1
instr 1
tableicopy 2, 1
a1 oscil 0.2, 440, 2
outs a1, a1
endin
instr 2
tableicopy 3, 1
a1 oscil 0.2, 440, 3
outs a1, a1
endin
</CsInstruments>
<CsScore>
f1 0 4096 10 1 0 1 0 1 1 0 1 0 1
f2 0 8 10 1
f3 0 4096 10 1
i 1 0 4
i 2 4 4
e
</CsScore>
</CsoundSynthesizer>
|
which inspired me to this one:
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac ;;;realtime audio out
-m128 ;;;reduce console output
;-iadc ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o schedulek.wav -W ;;; for file output any platform
; by joachim heintz 2024
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 1
seed 0
opcode RndHarm,i[],iop
//generates an array with iLen random numbers
iLen,iMin,iMax xin //defaults to iMin=0 and iMax=1
iOut[] init iLen
indx = 0
while (indx<iLen) do
iOut[indx] = random:i(iMin,iMax)
indx += 1
od
xout iOut
endop
instr GenerateSpectrum
iHarmonics[] = RndHarm(p4)
giSound = ftgen(0,0,4096,10,iHarmonics)
endin
schedule("GenerateSpectrum",0,0,4)
instr Call
iStartPitch = 80 //MIDI note number
kPitch init iStartPitch
kStep init 3
kNoteCount init 0
kTrigMaxFreq init 3
kTrigFreq init 2
kPan init 0.9
kNumHarm init 4
kCycleCount init 1
if (metro:k(kTrigFreq) == 1) then
// call instrument
schedulek("Play",0,kCycleCount/kTrigMaxFreq,kPitch,kPan)
// update values
kTrigFreq = random:k(kTrigMaxFreq/2,kTrigMaxFreq)
kNoteCount += 1
kPan -= 0.8/7
kPitch -= kStep
// if seven tones have been played, start again differently
if (kNoteCount == 7) then
kPitch = iStartPitch
kPan = 0.9
kStep /= 1.5
kTrigMaxFreq /= 1.5
kNoteCount = 0
kNumHarm *= 1.5
kCycleCount += 1
schedulek("GenerateSpectrum",0,0,int(kNumHarm))
endif
// stop after six cycles
if (kCycleCount == 7) then
schedulek("Terminate",kCycleCount/kTrigMaxFreq,1)
turnoff
endif
endif
// print main values
if (changed(kCycleCount) == 1) then
printks("Cycle %d:\n",0,kCycleCount)
printks(" kStep (semitones) and kTrigMaxFreq (Hz) = %.3f\n
number of harmonics = %.3f\n",0,kStep,int(kNumHarm))
endif
endin
schedule("Call",0,-1)
instr Play
iPitch = p4
iPan = p5
aOut = oscili:a(0.2,mtof:i(iPitch),giSound)
aOut = linen:a(aOut,0,p3,p3/2)
aL,aR pan2 aOut,iPan
out(aL,aR)
endin
instr Terminate
event("e",0,0)
endin
</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>
…On 09/06/2024 19:44, Stefano Cucchi wrote:
Simple example for "schedulek"
<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 schedulek.wav -W ;;; for file output any platform
; By Stefano Cucchi 2024
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 10
nchnls = 2
0dbfs = 1
instr 1
kfreqnote randomh 0.1, 6.3, 2
kTrigger metro kfreqnote
if kTrigger == 1 then ;
schedulek 10, 0, 0.1 ;call the instrument
endif
endin
instr 10
a1 oscili 0.2, 440, 2
outs a1, a1
endin
</CsInstruments>
<CsScore>
f 2 0 4096 10 1 0.9 0.8 0.7 0.6
i 1 0 10
</CsScore>
</CsoundSynthesizer>
—
Reply to this email directly, view it on GitHub
<#737 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQYHKTBJZCTDIN2MJJ4IFDZGSIANAVCNFSM6AAAAABISRU2ESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWG4YTIOBRGM>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
the simple example for schedulek is added to the manual, but the musical example from Joachim did threw an error: |
nice. thanks.
*- Dr.B*
*Dr. Richard Boulanger*
Professor
Electronic Production and Design
*Berklee College of Music*
Professional Writing & Technology Division
…On Sun, Jun 9, 2024 at 1:44 PM Stefano Cucchi ***@***.***> wrote:
Simple example for "schedulek"
<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 schedulek.wav -W ;;; for file output any platform
; By Stefano Cucchi 2024
</CsOptions>
<CsInstruments>sr = 48000 ksmps = 10 nchnls = 2 0dbfs = 1 instr 1kfreqnote randomh 0.1, 6.3, 2kTrigger metro kfreqnote if kTrigger == 1 then ;schedulek 10, 0, 0.1 ;call the instrumentendifendininstr 10a1 oscili 0.2, 440, 2outs a1, a1endin</CsInstruments>
<CsScore>f 2 0 4096 10 1 0.9 0.8 0.7 0.6i 1 0 10</CsScore>
</CsoundSynthesizer>
—
Reply to this email directly, view it on GitHub
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzczNyNpc3N1ZWNvbW1lbnQtMjE1NjcxNDgxMw==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=bHlyQnZ1WFhHdkl0SDV0U2ZBTFBReDNqcjdGVVAzS0tqeWptZWxuZUIxUT0=&h=aa292bed88834afbba85c0f70ec5bb7b&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>,
or unsubscribe
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZUWDJLRFdRUUpRV0NMNkFVTFpHU0lBTEFWQ05GU002QUFBQUFCSVNSVTJFU1ZISTJEU01WUVdJWDNMTVY0M09TTFRPTjJXS1EzUE5WV1dLM1RVSE1aRENOSldHNFlUSU9CUkdN&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=NFhpOHM3LzZweGRqd1I0cXJoby9KK2dNV1ljdFpGVDJOaWI1bUhuVDU1ST0=&h=aa292bed88834afbba85c0f70ec5bb7b&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
nice
*- Dr.B*
*Dr. Richard Boulanger*
Professor
Electronic Production and Design
*Berklee College of Music*
Professional Writing & Technology Division
…On Sun, Jun 9, 2024 at 2:13 PM Stefano Cucchi ***@***.***> wrote:
Simple example for "tableicopy"
Copying the source table to destination tables with different dimensions
and reading with no interpolating opcode.
<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 tableicopy.wav -W ;;; for file output any platform
; By Stefano Cucchi 2024
</CsOptions>
<CsInstruments>sr = 44100ksmps = 10nchnls = 20dbfs = 1instr 1 tableicopy 2, 1 a1 oscil 0.2, 440, 2 outs a1, a1endininstr 2 tableicopy 3, 1a1 oscil 0.2, 440, 3outs a1, a1endin</CsInstruments>
<CsScore>f1 0 4096 10 1 0 1 0 1 1 0 1 0 1f2 0 8 10 1f3 0 4096 10 1i 1 0 4i 2 4 4 e</CsScore>
</CsoundSynthesizer>
—
Reply to this email directly, view it on GitHub
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzczNyNpc3N1ZWNvbW1lbnQtMjE1NjcyNDYzMw==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=UUNuc0hNeE1UNjk4eXY1em1vdWx1VVpRMko0VEZESGN3Um12RDVZSVpJcz0=&h=8687073b5db941798f1f2473972aa09f&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>,
or unsubscribe
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZSSlA1UUZRWkk3SFBMVDNHTFpHU0xNVEFWQ05GU002QUFBQUFCSVNSVTJFU1ZISTJEU01WUVdJWDNMTVY0M09TTFRPTjJXS1EzUE5WV1dLM1RVSE1aRENOSldHNFpESU5SVEdN&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=ZC9tWDVtWUkyalNRTDI5SzFTWFlKSXNKMUhCYjJEUzNScXNOVWorVEU2az0=&h=8687073b5db941798f1f2473972aa09f&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
for some reason, this instrument will not run...
*- Dr.B*
*Dr. Richard Boulanger*
Professor
Electronic Production and Design
*Berklee College of Music*
Professional Writing & Technology Division
On Sun, Jun 9, 2024 at 5:01 PM joachimheintz ***@***.***>
wrote:
… which inspired me to this one:
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac ;;;realtime audio out
-m128 ;;;reduce console output
;-iadc ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o schedulek.wav -W ;;; for file output any platform
; by joachim heintz 2024
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 1
seed 0
opcode RndHarm,i[],iop
//generates an array with iLen random numbers
iLen,iMin,iMax xin //defaults to iMin=0 and iMax=1
iOut[] init iLen
indx = 0
while (indx<iLen) do
iOut[indx] = random:i(iMin,iMax)
indx += 1
od
xout iOut
endop
instr GenerateSpectrum
iHarmonics[] = RndHarm(p4)
giSound = ftgen(0,0,4096,10,iHarmonics)
endin
schedule("GenerateSpectrum",0,0,4)
instr Call
iStartPitch = 80 //MIDI note number
kPitch init iStartPitch
kStep init 3
kNoteCount init 0
kTrigMaxFreq init 3
kTrigFreq init 2
kPan init 0.9
kNumHarm init 4
kCycleCount init 1
if (metro:k(kTrigFreq) == 1) then
// call instrument
schedulek("Play",0,kCycleCount/kTrigMaxFreq,kPitch,kPan)
// update values
kTrigFreq = random:k(kTrigMaxFreq/2,kTrigMaxFreq)
kNoteCount += 1
kPan -= 0.8/7
kPitch -= kStep
// if seven tones have been played, start again differently
if (kNoteCount == 7) then
kPitch = iStartPitch
kPan = 0.9
kStep /= 1.5
kTrigMaxFreq /= 1.5
kNoteCount = 0
kNumHarm *= 1.5
kCycleCount += 1
schedulek("GenerateSpectrum",0,0,int(kNumHarm))
endif
// stop after six cycles
if (kCycleCount == 7) then
schedulek("Terminate",kCycleCount/kTrigMaxFreq,1)
turnoff
endif
endif
// print main values
if (changed(kCycleCount) == 1) then
printks("Cycle %d:\n",0,kCycleCount)
printks(" kStep (semitones) and kTrigMaxFreq (Hz) = %.3f\n
number of harmonics = %.3f\n",0,kStep,int(kNumHarm))
endif
endin
schedule("Call",0,-1)
instr Play
iPitch = p4
iPan = p5
aOut = oscili:a(0.2,mtof:i(iPitch),giSound)
aOut = linen:a(aOut,0,p3,p3/2)
aL,aR pan2 aOut,iPan
out(aL,aR)
endin
instr Terminate
event("e",0,0)
endin
</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>
On 09/06/2024 19:44, Stefano Cucchi wrote:
> Simple example for "schedulek"
>
> <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 schedulek.wav -W ;;; for file output any platform
>
> ; By Stefano Cucchi 2024
>
>
> </CsOptions>
> <CsInstruments>
>
> sr = 48000
> ksmps = 10
> nchnls = 2
> 0dbfs = 1
>
> instr 1
>
> kfreqnote randomh 0.1, 6.3, 2
>
> kTrigger metro kfreqnote
> if kTrigger == 1 then ;
>
> schedulek 10, 0, 0.1 ;call the instrument
> endif
>
> endin
>
>
> instr 10
>
> a1 oscili 0.2, 440, 2
>
> outs a1, a1
>
> endin
>
>
> </CsInstruments>
> <CsScore>
>
> f 2 0 4096 10 1 0.9 0.8 0.7 0.6
>
> i 1 0 10
>
>
> </CsScore>
> </CsoundSynthesizer>
>
> —
> Reply to this email directly, view it on GitHub
> <#737 (comment)>,
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzczNyNpc3N1ZWNvbW1lbnQtMjE1NjcxNDgxMw==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=bHlyQnZ1WFhHdkl0SDV0U2ZBTFBReDNqcjdGVVAzS0tqeWptZWxuZUIxUT0=&h=04c60ebc5cdb48adb3e0ab751a618cb2&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA%3E,>
> or unsubscribe
>
<https://github.com/notifications/unsubscribe-auth/AAQYHKTBJZCTDIN2MJJ4IFDZGSIANAVCNFSM6AAAAABISRU2ESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWG4YTIOBRGM>.
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQVFZSEtUQkpaQ1RESU4yTUpKNElGRFpHU0lBTkFWQ05GU002QUFBQUFCSVNSVTJFU1ZISTJEU01WUVdJWDNMTVY0M09TTFRPTjJXS1EzUE5WV1dLM1RVSE1aRENOSldHNFlUSU9CUkdN&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=QlJpT3BmdTY2ZVgvMVNTbzRVTEhZZHVGSUc1ZG9DU3YzRWZscGtLQVdwST0=&h=04c60ebc5cdb48adb3e0ab751a618cb2&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA%3E.>
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzczNyNpc3N1ZWNvbW1lbnQtMjE1Njc4NzI4NQ==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=eS9CRnpVY0grZU5pNVB3b2dkMmN6and5WnI3VUEyQ2l2R0tZaDNKblRVaz0=&h=04c60ebc5cdb48adb3e0ab751a618cb2&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>,
or unsubscribe
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZSMkg0TUc0NzdZM0hFTjJGM1pHUzdCQkFWQ05GU002QUFBQUFCSVNSVTJFU1ZISTJEU01WUVdJWDNMTVY0M09TTFRPTjJXS1EzUE5WV1dLM1RVSE1aRENOSldHNDRET01SWUdV&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=bDM3UkxodmI0T2dXUVBHeWd6ZmIwalE1cTNlWlBVYU9xV01raDJCMjVDST0=&h=04c60ebc5cdb48adb3e0ab751a618cb2&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Now should work, there was a typo error in line 79 or some error during copy & paste the code <CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac ;;;realtime audio out
-m128 ;;;reduce console output
;-iadc ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o schedulek.wav -W ;;; for file output any platform
; by joachim heintz 2024
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 1
seed 0
opcode RndHarm,i[],iop
//generates an array with iLen random numbers
iLen,iMin,iMax xin //defaults to iMin=0 and iMax=1
iOut[] init iLen
indx = 0
while (indx<iLen) do
iOut[indx] = random:i(iMin,iMax)
indx += 1
od
xout iOut
endop
instr GenerateSpectrum
iHarmonics[] = RndHarm(p4)
giSound = ftgen(0,0,4096,10,iHarmonics)
endin
schedule("GenerateSpectrum",0,0,4)
instr Call
iStartPitch = 80 //MIDI note number
kPitch init iStartPitch
kStep init 3
kNoteCount init 0
kTrigMaxFreq init 3
kTrigFreq init 2
kPan init 0.9
kNumHarm init 4
kCycleCount init 1
if (metro:k(kTrigFreq) == 1) then
// call instrument
schedulek("Play",0,kCycleCount/kTrigMaxFreq,kPitch,kPan)
// update values
kTrigFreq = random:k(kTrigMaxFreq/2,kTrigMaxFreq)
kNoteCount += 1
kPan -= 0.8/7
kPitch -= kStep
// if seven tones have been played, start again differently
if (kNoteCount == 7) then
kPitch = iStartPitch
kPan = 0.9
kStep /= 1.5
kTrigMaxFreq /= 1.5
kNoteCount = 0
kNumHarm *= 1.5
kCycleCount += 1
schedulek("GenerateSpectrum",0,0,int(kNumHarm))
endif
// stop after six cycles
if (kCycleCount == 7) then
schedulek("Terminate",kCycleCount/kTrigMaxFreq,1)
turnoff
endif
endif
// print main values
if (changed(kCycleCount) == 1) then
printks("Cycle %d:\n",0,kCycleCount)
printks(" kStep (semitones) and kTrigMaxFreq (Hz) = %.3f\n number of harmonics = %.3f\n",0,kStep,int(kNumHarm))
endif
endin
schedule("Call",0,-1)
instr Play
iPitch = p4
iPan = p5
aOut = oscili:a(0.2,mtof:i(iPitch),giSound)
aOut = linen:a(aOut,0,p3,p3/2)
aL,aR pan2 aOut,iPan
out(aL,aR)
endin
instr Terminate
event("e",0,0)
endin
</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>
|
nice! very very nice. inspiring. thanks for fixing and sharing.
*- Dr.B*
*Dr. Richard Boulanger*
Professor
Electronic Production and Design
*Berklee College of Music*
Professional Writing & Technology Division
…On Mon, Jun 10, 2024 at 12:00 PM Stefano Cucchi ***@***.***> wrote:
Now should work, there was a typo error in line 79 or some error during
copy & paste the code
Thanyou @joachimheintz
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2pvYWNoaW1oZWludHo=&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=bklNQnlYZlkxUTl4alBUR3NZZThHRGNacm9zQnpRVTVDdHpIeUtEQWpVTT0=&h=ca93ef3c20e044aab674fe8a0357e967&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>
<CsoundSynthesizer>
<CsOptions>; Select audio/midi flags here according to platform
-odac ;;;realtime audio out
-m128 ;;;reduce console output;-iadc ;;;uncomment -iadc if realtime audio input is needed too; For Non-realtime ouput leave only the line below:; -o schedulek.wav -W ;;; for file output any platform
; by joachim heintz 2024
</CsOptions>
<CsInstruments>sr = 48000ksmps = 64nchnls = 20dbfs = 1seed 0opcode RndHarm,i[],iop //generates an array with iLen random numbers iLen,iMin,iMax xin //defaults to iMin=0 and iMax=1 iOut[] init iLen indx = 0 while (indx<iLen) do iOut[indx] = random:i(iMin,iMax) indx += 1 od xout iOutendopinstr GenerateSpectrum iHarmonics[] = RndHarm(p4) giSound = ftgen(0,0,4096,10,iHarmonics)endinschedule("GenerateSpectrum",0,0,4)instr Call iStartPitch = 80 //MIDI note number kPitch init iStartPitch kStep init 3 kNoteCount init 0 kTrigMaxFreq init 3 kTrigFreq init 2 kPan init 0.9 kNumHarm init 4 kCycleCount init 1 if (metro:k(kTrigFreq) == 1) then // call instrument schedulek("Play",0,kCycleCount/kTrigMaxFreq,kPitch,kPan) // update values kTrigFreq = random:k(kTrigMaxFreq/2,kTrigMaxFreq) kNoteCount += 1 kPan -= 0.8/7 kPitch -= kStep // if seven tones have been played, start again differently if (kNoteCount == 7) then kPitch = iStartPitch kPan = 0.9 kStep /= 1.5 kTrigMaxFreq /= 1.5 kNoteCount = 0 kNumHarm *= 1.5 kCycleCount += 1 schedulek("GenerateSpectrum",0,0,int(kNumHarm)) endif // stop after six cycles if (kCycleCount == 7) then schedulek("Terminate",kCycleCount/kTrigMaxFreq,1) turnoff endif endif // print main values if (changed(kCycleCount) == 1) then printks("Cycle %d:\n",0,kCycleCount) printks(" kStep (semitones) and kTrigMaxFreq (Hz) = %.3f\n number of harmonics = %.3f\n",0,kStep,int(kNumHarm)) endifendinschedule("Call",0,-1)instr Play iPitch = p4 iPan = p5 aOut = oscili:a(0.2,mtof:i(iPitch),giSound) aOut = linen:a(aOut,0,p3,p3/2) aL,aR pan2 aOut,iPan out(aL,aR)endininstr Terminate event("e",0,0)endin</CsInstruments>
<CsScore></CsScore>
</CsoundSynthesizer>
—
Reply to this email directly, view it on GitHub
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzczNyNpc3N1ZWNvbW1lbnQtMjE1ODc1MDkzOA==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=NXhoTU0vaGRwWllNd0I3dTVRa1hYYVVBWWNYWGpjNWJPTmNhK3FPL2dhUT0=&h=ca93ef3c20e044aab674fe8a0357e967&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>,
or unsubscribe
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZTT1pYN0hMSjdUWlBBTjdCM1pHWEVQWEFWQ05GU002QUFBQUFCSVNSVTJFU1ZISTJEU01WUVdJWDNMTVY0M09TTFRPTjJXS1EzUE5WV1dLM1RVSE1aRENOSllHNDJUQU9KVEhB&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=TE1CeXQrbi9VNlBDNVJ3eVJQQUNteDRCWUhMWU94ZjlXcWlMV25VUWpDcz0=&h=ca93ef3c20e044aab674fe8a0357e967&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
and a new musical example is born! |
thanks stefano, and also menno and richard -
yes this was because of email line break. actually i sent the .csd some
hours ago attached, but i think it was rejected by github because .csd
attachements are not accepted.
i have meanwhile sent it to menno privately because the indentation was
ruined, too. but that is important for readability.
cheers and thanks for great work on the manual -
joachim
…On 10/06/2024 17:59, Stefano Cucchi wrote:
Now should work, there was a typo error in line 79 or some error during
copy & paste the code
Thanyou @joachimheintz <https://github.com/joachimheintz>
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac;;;realtime audio out
-m128;;;reduce console output
;-iadc ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o schedulek.wav -W ;;; for file output any platform
; by joachim heintz 2024
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 1
seed 0
opcode RndHarm,i[],iop
//generates an array with iLen random numbers
iLen,iMin,iMax xin //defaults to iMin=0 and iMax=1
iOut[] init iLen
indx = 0
while (indx<iLen) do
iOut[indx] = random:i(iMin,iMax)
indx += 1
od
xout iOut
endop
instr GenerateSpectrum
iHarmonics[] = RndHarm(p4)
giSound = ftgen(0,0,4096,10,iHarmonics)
endin
schedule("GenerateSpectrum",0,0,4)
instr Call
iStartPitch = 80 //MIDI note number
kPitch init iStartPitch
kStep init 3
kNoteCount init 0
kTrigMaxFreq init 3
kTrigFreq init 2
kPan init 0.9
kNumHarm init 4
kCycleCount init 1
if (metro:k(kTrigFreq) == 1) then
// call instrument
schedulek("Play",0,kCycleCount/kTrigMaxFreq,kPitch,kPan)
// update values
kTrigFreq = random:k(kTrigMaxFreq/2,kTrigMaxFreq)
kNoteCount += 1
kPan -= 0.8/7
kPitch -= kStep
// if seven tones have been played, start again differently
if (kNoteCount == 7) then
kPitch = iStartPitch
kPan = 0.9
kStep /= 1.5
kTrigMaxFreq /= 1.5
kNoteCount = 0
kNumHarm *= 1.5
kCycleCount += 1
schedulek("GenerateSpectrum",0,0,int(kNumHarm))
endif
// stop after six cycles
if (kCycleCount == 7) then
schedulek("Terminate",kCycleCount/kTrigMaxFreq,1)
turnoff
endif
endif
// print main values
if (changed(kCycleCount) == 1) then
printks("Cycle %d:\n",0,kCycleCount)
printks(" kStep (semitones) and kTrigMaxFreq (Hz) = %.3f\n number of
harmonics = %.3f\n",0,kStep,int(kNumHarm))
endif
endin
schedule("Call",0,-1)
instr Play
iPitch = p4
iPan = p5
aOut = oscili:a(0.2,mtof:i(iPitch),giSound)
aOut = linen:a(aOut,0,p3,p3/2)
aL,aR pan2 aOut,iPan
out(aL,aR)
endin
instr Terminate
event("e",0,0)
endin
</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>
—
Reply to this email directly, view it on GitHub
<#737 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQYHKVNNECSC3VLC42EHJTZGXEPXAVCNFSM6AAAAABISRU2ESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJYG42TAOJTHA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
very simple example for "tabw" <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 tabw.wav -W ;;; for file output any platform
;By Stefano Cucchi 2024
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
tabw p4, 0, 2 ; write content of function number "2"
tabw p5, 1, 2
tabw p6, 2, 2
tabw p7, 3, 2
tabw p8, 4, 2
kamp oscili 1, 1/p3, 2 ;use f2 as envelope
asig poscil kamp, 440, 1
outs asig, asig
endin
</CsInstruments>
<CsScore>
f 1 0 8192 10 1 0.6 0 0.4 0.6
f2 0 5 2 0 0 0 0 0
i1 0 2 0 0.9 0 0.2 0.9 ; every note has different envelope
i1 3 2 1 1 0 0.5 0
e
</CsScore>
</CsoundSynthesizer>
|
clear.
*- Dr.B*
*Dr. Richard Boulanger*
Professor
Electronic Production and Design
*Berklee College of Music*
Professional Writing & Technology Division
…On Mon, Jun 10, 2024 at 2:30 PM Stefano Cucchi ***@***.***> wrote:
very simple example for "tabw"
<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 tabw.wav -W ;;; for file output any platform
;By Stefano Cucchi 2024
</CsOptions>
<CsInstruments>sr = 48000 ksmps = 32 nchnls = 2 0dbfs = 1 instr 1tabw p4, 0, 2 ; write content of function number "2"tabw p5, 1, 2tabw p6, 2, 2tabw p7, 3, 2tabw p8, 4, 2kamp oscili 1, 1/p3, 2 ;use f2 as envelopeasig poscil kamp, 440, 1 outs asig, asigendin</CsInstruments>
<CsScore>f 1 0 8192 10 1 0.6 0 0.4 0.6 f2 0 5 2 0 0 0 0 0i1 0 2 0 0.9 0 0.2 0.9 ; every note has different envelopei1 3 2 1 1 0 0.5 0e</CsScore>
</CsoundSynthesizer>
—
Reply to this email directly, view it on GitHub
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzczNyNpc3N1ZWNvbW1lbnQtMjE1OTAzMjY2Mg==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=OUJKUzdDaWg3b054SHhSMEt2Z3l2RmxzKzZOWm5xdHhYNnNGc0Eza3c2OD0=&h=d73dae24106e494382af147c3b17432b&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>,
or unsubscribe
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZYTkNCSUxSM1IyNEZSQlVQM1pHWFdGVEFWQ05GU002QUFBQUFCSVNSVTJFU1ZISTJEU01WUVdJWDNMTVY0M09TTFRPTjJXS1EzUE5WV1dLM1RVSE1aRENOSlpHQVpURU5SV0dJ&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=a3NSdHFHK1A0MFVDTVdLMll5TUczWHM5SG9LYWpqN3UwY3JFSlFreld6Yz0=&h=d73dae24106e494382af147c3b17432b&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
i added an extra note and the notes now have a slightly longer duration. I can hear better now it envelopes: i1 0 3 0 0.9 0 0.2 0.9 ; every note has different envelope |
simple example for "tabw_i" <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 tabw_i.wav -W ;;; for file output any platform
; By Stefano Cucchi 2024
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 64
nchnls = 2
0dbfs = 1
instr 1
ain diskin "fox.wav"
ifn = 1 ; table filled with "0"
isig1 = p4
indx1 = p5
tabw_i isig1, indx1, ifn ; write a value in the table
isig2 = p6
indx2 = p7
tabw_i isig2, indx2, ifn ; write a value in the table
aconv dconv ain, 32768, 1 ; convolution
outs aconv, aconv
endin
</CsInstruments>
<CsScore>
f1 0 32768 7 0 32768 0
i1 0 10 1 1 1 16384 ; writes 1 at the beginning and 1 in the middle so we hear 2 copyes of the "fox"
e
</CsScore>
</CsoundSynthesizer>
|
on my machine i get a lot of And a quote from Richard: |
I just got a lot of noise out. I know what it is supposed to do.
- could the problem be fox.wav?
*- Dr.B*
*Dr. Richard Boulanger*
Professor
Electronic Production and Design
*Berklee College of Music*
Professional Writing & Technology Division
…On Fri, Jun 14, 2024 at 11:32 AM Stefano Cucchi ***@***.***> wrote:
simple example for "tabw_i"
<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 tabw_i.wav -W ;;; for file output any platform
; By Stefano Cucchi 2024
</CsOptions>
<CsInstruments>sr = 44100ksmps = 64nchnls = 20dbfs = 1instr 1ain diskin "fox.wav"ifn = 1 ; table filled with "0"isig1 = p4indx1 = p5tabw_i isig1, indx1, ifn ; write a value in the table isig2 = p6indx2 = p7tabw_i isig2, indx2, ifn ; write a value in the table aconv dconv ain, 32768, 1 ; convolution outs aconv, aconvendin</CsInstruments>
<CsScore>f1 0 32768 7 0 32768 0i1 0 10 1 1 1 16384 ; writes 1 at the beginning and 1 in the middle so we hear 2 copyes of the "fox"e</CsScore>
</CsoundSynthesizer>
—
Reply to this email directly, view it on GitHub
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL2Nzb3VuZC9tYW51YWwvaXNzdWVzLzczNyNpc3N1ZWNvbW1lbnQtMjE2ODI3OTkzMw==&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=MmFnc3ZIb3hNdnRJTytROXRsUG9KY0hIZi92L0NVcnU3L1R4dTREcUJkaz0=&h=ac908ba6761741f099e11e402a1ab495&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>,
or unsubscribe
<https://us-west-2.protection.sophos.com?d=github.com&u=aHR0cHM6Ly9naXRodWIuY29tL25vdGlmaWNhdGlvbnMvdW5zdWJzY3JpYmUtYXV0aC9BQUxXWUZYN0RIUlhMTDNINU5UVFBaTFpITUVIVEFWQ05GU002QUFBQUFCSVNSVTJFU1ZISTJEU01WUVdJWDNMTVY0M09TTFRPTjJXS1EzUE5WV1dLM1RVSE1aRENOUllHSTNUU09KVEdN&i=NWYxNzBkMDNiNTVmZGEwZmIyNjczYmRm&t=UDVLQ3U3dFZxVlBqZ3phTWFocjJUSmF2dy96UWJZYzk4R2tTM3VDMG5Baz0=&h=ac908ba6761741f099e11e402a1ab495&s=AVNPUEhUT0NFTkNSWVBUSVZ-CzEl059Ym1RlqwKl3ZhNfC-dR2N5IDL9CUAdMA_6tA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Here the audio file of tabw_i |
I got an error trying to access Dropbox. As this example is clearly CPU demanding, we could get the -odac command out and only let it render to disk? |
The example from Joachim is now part of the musical examples folder. |
The text was updated successfully, but these errors were encountered: