[Csnd] 2 instances of Partikkel

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] 2 instances of Partikkel

bubget
Hi all, forgive my laziness as I have tried to work this out...but my hangover prevents me from investigating further....comes up whenever the audio file in the second instance is different than the first

I would like to layer instances of partikkel and/or another granular synth..

I have tried to do so as a test, however, INIT ERROR in instr 0: ftgen string arg not allowed comes up whenever the audio file in the second instance is different than the first........

If I use the same audio file in both instances, it runs fine...however, that obviously defeats the purpose..

below is the code



<CsoundSynthesizer>

<CsOptions>

-o1_partikkel_basic.wav

</CsOptions>

<CsInstruments>


;***************************************************

; globals

;***************************************************


sr = 44100

ksmps = 10

nchnls = 2

0dbfs = 1


;***************************************************

;ftables

;***************************************************


; load audio files

giStruglKor ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile


; classic waveforms

giSine ftgen 0, 0, 65537, 10, 1 ; sine wave

giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave

giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave


; grain envelope tables

giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid

giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid

giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay

giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window


instr 1 ; triggers instrument 2

ktrigger metro 0.1 ;metronome of triggers. One every 12.5s

schedkwhen ktrigger,0,0,2,0,60 ;trigger instr. 2 for 40s

endin

;******************************************************

; partikkel instr

;******************************************************

instr 2


;*******************************

; setup of source waveforms

; (needs to be done first, because grain pitch and time pointer depends on source waveform lengths)

;*******************************


; select source waveforms

kwaveform1 = giStruglKor ; source audio waveform 1

kwave1Single = 0 ; flag to set if waveform is single cycle (set to zero for sampled waveforms)

kwaveform2 = giStruglKor ; source audio waveform 2

kwave2Single = 0 ; flag to set if waveform is single cycle (set to zero for sampled waveforms)

kwaveform3 = giStruglKor ; source audio waveform 3

kwave3Single = 0 ; flag to set if waveform is single cycle (set to zero for sampled waveforms)

kwaveform4 = giStruglKor ; source audio waveform 4

kwave4Single = 0 ; flag to set if waveform is single cycle (set to zero for sampled waveforms)


; get source waveform length (used when calculating transposition and time pointer)

kfilen1 tableng kwaveform1 ; get length of the first source waveform

kfilen2 tableng kwaveform2 ; same as above, for source waveform 2

kfilen3 tableng kwaveform3 ; same as above, for source waveform 3

kfilen4 tableng kwaveform4 ; same as above, for source waveform 4

kfildur1 = kfilen1 / sr ; length in seconds, for the first source waveform

kfildur2 = kfilen2 / sr ; same as above, for source waveform 2

kfildur3 = kfilen3 / sr ; same as above, for source waveform 3

kfildur4 = kfilen4 / sr ; same as above, for source waveform 4


; original pitch for each waveform, use if they should be transposed individually

; can also be used as a "cycles per second" parameter for single cycle waveforms (assuming that the kwavfreq parameter has a value of 1.0)

kwavekey1 = 1

kwavekey2 = 1

kwavekey3 = 1

kwavekey4 = 1


; set original key dependant on waveform length (only for sampled waveforms, not for single cycle waves)

kwavekey1 = (kwave1Single > 0 ? kwavekey1 : kwavekey1/kfildur1)

kwavekey2 = (kwave2Single > 0 ? kwavekey2 : kwavekey2/kfildur2)

kwavekey3 = (kwave3Single > 0 ? kwavekey3 : kwavekey3/kfildur3)

kwavekey4 = (kwave4Single > 0 ? kwavekey4 : kwavekey4/kfildur4)


; time pointer (phase). This can be independent for each source waveform.

isamplepos1 = 0 ; initial phase for wave source 1

isamplepos2 = 0 ; initial phase for wave source 2

isamplepos3 = 0 ; initial phase for wave source 3

isamplepos4 = 0 ; initial phase for wave source 4


kTimeRate invalue "time" ; time pointer rate

asamplepos1 phasor kTimeRate / kfildur1 ; phasor from 0 to 1, scaled to the length of the first source waveform

asamplepos2 phasor kTimeRate / kfildur2 ; same as above, scaled for source wave 2

asamplepos3 phasor kTimeRate / kfildur3 ; same as above, scaled for source wave 3

asamplepos4 phasor kTimeRate / kfildur4 ; same as above, scaled for source wave 4


; mix initial phase and moving phase value (moving phase only for sampled waveforms, single cycle waveforms use static samplepos)

asamplepos1 = asamplepos1*(1-kwave1Single) + isamplepos1

asamplepos2 = asamplepos2*(1-kwave2Single) + isamplepos2

asamplepos3 = asamplepos3*(1-kwave3Single) + isamplepos3

asamplepos4 = asamplepos4*(1-kwave4Single) + isamplepos4


;*******************************

; other granular synthesis parameters

;*******************************


; amplitude

kamp = ampdbfs(-3) ; output amplitude


; sync

async = 0.0 ; set the sync input to zero (disable external sync)


; grain rate

kGrainRate invalue "rate" ; number of grains per second


; grain rate FM

kGrFmFreq = kGrainRate/4 ; FM freq for modulating the grainrate

kGrFmIndex = 0.0 ; FM index for modulating the grainrate (normally kept in a 0.0 to 1.0 range)

iGrFmWave = giSine ; FM waveform, for modulating the grainrate

aGrFmSig oscil kGrFmIndex, kGrFmFreq, iGrFmWave ; audio signal for frequency modulation of grain rate

agrainrate = kGrainRate + (aGrFmSig*kGrainRate) ; add the modulator signal to the grain rate signal


; distribution

kdistribution = 0.0 ; grain random distribution in time

idisttab ftgentmp 0, 0, 16, 16, 1, 16, -10, 0 ; probability distribution for random grain masking


; grain shape

kGrainDur = 2.5 ; length of each grain relative to grain rate

kduration = (kGrainDur*1000)/kGrainRate ; grain dur in milliseconds, relative to grain rate


ienv_attack = giSigmoRise ; grain attack shape (from table)

ienv_decay = giSigmoFall ; grain decay shape (from table)

ksustain_amount = 0.0 ; balance between enveloped time(attack+decay) and sustain level time, 0.0 = no time at sustain level

ka_d_ratio = 0.5 ; balance between attack time and decay time, 0.0 = zero attack time and full decay time


kenv2amt = 0.0 ; amount of secondary enveloping per grain (e.g. for fof synthesis)

ienv2tab = giExpFall ; secondary grain shape (from table), enveloping the whole grain if used


; grain pitch (transpose, or "playback speed")

kwavfreq = 1 ; transposition factor (playback speed) of audio inside grains,


; pitch sweep

ksweepshape = 0.5 ; grain wave pitch sweep shape (sweep speed), 0.5 is linear sweep

iwavfreqstarttab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; start freq scalers, per grain

iwavfreqendtab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; end freq scalers, per grain


; FM of grain pitch (playback speed)

kPtchFmFreq = 440 ; FM freq, modulating waveform pitch

kPtchFmIndex = 0 ; FM index, modulating waveform pitch

iPtchFmWave = giSine ; FM waveform, modulating waveform pitch

ifmamptab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; FM index scalers, per grain

ifmenv = giTriangleWin ; FM index envelope, over each grain (from table)

kPtchFmIndex = kPtchFmIndex + (kPtchFmIndex*kPtchFmFreq*0.00001) ; FM index scaling formula

awavfm oscil kPtchFmIndex, kPtchFmFreq, iPtchFmWave ; Modulator signal for frequency modulation inside grain


; trainlet parameters

icosine = giCosine ; needs to be a cosine wave to create trainlets

kTrainCps = kGrainRate ; set cps equal to grain freq, creating a single cycle of a trainlet inside each grain

knumpartials = 7 ; number of partials in trainlet

kchroma = 3 ; chroma, falloff of partial amplitude towards sr/2


; masking

; gain masking table, amplitude for individual grains

igainmasks ftgentmp 0, 0, 16, -2, 0, 0, 1


; channel masking table, output routing for individual grains (zero based, a value of 0.0 routes to output 1)

ichannelmasks ftgentmp 0, 0, 16, -2, 0, 0, 0.5

; random masking (muting) of individual grains

krandommask = 0


; wave mix masking.

; Set gain per source waveform per grain,

; in groups of 5 amp values, reflecting source1, source2, source3, source4, and the 5th slot is for trainlet amplitude.

iwaveamptab ftgentmp 0, 0, 32, -2, 0, 0, 1,0,0,0,0


; system parameter

imax_grains = 100 ; max number of grains per k-period


;***********



a1,a2,a3,a4,a5,a6,a7,a8 partikkel agrainrate, kdistribution, idisttab, async, kenv2amt, ienv2tab, \

ienv_attack, ienv_decay, ksustain_amount, ka_d_ratio, kduration, kamp, igainmasks, \

kwavfreq, ksweepshape, iwavfreqstarttab, iwavfreqendtab, awavfm, \

ifmamptab, ifmenv, icosine, kTrainCps, knumpartials, \

kchroma, ichannelmasks, krandommask, kwaveform1, kwaveform2, kwaveform3, kwaveform4, \

iwaveamptab, asamplepos1, asamplepos2, asamplepos3, asamplepos4, \

kwavekey1, kwavekey2, kwavekey3, kwavekey4, imax_grains


outs a1, a2

endin

; load audio files

giStruglKor ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile


; classic waveforms

giSine ftgen 0, 0, 65537, 10, 1 ; sine wave

giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave

giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave


; grain envelope tables

giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid

giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid

giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay

giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window


instr 3 ; triggers instrument 4

ktrigger metro 0.1 ;metronome of triggers. One every 12.5s

schedkwhen ktrigger,0,0,4,0,60 ;trigger instr. 2 for 40s

endin

;******************************************************

; partikkel instr

;******************************************************

instr 4


;*******************************

; setup of source waveforms

; (needs to be done first, because grain pitch and time pointer depends on source waveform lengths)

;*******************************


; select source waveforms

kwaveform1 = giStruglKor ; source audio waveform 1

kwave1Single = 0 ; flag to set if waveform is single cycle (set to zero for sampled waveforms)

kwaveform2 = giStruglKor ; source audio waveform 2

kwave2Single = 0 ; flag to set if waveform is single cycle (set to zero for sampled waveforms)

kwaveform3 = giStruglKor ; source audio waveform 3

kwave3Single = 0 ; flag to set if waveform is single cycle (set to zero for sampled waveforms)

kwaveform4 = giStruglKor ; source audio waveform 4

kwave4Single = 0 ; flag to set if waveform is single cycle (set to zero for sampled waveforms)


; get source waveform length (used when calculating transposition and time pointer)

kfilen1 tableng kwaveform1 ; get length of the first source waveform

kfilen2 tableng kwaveform2 ; same as above, for source waveform 2

kfilen3 tableng kwaveform3 ; same as above, for source waveform 3

kfilen4 tableng kwaveform4 ; same as above, for source waveform 4

kfildur1 = kfilen1 / sr ; length in seconds, for the first source waveform

kfildur2 = kfilen2 / sr ; same as above, for source waveform 2

kfildur3 = kfilen3 / sr ; same as above, for source waveform 3

kfildur4 = kfilen4 / sr ; same as above, for source waveform 4


; original pitch for each waveform, use if they should be transposed individually

; can also be used as a "cycles per second" parameter for single cycle waveforms (assuming that the kwavfreq parameter has a value of 1.0)

kwavekey1 = 1

kwavekey2 = 1

kwavekey3 = 1

kwavekey4 = 1


; set original key dependant on waveform length (only for sampled waveforms, not for single cycle waves)

kwavekey1 = (kwave1Single > 0 ? kwavekey1 : kwavekey1/kfildur1)

kwavekey2 = (kwave2Single > 0 ? kwavekey2 : kwavekey2/kfildur2)

kwavekey3 = (kwave3Single > 0 ? kwavekey3 : kwavekey3/kfildur3)

kwavekey4 = (kwave4Single > 0 ? kwavekey4 : kwavekey4/kfildur4)


; time pointer (phase). This can be independent for each source waveform.

isamplepos1 = 0 ; initial phase for wave source 1

isamplepos2 = 0 ; initial phase for wave source 2

isamplepos3 = 0 ; initial phase for wave source 3

isamplepos4 = 0 ; initial phase for wave source 4


kTimeRate invalue "time" ; time pointer rate

asamplepos1 phasor kTimeRate / kfildur1 ; phasor from 0 to 1, scaled to the length of the first source waveform

asamplepos2 phasor kTimeRate / kfildur2 ; same as above, scaled for source wave 2

asamplepos3 phasor kTimeRate / kfildur3 ; same as above, scaled for source wave 3

asamplepos4 phasor kTimeRate / kfildur4 ; same as above, scaled for source wave 4


; mix initial phase and moving phase value (moving phase only for sampled waveforms, single cycle waveforms use static samplepos)

asamplepos1 = asamplepos1*(1-kwave1Single) + isamplepos1

asamplepos2 = asamplepos2*(1-kwave2Single) + isamplepos2

asamplepos3 = asamplepos3*(1-kwave3Single) + isamplepos3

asamplepos4 = asamplepos4*(1-kwave4Single) + isamplepos4


;*******************************

; other granular synthesis parameters

;*******************************


; amplitude

kamp = ampdbfs(-3) ; output amplitude


; sync

async = 0.0 ; set the sync input to zero (disable external sync)


; grain rate

kGrainRate invalue "rate" ; number of grains per second


; grain rate FM

kGrFmFreq = kGrainRate/4 ; FM freq for modulating the grainrate

kGrFmIndex = 0.0 ; FM index for modulating the grainrate (normally kept in a 0.0 to 1.0 range)

iGrFmWave = giSine ; FM waveform, for modulating the grainrate

aGrFmSig oscil kGrFmIndex, kGrFmFreq, iGrFmWave ; audio signal for frequency modulation of grain rate

agrainrate = kGrainRate + (aGrFmSig*kGrainRate) ; add the modulator signal to the grain rate signal


; distribution

kdistribution = 0.0 ; grain random distribution in time

idisttab ftgentmp 0, 0, 16, 16, 1, 16, -10, 0 ; probability distribution for random grain masking


; grain shape

kGrainDur = 2.5 ; length of each grain relative to grain rate

kduration = (kGrainDur*1000)/kGrainRate ; grain dur in milliseconds, relative to grain rate


ienv_attack = giSigmoRise ; grain attack shape (from table)

ienv_decay = giSigmoFall ; grain decay shape (from table)

ksustain_amount = 0.0 ; balance between enveloped time(attack+decay) and sustain level time, 0.0 = no time at sustain level

ka_d_ratio = 0.5 ; balance between attack time and decay time, 0.0 = zero attack time and full decay time


kenv2amt = 0.0 ; amount of secondary enveloping per grain (e.g. for fof synthesis)

ienv2tab = giExpFall ; secondary grain shape (from table), enveloping the whole grain if used


; grain pitch (transpose, or "playback speed")

kwavfreq = 1 ; transposition factor (playback speed) of audio inside grains,


; pitch sweep

ksweepshape = 0.5 ; grain wave pitch sweep shape (sweep speed), 0.5 is linear sweep

iwavfreqstarttab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; start freq scalers, per grain

iwavfreqendtab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; end freq scalers, per grain


; FM of grain pitch (playback speed)

kPtchFmFreq = 440 ; FM freq, modulating waveform pitch

kPtchFmIndex = 0 ; FM index, modulating waveform pitch

iPtchFmWave = giSine ; FM waveform, modulating waveform pitch

ifmamptab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; FM index scalers, per grain

ifmenv = giTriangleWin ; FM index envelope, over each grain (from table)

kPtchFmIndex = kPtchFmIndex + (kPtchFmIndex*kPtchFmFreq*0.00001) ; FM index scaling formula

awavfm oscil kPtchFmIndex, kPtchFmFreq, iPtchFmWave ; Modulator signal for frequency modulation inside grain


; trainlet parameters

icosine = giCosine ; needs to be a cosine wave to create trainlets

kTrainCps = kGrainRate ; set cps equal to grain freq, creating a single cycle of a trainlet inside each grain

knumpartials = 7 ; number of partials in trainlet

kchroma = 3 ; chroma, falloff of partial amplitude towards sr/2


; masking

; gain masking table, amplitude for individual grains

igainmasks ftgentmp 0, 0, 16, -2, 0, 0, 1


; channel masking table, output routing for individual grains (zero based, a value of 0.0 routes to output 1)

ichannelmasks ftgentmp 0, 0, 16, -2, 0, 0, 0.5

; random masking (muting) of individual grains

krandommask = 0


; wave mix masking.

; Set gain per source waveform per grain,

; in groups of 5 amp values, reflecting source1, source2, source3, source4, and the 5th slot is for trainlet amplitude.

iwaveamptab ftgentmp 0, 0, 32, -2, 0, 0, 1,0,0,0,0


; system parameter

imax_grains = 100 ; max number of grains per k-period


;***********



a1,a2,a3,a4,a5,a6,a7,a8 partikkel agrainrate, kdistribution, idisttab, async, kenv2amt, ienv2tab, \

ienv_attack, ienv_decay, ksustain_amount, ka_d_ratio, kduration, kamp, igainmasks, \

kwavfreq, ksweepshape, iwavfreqstarttab, iwavfreqendtab, awavfm, \

ifmamptab, ifmenv, icosine, kTrainCps, knumpartials, \

kchroma, ichannelmasks, krandommask, kwaveform1, kwaveform2, kwaveform3, kwaveform4, \

iwaveamptab, asamplepos1, asamplepos2, asamplepos3, asamplepos4, \

kwavekey1, kwavekey2, kwavekey3, kwavekey4, imax_grains


outs a1, a2

endin


;******************************************************


</CsInstruments>

<CsScore>


; start dur

i1 0 60

i2 0 60

i3 0 60

i4 0 60

</CsScore>


</CsoundSynthesizer>



I'm sure I have neglected something basic, any help would be appreciated.


Also, I would like the instances to use different outs.......how would I go about that?


Forgive me again if these are very basic questions.


Thanks in advance,


Tarek



Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

jpff
According to the code that error message happens if the gen is not one of
         case 1:
         case 23:
         case 28:
         case 43:
         case 49:

Not managed to understad you csd yet but thougt tis info may elp


On Sat, 11 Feb 2017, T Lopez wrote:

> Hi all, forgive my laziness as I have tried to work this out...but my hangover
> prevents me from investigating further....comes up whenever the audio file in
> the second instance is different than the first
>
> I would like to layer instances of partikkel and/or another granular synth..
>
> I have tried to do so as a test, however, INIT ERROR in instr 0: ftgen string
> arg not allowed comes up whenever the audio file in the second instance is
> different than the first........
>
> If I use the same audio file in both instances, it runs fine...however, that
> obviously defeats the purpose..
>
> below is the code
>
>
>
> <CsoundSynthesizer>
>
> <CsOptions>
>
> -o1_partikkel_basic.wav
>
> </CsOptions>
>
> <CsInstruments>
>
>
> ;***************************************************
>
> ; globals
>
> ;***************************************************
>
>
> sr = 44100
>
> ksmps = 10
>
> nchnls = 2
>
> 0dbfs = 1
>
>
> ;***************************************************
>
> ;ftables
>
> ;***************************************************
>
>
> ; load audio files
>
> giStruglKor ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile
>
>
> ; classic waveforms
>
> giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
>
> giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
>
> giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave
>
>
> ; grain envelope tables
>
> giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
>
> giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
>
> giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
>
> giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window
>
>
> instr 1 ; triggers instrument 2
>
> ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
>
> schedkwhen ktrigger,0,0,2,0,60 ;trigger instr. 2 for 40s
>
> endin
>
> ;******************************************************
>
> ; partikkel instr
>
> ;******************************************************
>
> instr 2
>
>
> ;*******************************
>
> ; setup of source waveforms
>
> ; (needs to be done first, because grain pitch and time pointer depends on
> source waveform lengths)
>
> ;*******************************
>
>
> ; select source waveforms
>
> kwaveform1 = giStruglKor ; source audio waveform 1
>
> kwave1Single = 0 ; flag to set if waveform is single cycle (set to zero for
> sampled waveforms)
>
> kwaveform2 = giStruglKor ; source audio waveform 2
>
> kwave2Single = 0 ; flag to set if waveform is single cycle (set to zero for
> sampled waveforms)
>
> kwaveform3 = giStruglKor ; source audio waveform 3
>
> kwave3Single = 0 ; flag to set if waveform is single cycle (set to zero for
> sampled waveforms)
>
> kwaveform4 = giStruglKor ; source audio waveform 4
>
> kwave4Single = 0 ; flag to set if waveform is single cycle (set to zero for
> sampled waveforms)
>
>
> ; get source waveform length (used when calculating transposition and time
> pointer)
>
> kfilen1 tableng kwaveform1 ; get length of the first source waveform
>
> kfilen2 tableng kwaveform2 ; same as above, for source waveform 2
>
> kfilen3 tableng kwaveform3 ; same as above, for source waveform 3
>
> kfilen4 tableng kwaveform4 ; same as above, for source waveform 4
>
> kfildur1 = kfilen1 / sr ; length in seconds, for the first source waveform
>
> kfildur2 = kfilen2 / sr ; same as above, for source waveform 2
>
> kfildur3 = kfilen3 / sr ; same as above, for source waveform 3
>
> kfildur4 = kfilen4 / sr ; same as above, for source waveform 4
>
>
> ; original pitch for each waveform, use if they should be transposed
> individually
>
> ; can also be used as a "cycles per second" parameter for single cycle
> waveforms (assuming that the kwavfreq parameter has a value of 1.0)
>
> kwavekey1 = 1
>
> kwavekey2 = 1
>
> kwavekey3 = 1
>
> kwavekey4 = 1
>
>
> ; set original key dependant on waveform length (only for sampled waveforms,
> not for single cycle waves)
>
> kwavekey1 = (kwave1Single > 0 ? kwavekey1 : kwavekey1/kfildur1)
>
> kwavekey2 = (kwave2Single > 0 ? kwavekey2 : kwavekey2/kfildur2)
>
> kwavekey3 = (kwave3Single > 0 ? kwavekey3 : kwavekey3/kfildur3)
>
> kwavekey4 = (kwave4Single > 0 ? kwavekey4 : kwavekey4/kfildur4)
>
>
> ; time pointer (phase). This can be independent for each source waveform.
>
> isamplepos1 = 0 ; initial phase for wave source 1
>
> isamplepos2 = 0 ; initial phase for wave source 2
>
> isamplepos3 = 0 ; initial phase for wave source 3
>
> isamplepos4 = 0 ; initial phase for wave source 4
>
>
> kTimeRate invalue "time" ; time pointer rate
>
> asamplepos1 phasor kTimeRate / kfildur1 ; phasor from 0 to 1, scaled to the
> length of the first source waveform
>
> asamplepos2 phasor kTimeRate / kfildur2 ; same as above, scaled for source
> wave 2
>
> asamplepos3 phasor kTimeRate / kfildur3 ; same as above, scaled for source
> wave 3
>
> asamplepos4 phasor kTimeRate / kfildur4 ; same as above, scaled for source
> wave 4
>
>
> ; mix initial phase and moving phase value (moving phase only for sampled
> waveforms, single cycle waveforms use static samplepos)
>
> asamplepos1 = asamplepos1*(1-kwave1Single) + isamplepos1
>
> asamplepos2 = asamplepos2*(1-kwave2Single) + isamplepos2
>
> asamplepos3 = asamplepos3*(1-kwave3Single) + isamplepos3
>
> asamplepos4 = asamplepos4*(1-kwave4Single) + isamplepos4
>
>
> ;*******************************
>
> ; other granular synthesis parameters
>
> ;*******************************
>
>
> ; amplitude
>
> kamp = ampdbfs(-3) ; output amplitude
>
>
> ; sync
>
> async = 0.0 ; set the sync input to zero (disable external sync)
>
>
> ; grain rate
>
> kGrainRate invalue "rate" ; number of grains per second
>
>
> ; grain rate FM
>
> kGrFmFreq = kGrainRate/4 ; FM freq for modulating the grainrate
>
> kGrFmIndex = 0.0 ; FM index for modulating the grainrate (normally kept in a
> 0.0 to 1.0 range)
>
> iGrFmWave = giSine ; FM waveform, for modulating the grainrate
>
> aGrFmSig oscil kGrFmIndex, kGrFmFreq, iGrFmWave ; audio signal for frequency
> modulation of grain rate
>
> agrainrate = kGrainRate + (aGrFmSig*kGrainRate) ; add the modulator signal to
> the grain rate signal
>
>
> ; distribution
>
> kdistribution = 0.0 ; grain random distribution in time
>
> idisttab ftgentmp 0, 0, 16, 16, 1, 16, -10, 0 ; probability distribution for
> random grain masking
>
>
> ; grain shape
>
> kGrainDur = 2.5 ; length of each grain relative to grain rate
>
> kduration = (kGrainDur*1000)/kGrainRate ; grain dur in milliseconds, relative
> to grain rate
>
>
> ienv_attack = giSigmoRise ; grain attack shape (from table)
>
> ienv_decay = giSigmoFall ; grain decay shape (from table)
>
> ksustain_amount = 0.0 ; balance between enveloped time(attack+decay) and
> sustain level time, 0.0 = no time at sustain level
>
> ka_d_ratio = 0.5 ; balance between attack time and decay time, 0.0 = zero
> attack time and full decay time
>
>
> kenv2amt = 0.0 ; amount of secondary enveloping per grain (e.g. for fof
> synthesis)
>
> ienv2tab = giExpFall ; secondary grain shape (from table), enveloping the
> whole grain if used
>
>
> ; grain pitch (transpose, or "playback speed")
>
> kwavfreq = 1 ; transposition factor (playback speed) of audio inside grains,
>
>
> ; pitch sweep
>
> ksweepshape = 0.5 ; grain wave pitch sweep shape (sweep speed), 0.5 is linear
> sweep
>
> iwavfreqstarttab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; start freq scalers, per
> grain
>
> iwavfreqendtab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; end freq scalers, per grain
>
>
> ; FM of grain pitch (playback speed)
>
> kPtchFmFreq = 440 ; FM freq, modulating waveform pitch
>
> kPtchFmIndex = 0 ; FM index, modulating waveform pitch
>
> iPtchFmWave = giSine ; FM waveform, modulating waveform pitch
>
> ifmamptab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; FM index scalers, per grain
>
> ifmenv = giTriangleWin ; FM index envelope, over each grain (from table)
>
> kPtchFmIndex = kPtchFmIndex + (kPtchFmIndex*kPtchFmFreq*0.00001) ; FM index
> scaling formula
>
> awavfm oscil kPtchFmIndex, kPtchFmFreq, iPtchFmWave ; Modulator signal for
> frequency modulation inside grain
>
>
> ; trainlet parameters
>
> icosine = giCosine ; needs to be a cosine wave to create trainlets
>
> kTrainCps = kGrainRate ; set cps equal to grain freq, creating a single cycle
> of a trainlet inside each grain
>
> knumpartials = 7 ; number of partials in trainlet
>
> kchroma = 3 ; chroma, falloff of partial amplitude towards sr/2
>
>
> ; masking
>
> ; gain masking table, amplitude for individual grains
>
> igainmasks ftgentmp 0, 0, 16, -2, 0, 0, 1
>
>
> ; channel masking table, output routing for individual grains (zero based, a
> value of 0.0 routes to output 1)
>
> ichannelmasks ftgentmp 0, 0, 16, -2, 0, 0, 0.5
>
> ; random masking (muting) of individual grains
>
> krandommask = 0
>
>
> ; wave mix masking.
>
> ; Set gain per source waveform per grain,
>
> ; in groups of 5 amp values, reflecting source1, source2, source3, source4,
> and the 5th slot is for trainlet amplitude.
>
> iwaveamptab ftgentmp 0, 0, 32, -2, 0, 0, 1,0,0,0,0
>
>
> ; system parameter
>
> imax_grains = 100 ; max number of grains per k-period
>
>
> ;***********
>
>
>
> a1,a2,a3,a4,a5,a6,a7,a8 partikkel agrainrate, kdistribution, idisttab, async,
> kenv2amt, ienv2tab, \
>
> ienv_attack, ienv_decay, ksustain_amount, ka_d_ratio, kduration, kamp,
> igainmasks, \
>
> kwavfreq, ksweepshape, iwavfreqstarttab, iwavfreqendtab, awavfm, \
>
> ifmamptab, ifmenv, icosine, kTrainCps, knumpartials, \
>
> kchroma, ichannelmasks, krandommask, kwaveform1, kwaveform2, kwaveform3,
> kwaveform4, \
>
> iwaveamptab, asamplepos1, asamplepos2, asamplepos3, asamplepos4, \
>
> kwavekey1, kwavekey2, kwavekey3, kwavekey4, imax_grains
>
>
> outs a1, a2
>
> endin
>
> ; load audio files
>
> giStruglKor ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
>
>
> ; classic waveforms
>
> giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
>
> giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
>
> giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave
>
>
> ; grain envelope tables
>
> giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
>
> giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
>
> giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
>
> giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window
>
>
> instr 3 ; triggers instrument 4
>
> ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
>
> schedkwhen ktrigger,0,0,4,0,60 ;trigger instr. 2 for 40s
>
> endin
>
> ;******************************************************
>
> ; partikkel instr
>
> ;******************************************************
>
> instr 4
>
>
> ;*******************************
>
> ; setup of source waveforms
>
> ; (needs to be done first, because grain pitch and time pointer depends on
> source waveform lengths)
>
> ;*******************************
>
>
> ; select source waveforms
>
> kwaveform1 = giStruglKor ; source audio waveform 1
>
> kwave1Single = 0 ; flag to set if waveform is single cycle (set to zero for
> sampled waveforms)
>
> kwaveform2 = giStruglKor ; source audio waveform 2
>
> kwave2Single = 0 ; flag to set if waveform is single cycle (set to zero for
> sampled waveforms)
>
> kwaveform3 = giStruglKor ; source audio waveform 3
>
> kwave3Single = 0 ; flag to set if waveform is single cycle (set to zero for
> sampled waveforms)
>
> kwaveform4 = giStruglKor ; source audio waveform 4
>
> kwave4Single = 0 ; flag to set if waveform is single cycle (set to zero for
> sampled waveforms)
>
>
> ; get source waveform length (used when calculating transposition and time
> pointer)
>
> kfilen1 tableng kwaveform1 ; get length of the first source waveform
>
> kfilen2 tableng kwaveform2 ; same as above, for source waveform 2
>
> kfilen3 tableng kwaveform3 ; same as above, for source waveform 3
>
> kfilen4 tableng kwaveform4 ; same as above, for source waveform 4
>
> kfildur1 = kfilen1 / sr ; length in seconds, for the first source waveform
>
> kfildur2 = kfilen2 / sr ; same as above, for source waveform 2
>
> kfildur3 = kfilen3 / sr ; same as above, for source waveform 3
>
> kfildur4 = kfilen4 / sr ; same as above, for source waveform 4
>
>
> ; original pitch for each waveform, use if they should be transposed
> individually
>
> ; can also be used as a "cycles per second" parameter for single cycle
> waveforms (assuming that the kwavfreq parameter has a value of 1.0)
>
> kwavekey1 = 1
>
> kwavekey2 = 1
>
> kwavekey3 = 1
>
> kwavekey4 = 1
>
>
> ; set original key dependant on waveform length (only for sampled waveforms,
> not for single cycle waves)
>
> kwavekey1 = (kwave1Single > 0 ? kwavekey1 : kwavekey1/kfildur1)
>
> kwavekey2 = (kwave2Single > 0 ? kwavekey2 : kwavekey2/kfildur2)
>
> kwavekey3 = (kwave3Single > 0 ? kwavekey3 : kwavekey3/kfildur3)
>
> kwavekey4 = (kwave4Single > 0 ? kwavekey4 : kwavekey4/kfildur4)
>
>
> ; time pointer (phase). This can be independent for each source waveform.
>
> isamplepos1 = 0 ; initial phase for wave source 1
>
> isamplepos2 = 0 ; initial phase for wave source 2
>
> isamplepos3 = 0 ; initial phase for wave source 3
>
> isamplepos4 = 0 ; initial phase for wave source 4
>
>
> kTimeRate invalue "time" ; time pointer rate
>
> asamplepos1 phasor kTimeRate / kfildur1 ; phasor from 0 to 1, scaled to the
> length of the first source waveform
>
> asamplepos2 phasor kTimeRate / kfildur2 ; same as above, scaled for source
> wave 2
>
> asamplepos3 phasor kTimeRate / kfildur3 ; same as above, scaled for source
> wave 3
>
> asamplepos4 phasor kTimeRate / kfildur4 ; same as above, scaled for source
> wave 4
>
>
> ; mix initial phase and moving phase value (moving phase only for sampled
> waveforms, single cycle waveforms use static samplepos)
>
> asamplepos1 = asamplepos1*(1-kwave1Single) + isamplepos1
>
> asamplepos2 = asamplepos2*(1-kwave2Single) + isamplepos2
>
> asamplepos3 = asamplepos3*(1-kwave3Single) + isamplepos3
>
> asamplepos4 = asamplepos4*(1-kwave4Single) + isamplepos4
>
>
> ;*******************************
>
> ; other granular synthesis parameters
>
> ;*******************************
>
>
> ; amplitude
>
> kamp = ampdbfs(-3) ; output amplitude
>
>
> ; sync
>
> async = 0.0 ; set the sync input to zero (disable external sync)
>
>
> ; grain rate
>
> kGrainRate invalue "rate" ; number of grains per second
>
>
> ; grain rate FM
>
> kGrFmFreq = kGrainRate/4 ; FM freq for modulating the grainrate
>
> kGrFmIndex = 0.0 ; FM index for modulating the grainrate (normally kept in a
> 0.0 to 1.0 range)
>
> iGrFmWave = giSine ; FM waveform, for modulating the grainrate
>
> aGrFmSig oscil kGrFmIndex, kGrFmFreq, iGrFmWave ; audio signal for frequency
> modulation of grain rate
>
> agrainrate = kGrainRate + (aGrFmSig*kGrainRate) ; add the modulator signal to
> the grain rate signal
>
>
> ; distribution
>
> kdistribution = 0.0 ; grain random distribution in time
>
> idisttab ftgentmp 0, 0, 16, 16, 1, 16, -10, 0 ; probability distribution for
> random grain masking
>
>
> ; grain shape
>
> kGrainDur = 2.5 ; length of each grain relative to grain rate
>
> kduration = (kGrainDur*1000)/kGrainRate ; grain dur in milliseconds, relative
> to grain rate
>
>
> ienv_attack = giSigmoRise ; grain attack shape (from table)
>
> ienv_decay = giSigmoFall ; grain decay shape (from table)
>
> ksustain_amount = 0.0 ; balance between enveloped time(attack+decay) and
> sustain level time, 0.0 = no time at sustain level
>
> ka_d_ratio = 0.5 ; balance between attack time and decay time, 0.0 = zero
> attack time and full decay time
>
>
> kenv2amt = 0.0 ; amount of secondary enveloping per grain (e.g. for fof
> synthesis)
>
> ienv2tab = giExpFall ; secondary grain shape (from table), enveloping the
> whole grain if used
>
>
> ; grain pitch (transpose, or "playback speed")
>
> kwavfreq = 1 ; transposition factor (playback speed) of audio inside grains,
>
>
> ; pitch sweep
>
> ksweepshape = 0.5 ; grain wave pitch sweep shape (sweep speed), 0.5 is linear
> sweep
>
> iwavfreqstarttab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; start freq scalers, per
> grain
>
> iwavfreqendtab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; end freq scalers, per grain
>
>
> ; FM of grain pitch (playback speed)
>
> kPtchFmFreq = 440 ; FM freq, modulating waveform pitch
>
> kPtchFmIndex = 0 ; FM index, modulating waveform pitch
>
> iPtchFmWave = giSine ; FM waveform, modulating waveform pitch
>
> ifmamptab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; FM index scalers, per grain
>
> ifmenv = giTriangleWin ; FM index envelope, over each grain (from table)
>
> kPtchFmIndex = kPtchFmIndex + (kPtchFmIndex*kPtchFmFreq*0.00001) ; FM index
> scaling formula
>
> awavfm oscil kPtchFmIndex, kPtchFmFreq, iPtchFmWave ; Modulator signal for
> frequency modulation inside grain
>
>
> ; trainlet parameters
>
> icosine = giCosine ; needs to be a cosine wave to create trainlets
>
> kTrainCps = kGrainRate ; set cps equal to grain freq, creating a single cycle
> of a trainlet inside each grain
>
> knumpartials = 7 ; number of partials in trainlet
>
> kchroma = 3 ; chroma, falloff of partial amplitude towards sr/2
>
>
> ; masking
>
> ; gain masking table, amplitude for individual grains
>
> igainmasks ftgentmp 0, 0, 16, -2, 0, 0, 1
>
>
> ; channel masking table, output routing for individual grains (zero based, a
> value of 0.0 routes to output 1)
>
> ichannelmasks ftgentmp 0, 0, 16, -2, 0, 0, 0.5
>
> ; random masking (muting) of individual grains
>
> krandommask = 0
>
>
> ; wave mix masking.
>
> ; Set gain per source waveform per grain,
>
> ; in groups of 5 amp values, reflecting source1, source2, source3, source4,
> and the 5th slot is for trainlet amplitude.
>
> iwaveamptab ftgentmp 0, 0, 32, -2, 0, 0, 1,0,0,0,0
>
>
> ; system parameter
>
> imax_grains = 100 ; max number of grains per k-period
>
>
> ;***********
>
>
>
> a1,a2,a3,a4,a5,a6,a7,a8 partikkel agrainrate, kdistribution, idisttab, async,
> kenv2amt, ienv2tab, \
>
> ienv_attack, ienv_decay, ksustain_amount, ka_d_ratio, kduration, kamp,
> igainmasks, \
>
> kwavfreq, ksweepshape, iwavfreqstarttab, iwavfreqendtab, awavfm, \
>
> ifmamptab, ifmenv, icosine, kTrainCps, knumpartials, \
>
> kchroma, ichannelmasks, krandommask, kwaveform1, kwaveform2, kwaveform3,
> kwaveform4, \
>
> iwaveamptab, asamplepos1, asamplepos2, asamplepos3, asamplepos4, \
>
> kwavekey1, kwavekey2, kwavekey3, kwavekey4, imax_grains
>
>
> outs a1, a2
>
> endin
>
>
> ;******************************************************
>
>
> </CsInstruments>
>
> <CsScore>
>
>
> ; start dur
>
> i1 0 60
>
> i2 0 60
>
> i3 0 60
>
> i4 0 60
>
> </CsScore>
>
>
> </CsoundSynthesizer>
>
>
>
> I'm sure I have neglected something basic, any help would be appreciated.
>
>
> Also, I would like the instances to use different outs.......how would I go
> about that?
>
>
> Forgive me again if these are very basic questions.
>
>
> Thanks in advance,
>
>
> Tarek
>
>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

bubget
Thanks so much for taking the time out...

Forgive my ignorance, what should I do then?

Not quite sure what what case means....looked it up to no avail..

On 11 February 2017 at 21:52, jpff <[hidden email]> wrote:
According to the code that error message happens if the gen is not one of
        case 1:
        case 23:
        case 28:
        case 43:
        case 49:

Not managed to understad you csd yet but thougt tis info may elp



On Sat, 11 Feb 2017, T Lopez wrote:

Hi all, forgive my laziness as I have tried to work this out...but my hangover
prevents me from investigating further....comes up whenever the audio file in
the second instance is different than the first

I would like to layer instances of partikkel and/or another granular synth..

I have tried to do so as a test, however, INIT ERROR in instr 0: ftgen string
arg not allowed comes up whenever the audio file in the second instance is
different than the first........

If I use the same audio file in both instances, it runs fine...however, that
obviously defeats the purpose..

below is the code



<CsoundSynthesizer>

<CsOptions>

-o1_partikkel_basic.wav

</CsOptions>

<CsInstruments>


;***************************************************

; globals

;***************************************************


sr = 44100

ksmps = 10

nchnls = 2

0dbfs = 1


;***************************************************

;ftables

;***************************************************


; load audio files

giStruglKor ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile


; classic waveforms

giSine ftgen 0, 0, 65537, 10, 1 ; sine wave

giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave

giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave


; grain envelope tables

giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid

giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid

giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay

giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window


instr 1 ; triggers instrument 2

ktrigger metro 0.1 ;metronome of triggers. One every 12.5s

schedkwhen ktrigger,0,0,2,0,60 ;trigger instr. 2 for 40s

endin

;******************************************************

; partikkel instr

;******************************************************

instr 2


;*******************************

; setup of source waveforms

; (needs to be done first, because grain pitch and time pointer depends on
source waveform lengths)

;*******************************


; select source waveforms

kwaveform1 = giStruglKor ; source audio waveform 1

kwave1Single = 0 ; flag to set if waveform is single cycle (set to zero for
sampled waveforms)

kwaveform2 = giStruglKor ; source audio waveform 2

kwave2Single = 0 ; flag to set if waveform is single cycle (set to zero for
sampled waveforms)

kwaveform3 = giStruglKor ; source audio waveform 3

kwave3Single = 0 ; flag to set if waveform is single cycle (set to zero for
sampled waveforms)

kwaveform4 = giStruglKor ; source audio waveform 4

kwave4Single = 0 ; flag to set if waveform is single cycle (set to zero for
sampled waveforms)


; get source waveform length (used when calculating transposition and time
pointer)

kfilen1 tableng kwaveform1 ; get length of the first source waveform

kfilen2 tableng kwaveform2 ; same as above, for source waveform 2

kfilen3 tableng kwaveform3 ; same as above, for source waveform 3

kfilen4 tableng kwaveform4 ; same as above, for source waveform 4

kfildur1 = kfilen1 / sr ; length in seconds, for the first source waveform

kfildur2 = kfilen2 / sr ; same as above, for source waveform 2

kfildur3 = kfilen3 / sr ; same as above, for source waveform 3

kfildur4 = kfilen4 / sr ; same as above, for source waveform 4


; original pitch for each waveform, use if they should be transposed
individually

; can also be used as a "cycles per second" parameter for single cycle
waveforms (assuming that the kwavfreq parameter has a value of 1.0)

kwavekey1 = 1

kwavekey2 = 1

kwavekey3 = 1

kwavekey4 = 1


; set original key dependant on waveform length (only for sampled waveforms,
not for single cycle waves)

kwavekey1 = (kwave1Single > 0 ? kwavekey1 : kwavekey1/kfildur1)

kwavekey2 = (kwave2Single > 0 ? kwavekey2 : kwavekey2/kfildur2)

kwavekey3 = (kwave3Single > 0 ? kwavekey3 : kwavekey3/kfildur3)

kwavekey4 = (kwave4Single > 0 ? kwavekey4 : kwavekey4/kfildur4)


; time pointer (phase). This can be independent for each source waveform.

isamplepos1 = 0 ; initial phase for wave source 1

isamplepos2 = 0 ; initial phase for wave source 2

isamplepos3 = 0 ; initial phase for wave source 3

isamplepos4 = 0 ; initial phase for wave source 4


kTimeRate invalue "time" ; time pointer rate

asamplepos1 phasor kTimeRate / kfildur1 ; phasor from 0 to 1, scaled to the
length of the first source waveform

asamplepos2 phasor kTimeRate / kfildur2 ; same as above, scaled for source
wave 2

asamplepos3 phasor kTimeRate / kfildur3 ; same as above, scaled for source
wave 3

asamplepos4 phasor kTimeRate / kfildur4 ; same as above, scaled for source
wave 4


; mix initial phase and moving phase value (moving phase only for sampled
waveforms, single cycle waveforms use static samplepos)

asamplepos1 = asamplepos1*(1-kwave1Single) + isamplepos1

asamplepos2 = asamplepos2*(1-kwave2Single) + isamplepos2

asamplepos3 = asamplepos3*(1-kwave3Single) + isamplepos3

asamplepos4 = asamplepos4*(1-kwave4Single) + isamplepos4


;*******************************

; other granular synthesis parameters

;*******************************


; amplitude

kamp = ampdbfs(-3) ; output amplitude


; sync

async = 0.0 ; set the sync input to zero (disable external sync)


; grain rate

kGrainRate invalue "rate" ; number of grains per second


; grain rate FM

kGrFmFreq = kGrainRate/4 ; FM freq for modulating the grainrate

kGrFmIndex = 0.0 ; FM index for modulating the grainrate (normally kept in a
0.0 to 1.0 range)

iGrFmWave = giSine ; FM waveform, for modulating the grainrate

aGrFmSig oscil kGrFmIndex, kGrFmFreq, iGrFmWave ; audio signal for frequency
modulation of grain rate

agrainrate = kGrainRate + (aGrFmSig*kGrainRate) ; add the modulator signal to
the grain rate signal


; distribution

kdistribution = 0.0 ; grain random distribution in time

idisttab ftgentmp 0, 0, 16, 16, 1, 16, -10, 0 ; probability distribution for
random grain masking


; grain shape

kGrainDur = 2.5 ; length of each grain relative to grain rate

kduration = (kGrainDur*1000)/kGrainRate ; grain dur in milliseconds, relative
to grain rate


ienv_attack = giSigmoRise ; grain attack shape (from table)

ienv_decay = giSigmoFall ; grain decay shape (from table)

ksustain_amount = 0.0 ; balance between enveloped time(attack+decay) and
sustain level time, 0.0 = no time at sustain level

ka_d_ratio = 0.5 ; balance between attack time and decay time, 0.0 = zero
attack time and full decay time


kenv2amt = 0.0 ; amount of secondary enveloping per grain (e.g. for fof
synthesis)

ienv2tab = giExpFall ; secondary grain shape (from table), enveloping the
whole grain if used


; grain pitch (transpose, or "playback speed")

kwavfreq = 1 ; transposition factor (playback speed) of audio inside grains,


; pitch sweep

ksweepshape = 0.5 ; grain wave pitch sweep shape (sweep speed), 0.5 is linear
sweep

iwavfreqstarttab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; start freq scalers, per
grain

iwavfreqendtab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; end freq scalers, per grain


; FM of grain pitch (playback speed)

kPtchFmFreq = 440 ; FM freq, modulating waveform pitch

kPtchFmIndex = 0 ; FM index, modulating waveform pitch

iPtchFmWave = giSine ; FM waveform, modulating waveform pitch

ifmamptab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; FM index scalers, per grain

ifmenv = giTriangleWin ; FM index envelope, over each grain (from table)

kPtchFmIndex = kPtchFmIndex + (kPtchFmIndex*kPtchFmFreq*0.00001) ; FM index
scaling formula

awavfm oscil kPtchFmIndex, kPtchFmFreq, iPtchFmWave ; Modulator signal for
frequency modulation inside grain


; trainlet parameters

icosine = giCosine ; needs to be a cosine wave to create trainlets

kTrainCps = kGrainRate ; set cps equal to grain freq, creating a single cycle
of a trainlet inside each grain

knumpartials = 7 ; number of partials in trainlet

kchroma = 3 ; chroma, falloff of partial amplitude towards sr/2


; masking

; gain masking table, amplitude for individual grains

igainmasks ftgentmp 0, 0, 16, -2, 0, 0, 1


; channel masking table, output routing for individual grains (zero based, a
value of 0.0 routes to output 1)

ichannelmasks ftgentmp 0, 0, 16, -2, 0, 0, 0.5

; random masking (muting) of individual grains

krandommask = 0


; wave mix masking.

; Set gain per source waveform per grain,

; in groups of 5 amp values, reflecting source1, source2, source3, source4,
and the 5th slot is for trainlet amplitude.

iwaveamptab ftgentmp 0, 0, 32, -2, 0, 0, 1,0,0,0,0


; system parameter

imax_grains = 100 ; max number of grains per k-period


;***********



a1,a2,a3,a4,a5,a6,a7,a8 partikkel agrainrate, kdistribution, idisttab, async,
kenv2amt, ienv2tab, \

ienv_attack, ienv_decay, ksustain_amount, ka_d_ratio, kduration, kamp,
igainmasks, \

kwavfreq, ksweepshape, iwavfreqstarttab, iwavfreqendtab, awavfm, \

ifmamptab, ifmenv, icosine, kTrainCps, knumpartials, \

kchroma, ichannelmasks, krandommask, kwaveform1, kwaveform2, kwaveform3,
kwaveform4, \

iwaveamptab, asamplepos1, asamplepos2, asamplepos3, asamplepos4, \

kwavekey1, kwavekey2, kwavekey3, kwavekey4, imax_grains


outs a1, a2

endin

; load audio files

giStruglKor ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile


; classic waveforms

giSine ftgen 0, 0, 65537, 10, 1 ; sine wave

giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave

giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave


; grain envelope tables

giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid

giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid

giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay

giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window


instr 3 ; triggers instrument 4

ktrigger metro 0.1 ;metronome of triggers. One every 12.5s

schedkwhen ktrigger,0,0,4,0,60 ;trigger instr. 2 for 40s

endin

;******************************************************

; partikkel instr

;******************************************************

instr 4


;*******************************

; setup of source waveforms

; (needs to be done first, because grain pitch and time pointer depends on
source waveform lengths)

;*******************************


; select source waveforms

kwaveform1 = giStruglKor ; source audio waveform 1

kwave1Single = 0 ; flag to set if waveform is single cycle (set to zero for
sampled waveforms)

kwaveform2 = giStruglKor ; source audio waveform 2

kwave2Single = 0 ; flag to set if waveform is single cycle (set to zero for
sampled waveforms)

kwaveform3 = giStruglKor ; source audio waveform 3

kwave3Single = 0 ; flag to set if waveform is single cycle (set to zero for
sampled waveforms)

kwaveform4 = giStruglKor ; source audio waveform 4

kwave4Single = 0 ; flag to set if waveform is single cycle (set to zero for
sampled waveforms)


; get source waveform length (used when calculating transposition and time
pointer)

kfilen1 tableng kwaveform1 ; get length of the first source waveform

kfilen2 tableng kwaveform2 ; same as above, for source waveform 2

kfilen3 tableng kwaveform3 ; same as above, for source waveform 3

kfilen4 tableng kwaveform4 ; same as above, for source waveform 4

kfildur1 = kfilen1 / sr ; length in seconds, for the first source waveform

kfildur2 = kfilen2 / sr ; same as above, for source waveform 2

kfildur3 = kfilen3 / sr ; same as above, for source waveform 3

kfildur4 = kfilen4 / sr ; same as above, for source waveform 4


; original pitch for each waveform, use if they should be transposed
individually

; can also be used as a "cycles per second" parameter for single cycle
waveforms (assuming that the kwavfreq parameter has a value of 1.0)

kwavekey1 = 1

kwavekey2 = 1

kwavekey3 = 1

kwavekey4 = 1


; set original key dependant on waveform length (only for sampled waveforms,
not for single cycle waves)

kwavekey1 = (kwave1Single > 0 ? kwavekey1 : kwavekey1/kfildur1)

kwavekey2 = (kwave2Single > 0 ? kwavekey2 : kwavekey2/kfildur2)

kwavekey3 = (kwave3Single > 0 ? kwavekey3 : kwavekey3/kfildur3)

kwavekey4 = (kwave4Single > 0 ? kwavekey4 : kwavekey4/kfildur4)


; time pointer (phase). This can be independent for each source waveform.

isamplepos1 = 0 ; initial phase for wave source 1

isamplepos2 = 0 ; initial phase for wave source 2

isamplepos3 = 0 ; initial phase for wave source 3

isamplepos4 = 0 ; initial phase for wave source 4


kTimeRate invalue "time" ; time pointer rate

asamplepos1 phasor kTimeRate / kfildur1 ; phasor from 0 to 1, scaled to the
length of the first source waveform

asamplepos2 phasor kTimeRate / kfildur2 ; same as above, scaled for source
wave 2

asamplepos3 phasor kTimeRate / kfildur3 ; same as above, scaled for source
wave 3

asamplepos4 phasor kTimeRate / kfildur4 ; same as above, scaled for source
wave 4


; mix initial phase and moving phase value (moving phase only for sampled
waveforms, single cycle waveforms use static samplepos)

asamplepos1 = asamplepos1*(1-kwave1Single) + isamplepos1

asamplepos2 = asamplepos2*(1-kwave2Single) + isamplepos2

asamplepos3 = asamplepos3*(1-kwave3Single) + isamplepos3

asamplepos4 = asamplepos4*(1-kwave4Single) + isamplepos4


;*******************************

; other granular synthesis parameters

;*******************************


; amplitude

kamp = ampdbfs(-3) ; output amplitude


; sync

async = 0.0 ; set the sync input to zero (disable external sync)


; grain rate

kGrainRate invalue "rate" ; number of grains per second


; grain rate FM

kGrFmFreq = kGrainRate/4 ; FM freq for modulating the grainrate

kGrFmIndex = 0.0 ; FM index for modulating the grainrate (normally kept in a
0.0 to 1.0 range)

iGrFmWave = giSine ; FM waveform, for modulating the grainrate

aGrFmSig oscil kGrFmIndex, kGrFmFreq, iGrFmWave ; audio signal for frequency
modulation of grain rate

agrainrate = kGrainRate + (aGrFmSig*kGrainRate) ; add the modulator signal to
the grain rate signal


; distribution

kdistribution = 0.0 ; grain random distribution in time

idisttab ftgentmp 0, 0, 16, 16, 1, 16, -10, 0 ; probability distribution for
random grain masking


; grain shape

kGrainDur = 2.5 ; length of each grain relative to grain rate

kduration = (kGrainDur*1000)/kGrainRate ; grain dur in milliseconds, relative
to grain rate


ienv_attack = giSigmoRise ; grain attack shape (from table)

ienv_decay = giSigmoFall ; grain decay shape (from table)

ksustain_amount = 0.0 ; balance between enveloped time(attack+decay) and
sustain level time, 0.0 = no time at sustain level

ka_d_ratio = 0.5 ; balance between attack time and decay time, 0.0 = zero
attack time and full decay time


kenv2amt = 0.0 ; amount of secondary enveloping per grain (e.g. for fof
synthesis)

ienv2tab = giExpFall ; secondary grain shape (from table), enveloping the
whole grain if used


; grain pitch (transpose, or "playback speed")

kwavfreq = 1 ; transposition factor (playback speed) of audio inside grains,


; pitch sweep

ksweepshape = 0.5 ; grain wave pitch sweep shape (sweep speed), 0.5 is linear
sweep

iwavfreqstarttab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; start freq scalers, per
grain

iwavfreqendtab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; end freq scalers, per grain


; FM of grain pitch (playback speed)

kPtchFmFreq = 440 ; FM freq, modulating waveform pitch

kPtchFmIndex = 0 ; FM index, modulating waveform pitch

iPtchFmWave = giSine ; FM waveform, modulating waveform pitch

ifmamptab ftgentmp 0, 0, 16, -2, 0, 0, 1 ; FM index scalers, per grain

ifmenv = giTriangleWin ; FM index envelope, over each grain (from table)

kPtchFmIndex = kPtchFmIndex + (kPtchFmIndex*kPtchFmFreq*0.00001) ; FM index
scaling formula

awavfm oscil kPtchFmIndex, kPtchFmFreq, iPtchFmWave ; Modulator signal for
frequency modulation inside grain


; trainlet parameters

icosine = giCosine ; needs to be a cosine wave to create trainlets

kTrainCps = kGrainRate ; set cps equal to grain freq, creating a single cycle
of a trainlet inside each grain

knumpartials = 7 ; number of partials in trainlet

kchroma = 3 ; chroma, falloff of partial amplitude towards sr/2


; masking

; gain masking table, amplitude for individual grains

igainmasks ftgentmp 0, 0, 16, -2, 0, 0, 1


; channel masking table, output routing for individual grains (zero based, a
value of 0.0 routes to output 1)

ichannelmasks ftgentmp 0, 0, 16, -2, 0, 0, 0.5

; random masking (muting) of individual grains

krandommask = 0


; wave mix masking.

; Set gain per source waveform per grain,

; in groups of 5 amp values, reflecting source1, source2, source3, source4,
and the 5th slot is for trainlet amplitude.

iwaveamptab ftgentmp 0, 0, 32, -2, 0, 0, 1,0,0,0,0


; system parameter

imax_grains = 100 ; max number of grains per k-period


;***********



a1,a2,a3,a4,a5,a6,a7,a8 partikkel agrainrate, kdistribution, idisttab, async,
kenv2amt, ienv2tab, \

ienv_attack, ienv_decay, ksustain_amount, ka_d_ratio, kduration, kamp,
igainmasks, \

kwavfreq, ksweepshape, iwavfreqstarttab, iwavfreqendtab, awavfm, \

ifmamptab, ifmenv, icosine, kTrainCps, knumpartials, \

kchroma, ichannelmasks, krandommask, kwaveform1, kwaveform2, kwaveform3,
kwaveform4, \

iwaveamptab, asamplepos1, asamplepos2, asamplepos3, asamplepos4, \

kwavekey1, kwavekey2, kwavekey3, kwavekey4, imax_grains


outs a1, a2

endin


;******************************************************


</CsInstruments>

<CsScore>


; start dur

i1 0 60

i2 0 60

i3 0 60

i4 0 60

</CsScore>


</CsoundSynthesizer>



I'm sure I have neglected something basic, any help would be appreciated.


Also, I would like the instances to use different outs.......how would I go
about that?


Forgive me again if these are very basic questions.


Thanks in advance,


Tarek



Csound mailing list [hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features can
be posted here


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

jpff
Reading your csd file I think you ave a major misunderstanding.  Your
instr 0 is split which is odd -- never seen that before.  More importantly
I see

giStruglKor ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile
....
giStruglKor ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile

so the first is useless as it is overwritten

If you want to replace then it needs to be in another instrument.

All lines not in a named/numbered instr are instr 0 and are executed at
start up time.

Not sure if that is clear?  The error message seems wrong though - will
investigate

==John ff

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

jpff
PS:  could you send me a copy of the csd file witout line wrappound  I
cannot use what yo sent and it woud take the rest of the day to sort out

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

bubget
Thanks so much again...to be honest, I´m a bit lost...I´m a novice programmer and haven´t touched csound for months...I really appreciate your help...



On 11 February 2017 at 22:29, jpff <[hidden email]> wrote:
PS:  could you send me a copy of the csd file witout line wrappound  I cannot use what yo sent and it woud take the rest of the day to sort out


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

1_partikkel_basic_time.edit.csd (26K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

jpff
Thanks.  My csound is in pieces at pesent but I can compile it OK and get
a couple of divide by zeros before my bust system stops.

I guess you are using Windows and possibly csoundQt, neiter of which I ave
so not sure I can help much tonigt.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

bubget

Yes, correct on both counts..

I really appreciate your effort..

If any others could chime in, that would gladly be appreciated too

On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
Thanks.  My csound is in pieces at pesent but I can compile it OK and get a couple of divide by zeros before my bust system stops.

I guess you are using Windows and possibly csoundQt, neiter of which I ave so not sure I can help much tonigt.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

Oeyvind Brandtsegg-3
Hi,

As John said, you have the global statements (instr 0) both at the
beginning and also interspersed in between intrument definitions. You
should keep all global statements in one place, before other instr
definitions. Also, you are repeating the same global statements, which
in effect will overwrite. The error you get might be related to trying
to load another sound file of another size into the same table, or it
might be related to the global statement coming in between instrument
definitions. So, to clean up. Keep only the first global statements,
but add another sound file load

; load audio files
giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile

; classic waveforms
giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave

; grain envelope tables
giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window

Then, you also define the partikkel instr (identical as far as I can
see) twice, as instr 2 and instr 4. These are triggered by (also
identical) instr 1 and 3. It would be better to keep only one of these
two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
a different sound file. For example like this:
kwaveform1 = p4 ; source audio waveform 1
(and similarly for kwaveform2, 3 and 4 on the following lines)

Then you would rewrite instr 1

instr 1 ; triggers instrument 2
ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
schedkwhen ktrigger,0,0,2,0,60, giSound1
schedkwhen ktrigger,0,0,2,0,60, giSound2
endin

I might have overlooked something, and I did not test run the code,
but the general idea should be ok to solve what I think you try to do.

best
Oeyvind

2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:

> Yes, correct on both counts..
>
> I really appreciate your effort..
>
> If any others could chime in, that would gladly be appreciated too
>
> On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>>
>> Thanks.  My csound is in pieces at pesent but I can compile it OK and get
>> a couple of divide by zeros before my bust system stops.
>>
>> I guess you are using Windows and possibly csoundQt, neiter of which I ave
>> so not sure I can help much tonigt.
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

bubget

Ok, thanks so much! I'll try it out when I get home...let me know please if you get an opportunity to run the test code.

Much appreciated again..

On 12 Feb 2017 07:11, "Oeyvind Brandtsegg" <[hidden email]> wrote:
Hi,

As John said, you have the global statements (instr 0) both at the
beginning and also interspersed in between intrument definitions. You
should keep all global statements in one place, before other instr
definitions. Also, you are repeating the same global statements, which
in effect will overwrite. The error you get might be related to trying
to load another sound file of another size into the same table, or it
might be related to the global statement coming in between instrument
definitions. So, to clean up. Keep only the first global statements,
but add another sound file load

; load audio files
giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile

; classic waveforms
giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave

; grain envelope tables
giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window

Then, you also define the partikkel instr (identical as far as I can
see) twice, as instr 2 and instr 4. These are triggered by (also
identical) instr 1 and 3. It would be better to keep only one of these
two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
a different sound file. For example like this:
kwaveform1 = p4 ; source audio waveform 1
(and similarly for kwaveform2, 3 and 4 on the following lines)

Then you would rewrite instr 1

instr 1 ; triggers instrument 2
ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
schedkwhen ktrigger,0,0,2,0,60, giSound1
schedkwhen ktrigger,0,0,2,0,60, giSound2
endin

I might have overlooked something, and I did not test run the code,
but the general idea should be ok to solve what I think you try to do.

best
Oeyvind

2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
> Yes, correct on both counts..
>
> I really appreciate your effort..
>
> If any others could chime in, that would gladly be appreciated too
>
> On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>>
>> Thanks.  My csound is in pieces at pesent but I can compile it OK and get
>> a couple of divide by zeros before my bust system stops.
>>
>> I guess you are using Windows and possibly csoundQt, neiter of which I ave
>> so not sure I can help much tonigt.
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

Michael Gogins-2
In reply to this post by Oeyvind Brandtsegg-3
I think it's ok to intersperse global statements, I do it all the time for global variables. 

Regards, 
Mike

On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg" <[hidden email]> wrote:
Hi,

As John said, you have the global statements (instr 0) both at the
beginning and also interspersed in between intrument definitions. You
should keep all global statements in one place, before other instr
definitions. Also, you are repeating the same global statements, which
in effect will overwrite. The error you get might be related to trying
to load another sound file of another size into the same table, or it
might be related to the global statement coming in between instrument
definitions. So, to clean up. Keep only the first global statements,
but add another sound file load

; load audio files
giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile

; classic waveforms
giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave

; grain envelope tables
giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window

Then, you also define the partikkel instr (identical as far as I can
see) twice, as instr 2 and instr 4. These are triggered by (also
identical) instr 1 and 3. It would be better to keep only one of these
two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
a different sound file. For example like this:
kwaveform1 = p4 ; source audio waveform 1
(and similarly for kwaveform2, 3 and 4 on the following lines)

Then you would rewrite instr 1

instr 1 ; triggers instrument 2
ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
schedkwhen ktrigger,0,0,2,0,60, giSound1
schedkwhen ktrigger,0,0,2,0,60, giSound2
endin

I might have overlooked something, and I did not test run the code,
but the general idea should be ok to solve what I think you try to do.

best
Oeyvind

2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
> Yes, correct on both counts..
>
> I really appreciate your effort..
>
> If any others could chime in, that would gladly be appreciated too
>
> On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>>
>> Thanks.  My csound is in pieces at pesent but I can compile it OK and get
>> a couple of divide by zeros before my bust system stops.
>>
>> I guess you are using Windows and possibly csoundQt, neiter of which I ave
>> so not sure I can help much tonigt.
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

Victor Lazzarini
yes, that's perfectly ok. 

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 12 Feb 2017, at 13:48, Michael Gogins <[hidden email]> wrote:

I think it's ok to intersperse global statements, I do it all the time for global variables. 

Regards, 
Mike

On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg" <[hidden email]> wrote:
Hi,

As John said, you have the global statements (instr 0) both at the
beginning and also interspersed in between intrument definitions. You
should keep all global statements in one place, before other instr
definitions. Also, you are repeating the same global statements, which
in effect will overwrite. The error you get might be related to trying
to load another sound file of another size into the same table, or it
might be related to the global statement coming in between instrument
definitions. So, to clean up. Keep only the first global statements,
but add another sound file load

; load audio files
giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile

; classic waveforms
giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave

; grain envelope tables
giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window

Then, you also define the partikkel instr (identical as far as I can
see) twice, as instr 2 and instr 4. These are triggered by (also
identical) instr 1 and 3. It would be better to keep only one of these
two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
a different sound file. For example like this:
kwaveform1 = p4 ; source audio waveform 1
(and similarly for kwaveform2, 3 and 4 on the following lines)

Then you would rewrite instr 1

instr 1 ; triggers instrument 2
ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
schedkwhen ktrigger,0,0,2,0,60, giSound1
schedkwhen ktrigger,0,0,2,0,60, giSound2
endin

I might have overlooked something, and I did not test run the code,
but the general idea should be ok to solve what I think you try to do.

best
Oeyvind

2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
> Yes, correct on both counts..
>
> I really appreciate your effort..
>
> If any others could chime in, that would gladly be appreciated too
>
> On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>>
>> Thanks.  My csound is in pieces at pesent but I can compile it OK and get
>> a couple of divide by zeros before my bust system stops.
>>
>> I guess you are using Windows and possibly csoundQt, neiter of which I ave
>> so not sure I can help much tonigt.
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: <a href="tel:%2B47%2092%20203%20205" value="&#43;4792203205">+47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

bubget
Ok...so, I tried your advice.

Now, no error message comes up...however, it simply doesn´t play.

I´m sure I didn´t code the p-field part right..

On 12 February 2017 at 15:57, Victor Lazzarini <[hidden email]> wrote:
yes, that's perfectly ok. 

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 12 Feb 2017, at 13:48, Michael Gogins <[hidden email]> wrote:

I think it's ok to intersperse global statements, I do it all the time for global variables. 

Regards, 
Mike

On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg" <[hidden email]> wrote:
Hi,

As John said, you have the global statements (instr 0) both at the
beginning and also interspersed in between intrument definitions. You
should keep all global statements in one place, before other instr
definitions. Also, you are repeating the same global statements, which
in effect will overwrite. The error you get might be related to trying
to load another sound file of another size into the same table, or it
might be related to the global statement coming in between instrument
definitions. So, to clean up. Keep only the first global statements,
but add another sound file load

; load audio files
giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile

; classic waveforms
giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave

; grain envelope tables
giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window

Then, you also define the partikkel instr (identical as far as I can
see) twice, as instr 2 and instr 4. These are triggered by (also
identical) instr 1 and 3. It would be better to keep only one of these
two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
a different sound file. For example like this:
kwaveform1 = p4 ; source audio waveform 1
(and similarly for kwaveform2, 3 and 4 on the following lines)

Then you would rewrite instr 1

instr 1 ; triggers instrument 2
ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
schedkwhen ktrigger,0,0,2,0,60, giSound1
schedkwhen ktrigger,0,0,2,0,60, giSound2
endin

I might have overlooked something, and I did not test run the code,
but the general idea should be ok to solve what I think you try to do.

best
Oeyvind

2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
> Yes, correct on both counts..
>
> I really appreciate your effort..
>
> If any others could chime in, that would gladly be appreciated too
>
> On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>>
>> Thanks.  My csound is in pieces at pesent but I can compile it OK and get
>> a couple of divide by zeros before my bust system stops.
>>
>> I guess you are using Windows and possibly csoundQt, neiter of which I ave
>> so not sure I can help much tonigt.
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

1_partikkel_basic_time6.csd (18K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

bubget
Thanks for everyone's input

On 12 February 2017 at 21:51, T Lopez <[hidden email]> wrote:
Ok...so, I tried your advice.

Now, no error message comes up...however, it simply doesn´t play.

I´m sure I didn´t code the p-field part right..

On 12 February 2017 at 15:57, Victor Lazzarini <[hidden email]> wrote:
yes, that's perfectly ok. 

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 12 Feb 2017, at 13:48, Michael Gogins <[hidden email]> wrote:

I think it's ok to intersperse global statements, I do it all the time for global variables. 

Regards, 
Mike

On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg" <[hidden email]> wrote:
Hi,

As John said, you have the global statements (instr 0) both at the
beginning and also interspersed in between intrument definitions. You
should keep all global statements in one place, before other instr
definitions. Also, you are repeating the same global statements, which
in effect will overwrite. The error you get might be related to trying
to load another sound file of another size into the same table, or it
might be related to the global statement coming in between instrument
definitions. So, to clean up. Keep only the first global statements,
but add another sound file load

; load audio files
giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile

; classic waveforms
giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave

; grain envelope tables
giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular window

Then, you also define the partikkel instr (identical as far as I can
see) twice, as instr 2 and instr 4. These are triggered by (also
identical) instr 1 and 3. It would be better to keep only one of these
two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
a different sound file. For example like this:
kwaveform1 = p4 ; source audio waveform 1
(and similarly for kwaveform2, 3 and 4 on the following lines)

Then you would rewrite instr 1

instr 1 ; triggers instrument 2
ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
schedkwhen ktrigger,0,0,2,0,60, giSound1
schedkwhen ktrigger,0,0,2,0,60, giSound2
endin

I might have overlooked something, and I did not test run the code,
but the general idea should be ok to solve what I think you try to do.

best
Oeyvind

2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
> Yes, correct on both counts..
>
> I really appreciate your effort..
>
> If any others could chime in, that would gladly be appreciated too
>
> On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>>
>> Thanks.  My csound is in pieces at pesent but I can compile it OK and get
>> a couple of divide by zeros before my bust system stops.
>>
>> I guess you are using Windows and possibly csoundQt, neiter of which I ave
>> so not sure I can help much tonigt.
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

Oeyvind Brandtsegg-3
In reply to this post by bubget
Hi T,
There was some issues, related to the p-fields and sound files assignment.
I also changed the invalues to static values. You can change it back
for time rate, grain rate and wavfreq. The invalue you had used for
grain size was not used (the variable namke is kGrainDur later in the
instr), and also the variable "icent" was used in a way that does not
do what I think you want from it. You also started instr 2 both from
the score and from schedkwhen, but I assume you only mean to start it
from the schedkwhen in instr 1 (and since instr 1 is started from
score you have all control there).
Now it makes sound, and perhaps you can go on editing from this
version. My local sound file names are used as input, so you should
replace with appropriate sound files.
best
Oeyvind

2017-02-12 12:51 GMT-08:00 T Lopez <[hidden email]>:

> Ok...so, I tried your advice.
>
> Now, no error message comes up...however, it simply doesn´t play.
>
> I´m sure I didn´t code the p-field part right..
>
> On 12 February 2017 at 15:57, Victor Lazzarini <[hidden email]>
> wrote:
>>
>> yes, that's perfectly ok.
>>
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>>
>> On 12 Feb 2017, at 13:48, Michael Gogins <[hidden email]> wrote:
>>
>> I think it's ok to intersperse global statements, I do it all the time for
>> global variables.
>>
>> Regards,
>> Mike
>>
>> On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg" <[hidden email]>
>> wrote:
>>>
>>> Hi,
>>>
>>> As John said, you have the global statements (instr 0) both at the
>>> beginning and also interspersed in between intrument definitions. You
>>> should keep all global statements in one place, before other instr
>>> definitions. Also, you are repeating the same global statements, which
>>> in effect will overwrite. The error you get might be related to trying
>>> to load another sound file of another size into the same table, or it
>>> might be related to the global statement coming in between instrument
>>> definitions. So, to clean up. Keep only the first global statements,
>>> but add another sound file load
>>>
>>> ; load audio files
>>> giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
>>> giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile
>>>
>>> ; classic waveforms
>>> giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
>>> giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
>>> giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave
>>>
>>> ; grain envelope tables
>>> giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
>>> giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
>>> giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
>>> giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular
>>> window
>>>
>>> Then, you also define the partikkel instr (identical as far as I can
>>> see) twice, as instr 2 and instr 4. These are triggered by (also
>>> identical) instr 1 and 3. It would be better to keep only one of these
>>> two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
>>> a different sound file. For example like this:
>>> kwaveform1 = p4 ; source audio waveform 1
>>> (and similarly for kwaveform2, 3 and 4 on the following lines)
>>>
>>> Then you would rewrite instr 1
>>>
>>> instr 1 ; triggers instrument 2
>>> ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
>>> schedkwhen ktrigger,0,0,2,0,60, giSound1
>>> schedkwhen ktrigger,0,0,2,0,60, giSound2
>>> endin
>>>
>>> I might have overlooked something, and I did not test run the code,
>>> but the general idea should be ok to solve what I think you try to do.
>>>
>>> best
>>> Oeyvind
>>>
>>> 2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
>>> > Yes, correct on both counts..
>>> >
>>> > I really appreciate your effort..
>>> >
>>> > If any others could chime in, that would gladly be appreciated too
>>> >
>>> > On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>>> >>
>>> >> Thanks.  My csound is in pieces at pesent but I can compile it OK and
>>> >> get
>>> >> a couple of divide by zeros before my bust system stops.
>>> >>
>>> >> I guess you are using Windows and possibly csoundQt, neiter of which I
>>> >> ave
>>> >> so not sure I can help much tonigt.
>>> >>
>>> >> Csound mailing list
>>> >> [hidden email]
>>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> >> Send bugs reports to
>>> >>        https://github.com/csound/csound/issues
>>> >> Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list [hidden email]
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>> > https://github.com/csound/csound/issues Discussions of bugs and
>>> > features can
>>> > be posted here
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here


--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Oeyv_1_partikkel_basic_time60.csd (18K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

bubget
It works indeed,thanks so much!! You are the best..

Two questions if you would be so kind..

1. Why does simply using p4 suffice to use both soundfiles? As you saw, I had changed it to p5, thinking it needed to refer to the second file..

2. How can I control the variables for both soundfiles individually? i.e. timerate, kgraindur and so on..

Thanks again,

Tarek

On 13 February 2017 at 07:38, Oeyvind Brandtsegg <[hidden email]> wrote:
Hi T,
There was some issues, related to the p-fields and sound files assignment.
I also changed the invalues to static values. You can change it back
for time rate, grain rate and wavfreq. The invalue you had used for
grain size was not used (the variable namke is kGrainDur later in the
instr), and also the variable "icent" was used in a way that does not
do what I think you want from it. You also started instr 2 both from
the score and from schedkwhen, but I assume you only mean to start it
from the schedkwhen in instr 1 (and since instr 1 is started from
score you have all control there).
Now it makes sound, and perhaps you can go on editing from this
version. My local sound file names are used as input, so you should
replace with appropriate sound files.
best
Oeyvind

2017-02-12 12:51 GMT-08:00 T Lopez <[hidden email]>:
> Ok...so, I tried your advice.
>
> Now, no error message comes up...however, it simply doesn´t play.
>
> I´m sure I didn´t code the p-field part right..
>
> On 12 February 2017 at 15:57, Victor Lazzarini <[hidden email]>
> wrote:
>>
>> yes, that's perfectly ok.
>>
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>>
>> On 12 Feb 2017, at 13:48, Michael Gogins <[hidden email]> wrote:
>>
>> I think it's ok to intersperse global statements, I do it all the time for
>> global variables.
>>
>> Regards,
>> Mike
>>
>> On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg" <[hidden email]>
>> wrote:
>>>
>>> Hi,
>>>
>>> As John said, you have the global statements (instr 0) both at the
>>> beginning and also interspersed in between intrument definitions. You
>>> should keep all global statements in one place, before other instr
>>> definitions. Also, you are repeating the same global statements, which
>>> in effect will overwrite. The error you get might be related to trying
>>> to load another sound file of another size into the same table, or it
>>> might be related to the global statement coming in between instrument
>>> definitions. So, to clean up. Keep only the first global statements,
>>> but add another sound file load
>>>
>>> ; load audio files
>>> giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
>>> giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile
>>>
>>> ; classic waveforms
>>> giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
>>> giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
>>> giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle wave
>>>
>>> ; grain envelope tables
>>> giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
>>> giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
>>> giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
>>> giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular
>>> window
>>>
>>> Then, you also define the partikkel instr (identical as far as I can
>>> see) twice, as instr 2 and instr 4. These are triggered by (also
>>> identical) instr 1 and 3. It would be better to keep only one of these
>>> two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
>>> a different sound file. For example like this:
>>> kwaveform1 = p4 ; source audio waveform 1
>>> (and similarly for kwaveform2, 3 and 4 on the following lines)
>>>
>>> Then you would rewrite instr 1
>>>
>>> instr 1 ; triggers instrument 2
>>> ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
>>> schedkwhen ktrigger,0,0,2,0,60, giSound1
>>> schedkwhen ktrigger,0,0,2,0,60, giSound2
>>> endin
>>>
>>> I might have overlooked something, and I did not test run the code,
>>> but the general idea should be ok to solve what I think you try to do.
>>>
>>> best
>>> Oeyvind
>>>
>>> 2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
>>> > Yes, correct on both counts..
>>> >
>>> > I really appreciate your effort..
>>> >
>>> > If any others could chime in, that would gladly be appreciated too
>>> >
>>> > On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>>> >>
>>> >> Thanks.  My csound is in pieces at pesent but I can compile it OK and
>>> >> get
>>> >> a couple of divide by zeros before my bust system stops.
>>> >>
>>> >> I guess you are using Windows and possibly csoundQt, neiter of which I
>>> >> ave
>>> >> so not sure I can help much tonigt.
>>> >>
>>> >> Csound mailing list
>>> >> [hidden email]
>>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> >> Send bugs reports to
>>> >>        https://github.com/csound/csound/issues
>>> >> Discussions of bugs and features can be posted here
>>> >
>>> > Csound mailing list [hidden email]
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>> > https://github.com/csound/csound/issues Discussions of bugs and
>>> > features can
>>> > be posted here
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>>
>> Csound mailing list [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and features can
>> be posted here
>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

Oeyvind Brandtsegg-3
All good.

1. The way we run it here, we have *one* partikkel instrument, but we
run 2 instances of it. Each instance uses its own sound file as the
source for grains. The selection of sound file is done with p4. Since
each instance of the instrument uses only one sound file, we only need
one p-field to set it. This way you can go on building more complex
layering with even more source sounds wihtout the instrument code
becoming significantly more complex.

2. This could be done several way. Perhaps the easiest would be to use
an extra p-field to set the "control channel" for each instrument
instance. Then you would set up several parallel input channels to
control each "channel". Something like:

icontrolchannel = p5
igrainrate1   invalue "rate1"
igrainrate2   invalue "rate2"
if icontrolchannel == 1 then
igrainrate = igrainrate1
else
igrainrate = igrainrate2
endif

Just wanted to mention one thing it in case you did not think of it.
You've set the grainrate as an i-rate parameter, but you could also
control it at k-rate. If you set it as an i-rate parm, then the grain
rate will be the same throughout the whole instrument event (40
seconds in your case). This might be cool, as new instances of the
instrument might overlap, and they would get the new i-rate grain rate
when they start. But, if you want faster response from the grain rate
control, you might also try using it at k-rate. Both ways are just as
valid, but will produce very different sounding results.

all best
Oeyvind

2017-02-13 4:09 GMT-08:00 T Lopez <[hidden email]>:

> It works indeed,thanks so much!! You are the best..
>
> Two questions if you would be so kind..
>
> 1. Why does simply using p4 suffice to use both soundfiles? As you saw, I
> had changed it to p5, thinking it needed to refer to the second file..
>
> 2. How can I control the variables for both soundfiles individually? i.e.
> timerate, kgraindur and so on..
>
> Thanks again,
>
> Tarek
>
> On 13 February 2017 at 07:38, Oeyvind Brandtsegg <[hidden email]>
> wrote:
>>
>> Hi T,
>> There was some issues, related to the p-fields and sound files assignment.
>> I also changed the invalues to static values. You can change it back
>> for time rate, grain rate and wavfreq. The invalue you had used for
>> grain size was not used (the variable namke is kGrainDur later in the
>> instr), and also the variable "icent" was used in a way that does not
>> do what I think you want from it. You also started instr 2 both from
>> the score and from schedkwhen, but I assume you only mean to start it
>> from the schedkwhen in instr 1 (and since instr 1 is started from
>> score you have all control there).
>> Now it makes sound, and perhaps you can go on editing from this
>> version. My local sound file names are used as input, so you should
>> replace with appropriate sound files.
>> best
>> Oeyvind
>>
>> 2017-02-12 12:51 GMT-08:00 T Lopez <[hidden email]>:
>> > Ok...so, I tried your advice.
>> >
>> > Now, no error message comes up...however, it simply doesn´t play.
>> >
>> > I´m sure I didn´t code the p-field part right..
>> >
>> > On 12 February 2017 at 15:57, Victor Lazzarini
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> yes, that's perfectly ok.
>> >>
>> >> Victor Lazzarini
>> >> Dean of Arts, Celtic Studies, and Philosophy
>> >> Maynooth University
>> >> Ireland
>> >>
>> >> On 12 Feb 2017, at 13:48, Michael Gogins <[hidden email]>
>> >> wrote:
>> >>
>> >> I think it's ok to intersperse global statements, I do it all the time
>> >> for
>> >> global variables.
>> >>
>> >> Regards,
>> >> Mike
>> >>
>> >> On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg"
>> >> <[hidden email]>
>> >> wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> As John said, you have the global statements (instr 0) both at the
>> >>> beginning and also interspersed in between intrument definitions. You
>> >>> should keep all global statements in one place, before other instr
>> >>> definitions. Also, you are repeating the same global statements, which
>> >>> in effect will overwrite. The error you get might be related to trying
>> >>> to load another sound file of another size into the same table, or it
>> >>> might be related to the global statement coming in between instrument
>> >>> definitions. So, to clean up. Keep only the first global statements,
>> >>> but add another sound file load
>> >>>
>> >>> ; load audio files
>> >>> giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
>> >>> giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile
>> >>>
>> >>> ; classic waveforms
>> >>> giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
>> >>> giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
>> >>> giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle
>> >>> wave
>> >>>
>> >>> ; grain envelope tables
>> >>> giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
>> >>> giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
>> >>> giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
>> >>> giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular
>> >>> window
>> >>>
>> >>> Then, you also define the partikkel instr (identical as far as I can
>> >>> see) twice, as instr 2 and instr 4. These are triggered by (also
>> >>> identical) instr 1 and 3. It would be better to keep only one of these
>> >>> two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
>> >>> a different sound file. For example like this:
>> >>> kwaveform1 = p4 ; source audio waveform 1
>> >>> (and similarly for kwaveform2, 3 and 4 on the following lines)
>> >>>
>> >>> Then you would rewrite instr 1
>> >>>
>> >>> instr 1 ; triggers instrument 2
>> >>> ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
>> >>> schedkwhen ktrigger,0,0,2,0,60, giSound1
>> >>> schedkwhen ktrigger,0,0,2,0,60, giSound2
>> >>> endin
>> >>>
>> >>> I might have overlooked something, and I did not test run the code,
>> >>> but the general idea should be ok to solve what I think you try to do.
>> >>>
>> >>> best
>> >>> Oeyvind
>> >>>
>> >>> 2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
>> >>> > Yes, correct on both counts..
>> >>> >
>> >>> > I really appreciate your effort..
>> >>> >
>> >>> > If any others could chime in, that would gladly be appreciated too
>> >>> >
>> >>> > On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>> >>> >>
>> >>> >> Thanks.  My csound is in pieces at pesent but I can compile it OK
>> >>> >> and
>> >>> >> get
>> >>> >> a couple of divide by zeros before my bust system stops.
>> >>> >>
>> >>> >> I guess you are using Windows and possibly csoundQt, neiter of
>> >>> >> which I
>> >>> >> ave
>> >>> >> so not sure I can help much tonigt.
>> >>> >>
>> >>> >> Csound mailing list
>> >>> >> [hidden email]
>> >>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> >> Send bugs reports to
>> >>> >>        https://github.com/csound/csound/issues
>> >>> >> Discussions of bugs and features can be posted here
>> >>> >
>> >>> > Csound mailing list [hidden email]
>> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> > https://github.com/csound/csound/issues Discussions of bugs and
>> >>> > features can
>> >>> > be posted here
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>>
>> >>> Oeyvind Brandtsegg
>> >>> Professor of Music Technology
>> >>> NTNU
>> >>> 7491 Trondheim
>> >>> Norway
>> >>> Cell: +47 92 203 205
>> >>>
>> >>> http://www.partikkelaudio.com/
>> >>> http://crossadaptive.hf.ntnu.no
>> >>> http://gdsp.hf.ntnu.no/
>> >>> http://soundcloud.com/brandtsegg
>> >>> http://flyndresang.no/
>> >>> http://soundcloud.com/t-emp
>> >>>
>> >>> Csound mailing list
>> >>> [hidden email]
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> Send bugs reports to
>> >>>         https://github.com/csound/csound/issues
>> >>> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >
>> >
>> > Csound mailing list [hidden email]
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

bubget

Excellent and thorough answer, thanks a million, will try it out when I get home.

On 13 Feb 2017 17:37, "Oeyvind Brandtsegg" <[hidden email]> wrote:
All good.

1. The way we run it here, we have *one* partikkel instrument, but we
run 2 instances of it. Each instance uses its own sound file as the
source for grains. The selection of sound file is done with p4. Since
each instance of the instrument uses only one sound file, we only need
one p-field to set it. This way you can go on building more complex
layering with even more source sounds wihtout the instrument code
becoming significantly more complex.

2. This could be done several way. Perhaps the easiest would be to use
an extra p-field to set the "control channel" for each instrument
instance. Then you would set up several parallel input channels to
control each "channel". Something like:

icontrolchannel = p5
igrainrate1   invalue "rate1"
igrainrate2   invalue "rate2"
if icontrolchannel == 1 then
igrainrate = igrainrate1
else
igrainrate = igrainrate2
endif

Just wanted to mention one thing it in case you did not think of it.
You've set the grainrate as an i-rate parameter, but you could also
control it at k-rate. If you set it as an i-rate parm, then the grain
rate will be the same throughout the whole instrument event (40
seconds in your case). This might be cool, as new instances of the
instrument might overlap, and they would get the new i-rate grain rate
when they start. But, if you want faster response from the grain rate
control, you might also try using it at k-rate. Both ways are just as
valid, but will produce very different sounding results.

all best
Oeyvind

2017-02-13 4:09 GMT-08:00 T Lopez <[hidden email]>:
> It works indeed,thanks so much!! You are the best..
>
> Two questions if you would be so kind..
>
> 1. Why does simply using p4 suffice to use both soundfiles? As you saw, I
> had changed it to p5, thinking it needed to refer to the second file..
>
> 2. How can I control the variables for both soundfiles individually? i.e.
> timerate, kgraindur and so on..
>
> Thanks again,
>
> Tarek
>
> On 13 February 2017 at 07:38, Oeyvind Brandtsegg <[hidden email]>
> wrote:
>>
>> Hi T,
>> There was some issues, related to the p-fields and sound files assignment.
>> I also changed the invalues to static values. You can change it back
>> for time rate, grain rate and wavfreq. The invalue you had used for
>> grain size was not used (the variable namke is kGrainDur later in the
>> instr), and also the variable "icent" was used in a way that does not
>> do what I think you want from it. You also started instr 2 both from
>> the score and from schedkwhen, but I assume you only mean to start it
>> from the schedkwhen in instr 1 (and since instr 1 is started from
>> score you have all control there).
>> Now it makes sound, and perhaps you can go on editing from this
>> version. My local sound file names are used as input, so you should
>> replace with appropriate sound files.
>> best
>> Oeyvind
>>
>> 2017-02-12 12:51 GMT-08:00 T Lopez <[hidden email]>:
>> > Ok...so, I tried your advice.
>> >
>> > Now, no error message comes up...however, it simply doesn´t play.
>> >
>> > I´m sure I didn´t code the p-field part right..
>> >
>> > On 12 February 2017 at 15:57, Victor Lazzarini
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> yes, that's perfectly ok.
>> >>
>> >> Victor Lazzarini
>> >> Dean of Arts, Celtic Studies, and Philosophy
>> >> Maynooth University
>> >> Ireland
>> >>
>> >> On 12 Feb 2017, at 13:48, Michael Gogins <[hidden email]>
>> >> wrote:
>> >>
>> >> I think it's ok to intersperse global statements, I do it all the time
>> >> for
>> >> global variables.
>> >>
>> >> Regards,
>> >> Mike
>> >>
>> >> On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg"
>> >> <[hidden email]>
>> >> wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> As John said, you have the global statements (instr 0) both at the
>> >>> beginning and also interspersed in between intrument definitions. You
>> >>> should keep all global statements in one place, before other instr
>> >>> definitions. Also, you are repeating the same global statements, which
>> >>> in effect will overwrite. The error you get might be related to trying
>> >>> to load another sound file of another size into the same table, or it
>> >>> might be related to the global statement coming in between instrument
>> >>> definitions. So, to clean up. Keep only the first global statements,
>> >>> but add another sound file load
>> >>>
>> >>> ; load audio files
>> >>> giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
>> >>> giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile
>> >>>
>> >>> ; classic waveforms
>> >>> giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
>> >>> giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
>> >>> giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle
>> >>> wave
>> >>>
>> >>> ; grain envelope tables
>> >>> giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
>> >>> giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
>> >>> giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
>> >>> giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular
>> >>> window
>> >>>
>> >>> Then, you also define the partikkel instr (identical as far as I can
>> >>> see) twice, as instr 2 and instr 4. These are triggered by (also
>> >>> identical) instr 1 and 3. It would be better to keep only one of these
>> >>> two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
>> >>> a different sound file. For example like this:
>> >>> kwaveform1 = p4 ; source audio waveform 1
>> >>> (and similarly for kwaveform2, 3 and 4 on the following lines)
>> >>>
>> >>> Then you would rewrite instr 1
>> >>>
>> >>> instr 1 ; triggers instrument 2
>> >>> ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
>> >>> schedkwhen ktrigger,0,0,2,0,60, giSound1
>> >>> schedkwhen ktrigger,0,0,2,0,60, giSound2
>> >>> endin
>> >>>
>> >>> I might have overlooked something, and I did not test run the code,
>> >>> but the general idea should be ok to solve what I think you try to do.
>> >>>
>> >>> best
>> >>> Oeyvind
>> >>>
>> >>> 2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
>> >>> > Yes, correct on both counts..
>> >>> >
>> >>> > I really appreciate your effort..
>> >>> >
>> >>> > If any others could chime in, that would gladly be appreciated too
>> >>> >
>> >>> > On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>> >>> >>
>> >>> >> Thanks.  My csound is in pieces at pesent but I can compile it OK
>> >>> >> and
>> >>> >> get
>> >>> >> a couple of divide by zeros before my bust system stops.
>> >>> >>
>> >>> >> I guess you are using Windows and possibly csoundQt, neiter of
>> >>> >> which I
>> >>> >> ave
>> >>> >> so not sure I can help much tonigt.
>> >>> >>
>> >>> >> Csound mailing list
>> >>> >> [hidden email]
>> >>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> >> Send bugs reports to
>> >>> >>        https://github.com/csound/csound/issues
>> >>> >> Discussions of bugs and features can be posted here
>> >>> >
>> >>> > Csound mailing list [hidden email]
>> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> > https://github.com/csound/csound/issues Discussions of bugs and
>> >>> > features can
>> >>> > be posted here
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>>
>> >>> Oeyvind Brandtsegg
>> >>> Professor of Music Technology
>> >>> NTNU
>> >>> 7491 Trondheim
>> >>> Norway
>> >>> Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+47 92 203 205
>> >>>
>> >>> http://www.partikkelaudio.com/
>> >>> http://crossadaptive.hf.ntnu.no
>> >>> http://gdsp.hf.ntnu.no/
>> >>> http://soundcloud.com/brandtsegg
>> >>> http://flyndresang.no/
>> >>> http://soundcloud.com/t-emp
>> >>>
>> >>> Csound mailing list
>> >>> [hidden email]
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> Send bugs reports to
>> >>>         https://github.com/csound/csound/issues
>> >>> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >
>> >
>> > Csound mailing list [hidden email]
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

bubget

Okk...soo, everything works perfectly...

2 more questions if you would be so kind.

1) could all of the i-variables in partikkel be changed to k-variables?

2) this I think may be impossible...how would one put, for example, a low pass filter on one instance/waveform and a high pass on another? Is this even doable?

Thanks a million again.

Tarek

On 13 Feb 2017 20:39, "T Lopez" <[hidden email]> wrote:

Excellent and thorough answer, thanks a million, will try it out when I get home.

On 13 Feb 2017 17:37, "Oeyvind Brandtsegg" <[hidden email]> wrote:
All good.

1. The way we run it here, we have *one* partikkel instrument, but we
run 2 instances of it. Each instance uses its own sound file as the
source for grains. The selection of sound file is done with p4. Since
each instance of the instrument uses only one sound file, we only need
one p-field to set it. This way you can go on building more complex
layering with even more source sounds wihtout the instrument code
becoming significantly more complex.

2. This could be done several way. Perhaps the easiest would be to use
an extra p-field to set the "control channel" for each instrument
instance. Then you would set up several parallel input channels to
control each "channel". Something like:

icontrolchannel = p5
igrainrate1   invalue "rate1"
igrainrate2   invalue "rate2"
if icontrolchannel == 1 then
igrainrate = igrainrate1
else
igrainrate = igrainrate2
endif

Just wanted to mention one thing it in case you did not think of it.
You've set the grainrate as an i-rate parameter, but you could also
control it at k-rate. If you set it as an i-rate parm, then the grain
rate will be the same throughout the whole instrument event (40
seconds in your case). This might be cool, as new instances of the
instrument might overlap, and they would get the new i-rate grain rate
when they start. But, if you want faster response from the grain rate
control, you might also try using it at k-rate. Both ways are just as
valid, but will produce very different sounding results.

all best
Oeyvind

2017-02-13 4:09 GMT-08:00 T Lopez <[hidden email]>:
> It works indeed,thanks so much!! You are the best..
>
> Two questions if you would be so kind..
>
> 1. Why does simply using p4 suffice to use both soundfiles? As you saw, I
> had changed it to p5, thinking it needed to refer to the second file..
>
> 2. How can I control the variables for both soundfiles individually? i.e.
> timerate, kgraindur and so on..
>
> Thanks again,
>
> Tarek
>
> On 13 February 2017 at 07:38, Oeyvind Brandtsegg <[hidden email]>
> wrote:
>>
>> Hi T,
>> There was some issues, related to the p-fields and sound files assignment.
>> I also changed the invalues to static values. You can change it back
>> for time rate, grain rate and wavfreq. The invalue you had used for
>> grain size was not used (the variable namke is kGrainDur later in the
>> instr), and also the variable "icent" was used in a way that does not
>> do what I think you want from it. You also started instr 2 both from
>> the score and from schedkwhen, but I assume you only mean to start it
>> from the schedkwhen in instr 1 (and since instr 1 is started from
>> score you have all control there).
>> Now it makes sound, and perhaps you can go on editing from this
>> version. My local sound file names are used as input, so you should
>> replace with appropriate sound files.
>> best
>> Oeyvind
>>
>> 2017-02-12 12:51 GMT-08:00 T Lopez <[hidden email]>:
>> > Ok...so, I tried your advice.
>> >
>> > Now, no error message comes up...however, it simply doesn´t play.
>> >
>> > I´m sure I didn´t code the p-field part right..
>> >
>> > On 12 February 2017 at 15:57, Victor Lazzarini
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> yes, that's perfectly ok.
>> >>
>> >> Victor Lazzarini
>> >> Dean of Arts, Celtic Studies, and Philosophy
>> >> Maynooth University
>> >> Ireland
>> >>
>> >> On 12 Feb 2017, at 13:48, Michael Gogins <[hidden email]>
>> >> wrote:
>> >>
>> >> I think it's ok to intersperse global statements, I do it all the time
>> >> for
>> >> global variables.
>> >>
>> >> Regards,
>> >> Mike
>> >>
>> >> On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg"
>> >> <[hidden email]>
>> >> wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> As John said, you have the global statements (instr 0) both at the
>> >>> beginning and also interspersed in between intrument definitions. You
>> >>> should keep all global statements in one place, before other instr
>> >>> definitions. Also, you are repeating the same global statements, which
>> >>> in effect will overwrite. The error you get might be related to trying
>> >>> to load another sound file of another size into the same table, or it
>> >>> might be related to the global statement coming in between instrument
>> >>> definitions. So, to clean up. Keep only the first global statements,
>> >>> but add another sound file load
>> >>>
>> >>> ; load audio files
>> >>> giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
>> >>> giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile
>> >>>
>> >>> ; classic waveforms
>> >>> giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
>> >>> giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
>> >>> giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ; triangle
>> >>> wave
>> >>>
>> >>> ; grain envelope tables
>> >>> giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
>> >>> giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
>> >>> giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential decay
>> >>> giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ; triangular
>> >>> window
>> >>>
>> >>> Then, you also define the partikkel instr (identical as far as I can
>> >>> see) twice, as instr 2 and instr 4. These are triggered by (also
>> >>> identical) instr 1 and 3. It would be better to keep only one of these
>> >>> two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2 use
>> >>> a different sound file. For example like this:
>> >>> kwaveform1 = p4 ; source audio waveform 1
>> >>> (and similarly for kwaveform2, 3 and 4 on the following lines)
>> >>>
>> >>> Then you would rewrite instr 1
>> >>>
>> >>> instr 1 ; triggers instrument 2
>> >>> ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
>> >>> schedkwhen ktrigger,0,0,2,0,60, giSound1
>> >>> schedkwhen ktrigger,0,0,2,0,60, giSound2
>> >>> endin
>> >>>
>> >>> I might have overlooked something, and I did not test run the code,
>> >>> but the general idea should be ok to solve what I think you try to do.
>> >>>
>> >>> best
>> >>> Oeyvind
>> >>>
>> >>> 2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
>> >>> > Yes, correct on both counts..
>> >>> >
>> >>> > I really appreciate your effort..
>> >>> >
>> >>> > If any others could chime in, that would gladly be appreciated too
>> >>> >
>> >>> > On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>> >>> >>
>> >>> >> Thanks.  My csound is in pieces at pesent but I can compile it OK
>> >>> >> and
>> >>> >> get
>> >>> >> a couple of divide by zeros before my bust system stops.
>> >>> >>
>> >>> >> I guess you are using Windows and possibly csoundQt, neiter of
>> >>> >> which I
>> >>> >> ave
>> >>> >> so not sure I can help much tonigt.
>> >>> >>
>> >>> >> Csound mailing list
>> >>> >> [hidden email]
>> >>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> >> Send bugs reports to
>> >>> >>        https://github.com/csound/csound/issues
>> >>> >> Discussions of bugs and features can be posted here
>> >>> >
>> >>> > Csound mailing list [hidden email]
>> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >>> > https://github.com/csound/csound/issues Discussions of bugs and
>> >>> > features can
>> >>> > be posted here
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>>
>> >>> Oeyvind Brandtsegg
>> >>> Professor of Music Technology
>> >>> NTNU
>> >>> 7491 Trondheim
>> >>> Norway
>> >>> Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205
>> >>>
>> >>> http://www.partikkelaudio.com/
>> >>> http://crossadaptive.hf.ntnu.no
>> >>> http://gdsp.hf.ntnu.no/
>> >>> http://soundcloud.com/brandtsegg
>> >>> http://flyndresang.no/
>> >>> http://soundcloud.com/t-emp
>> >>>
>> >>> Csound mailing list
>> >>> [hidden email]
>> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>> Send bugs reports to
>> >>>         https://github.com/csound/csound/issues
>> >>> Discussions of bugs and features can be posted here
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >>
>> >> Csound mailing list [hidden email]
>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> >> https://github.com/csound/csound/issues Discussions of bugs and
>> >> features can
>> >> be posted here
>> >
>> >
>> > Csound mailing list [hidden email]
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> > https://github.com/csound/csound/issues Discussions of bugs and features
>> > can
>> > be posted here
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] 2 instances of Partikkel

Oeyvind Brandtsegg-3
Hi,
most of the partikkel parameters are k-rate, and many are a-rate (for
example grain rate is actually a-rate, this is to enable (audio)
frequency modulation of the grain rate). Regarding 2), I'm not sure if
you refer to my solution of using separate control channels for each
instance or if you ask something else? (separate types/selections of
audio post processing after sound generation). But, that would also be
possible using a similar approach. You could for example have a
lowpass and a highpass filter set up in series, and then, depending on
the cutoff frequency you could crossfade to an unfiltered version of
the signal (e.g. true bypass of the hipass filter iff the cutoff freq
is below 50 or something). Then, you would need to set up gui controls
for as many separate instances as you want and assign the control
channel numbers as appropriate. It will not be tidy once you get past
a few control parameters and a few separate instances, but indeed
possible.

2017-02-14 8:38 GMT-08:00 T Lopez <[hidden email]>:

> Okk...soo, everything works perfectly...
>
> 2 more questions if you would be so kind.
>
> 1) could all of the i-variables in partikkel be changed to k-variables?
>
> 2) this I think may be impossible...how would one put, for example, a low
> pass filter on one instance/waveform and a high pass on another? Is this
> even doable?
>
> Thanks a million again.
>
> Tarek
>
> On 13 Feb 2017 20:39, "T Lopez" <[hidden email]> wrote:
>>
>> Excellent and thorough answer, thanks a million, will try it out when I
>> get home.
>>
>> On 13 Feb 2017 17:37, "Oeyvind Brandtsegg" <[hidden email]>
>> wrote:
>>>
>>> All good.
>>>
>>> 1. The way we run it here, we have *one* partikkel instrument, but we
>>> run 2 instances of it. Each instance uses its own sound file as the
>>> source for grains. The selection of sound file is done with p4. Since
>>> each instance of the instrument uses only one sound file, we only need
>>> one p-field to set it. This way you can go on building more complex
>>> layering with even more source sounds wihtout the instrument code
>>> becoming significantly more complex.
>>>
>>> 2. This could be done several way. Perhaps the easiest would be to use
>>> an extra p-field to set the "control channel" for each instrument
>>> instance. Then you would set up several parallel input channels to
>>> control each "channel". Something like:
>>>
>>> icontrolchannel = p5
>>> igrainrate1   invalue "rate1"
>>> igrainrate2   invalue "rate2"
>>> if icontrolchannel == 1 then
>>> igrainrate = igrainrate1
>>> else
>>> igrainrate = igrainrate2
>>> endif
>>>
>>> Just wanted to mention one thing it in case you did not think of it.
>>> You've set the grainrate as an i-rate parameter, but you could also
>>> control it at k-rate. If you set it as an i-rate parm, then the grain
>>> rate will be the same throughout the whole instrument event (40
>>> seconds in your case). This might be cool, as new instances of the
>>> instrument might overlap, and they would get the new i-rate grain rate
>>> when they start. But, if you want faster response from the grain rate
>>> control, you might also try using it at k-rate. Both ways are just as
>>> valid, but will produce very different sounding results.
>>>
>>> all best
>>> Oeyvind
>>>
>>> 2017-02-13 4:09 GMT-08:00 T Lopez <[hidden email]>:
>>> > It works indeed,thanks so much!! You are the best..
>>> >
>>> > Two questions if you would be so kind..
>>> >
>>> > 1. Why does simply using p4 suffice to use both soundfiles? As you saw,
>>> > I
>>> > had changed it to p5, thinking it needed to refer to the second file..
>>> >
>>> > 2. How can I control the variables for both soundfiles individually?
>>> > i.e.
>>> > timerate, kgraindur and so on..
>>> >
>>> > Thanks again,
>>> >
>>> > Tarek
>>> >
>>> > On 13 February 2017 at 07:38, Oeyvind Brandtsegg
>>> > <[hidden email]>
>>> > wrote:
>>> >>
>>> >> Hi T,
>>> >> There was some issues, related to the p-fields and sound files
>>> >> assignment.
>>> >> I also changed the invalues to static values. You can change it back
>>> >> for time rate, grain rate and wavfreq. The invalue you had used for
>>> >> grain size was not used (the variable namke is kGrainDur later in the
>>> >> instr), and also the variable "icent" was used in a way that does not
>>> >> do what I think you want from it. You also started instr 2 both from
>>> >> the score and from schedkwhen, but I assume you only mean to start it
>>> >> from the schedkwhen in instr 1 (and since instr 1 is started from
>>> >> score you have all control there).
>>> >> Now it makes sound, and perhaps you can go on editing from this
>>> >> version. My local sound file names are used as input, so you should
>>> >> replace with appropriate sound files.
>>> >> best
>>> >> Oeyvind
>>> >>
>>> >> 2017-02-12 12:51 GMT-08:00 T Lopez <[hidden email]>:
>>> >> > Ok...so, I tried your advice.
>>> >> >
>>> >> > Now, no error message comes up...however, it simply doesn´t play.
>>> >> >
>>> >> > I´m sure I didn´t code the p-field part right..
>>> >> >
>>> >> > On 12 February 2017 at 15:57, Victor Lazzarini
>>> >> > <[hidden email]>
>>> >> > wrote:
>>> >> >>
>>> >> >> yes, that's perfectly ok.
>>> >> >>
>>> >> >> Victor Lazzarini
>>> >> >> Dean of Arts, Celtic Studies, and Philosophy
>>> >> >> Maynooth University
>>> >> >> Ireland
>>> >> >>
>>> >> >> On 12 Feb 2017, at 13:48, Michael Gogins <[hidden email]>
>>> >> >> wrote:
>>> >> >>
>>> >> >> I think it's ok to intersperse global statements, I do it all the
>>> >> >> time
>>> >> >> for
>>> >> >> global variables.
>>> >> >>
>>> >> >> Regards,
>>> >> >> Mike
>>> >> >>
>>> >> >> On Feb 12, 2017 1:11 AM, "Oeyvind Brandtsegg"
>>> >> >> <[hidden email]>
>>> >> >> wrote:
>>> >> >>>
>>> >> >>> Hi,
>>> >> >>>
>>> >> >>> As John said, you have the global statements (instr 0) both at the
>>> >> >>> beginning and also interspersed in between intrument definitions.
>>> >> >>> You
>>> >> >>> should keep all global statements in one place, before other instr
>>> >> >>> definitions. Also, you are repeating the same global statements,
>>> >> >>> which
>>> >> >>> in effect will overwrite. The error you get might be related to
>>> >> >>> trying
>>> >> >>> to load another sound file of another size into the same table, or
>>> >> >>> it
>>> >> >>> might be related to the global statement coming in between
>>> >> >>> instrument
>>> >> >>> definitions. So, to clean up. Keep only the first global
>>> >> >>> statements,
>>> >> >>> but add another sound file load
>>> >> >>>
>>> >> >>> ; load audio files
>>> >> >>> giSound1 ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 0 ; soundfile
>>> >> >>> giSound2 ftgen 0, 0, 0, 1, "stairwell.wav", 0, 0, 0 ; soundfile
>>> >> >>>
>>> >> >>> ; classic waveforms
>>> >> >>> giSine ftgen 0, 0, 65537, 10, 1 ; sine wave
>>> >> >>> giCosine ftgen 0, 0, 8193, 9, 1, 1, 90 ; cosine wave
>>> >> >>> giTri ftgen 0, 0, 8193, 7, 0, 2048, 1, 4096, -1, 2048, 0 ;
>>> >> >>> triangle
>>> >> >>> wave
>>> >> >>>
>>> >> >>> ; grain envelope tables
>>> >> >>> giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1 ; rising sigmoid
>>> >> >>> giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1 ; falling sigmoid
>>> >> >>> giExpFall ftgen 0, 0, 8193, 5, 1, 8193, 0.00001 ; exponential
>>> >> >>> decay
>>> >> >>> giTriangleWin ftgen 0, 0, 8193, 7, 0, 4096, 1, 4096, 0 ;
>>> >> >>> triangular
>>> >> >>> window
>>> >> >>>
>>> >> >>> Then, you also define the partikkel instr (identical as far as I
>>> >> >>> can
>>> >> >>> see) twice, as instr 2 and instr 4. These are triggered by (also
>>> >> >>> identical) instr 1 and 3. It would be better to keep only one of
>>> >> >>> these
>>> >> >>> two (e.g. keep instr 1 and 2) and then use p-fields to let instr 2
>>> >> >>> use
>>> >> >>> a different sound file. For example like this:
>>> >> >>> kwaveform1 = p4 ; source audio waveform 1
>>> >> >>> (and similarly for kwaveform2, 3 and 4 on the following lines)
>>> >> >>>
>>> >> >>> Then you would rewrite instr 1
>>> >> >>>
>>> >> >>> instr 1 ; triggers instrument 2
>>> >> >>> ktrigger metro 0.1 ;metronome of triggers. One every 12.5s
>>> >> >>> schedkwhen ktrigger,0,0,2,0,60, giSound1
>>> >> >>> schedkwhen ktrigger,0,0,2,0,60, giSound2
>>> >> >>> endin
>>> >> >>>
>>> >> >>> I might have overlooked something, and I did not test run the
>>> >> >>> code,
>>> >> >>> but the general idea should be ok to solve what I think you try to
>>> >> >>> do.
>>> >> >>>
>>> >> >>> best
>>> >> >>> Oeyvind
>>> >> >>>
>>> >> >>> 2017-02-11 14:41 GMT-08:00 T Lopez <[hidden email]>:
>>> >> >>> > Yes, correct on both counts..
>>> >> >>> >
>>> >> >>> > I really appreciate your effort..
>>> >> >>> >
>>> >> >>> > If any others could chime in, that would gladly be appreciated
>>> >> >>> > too
>>> >> >>> >
>>> >> >>> > On 11 Feb 2017 22:52, "jpff" <[hidden email]> wrote:
>>> >> >>> >>
>>> >> >>> >> Thanks.  My csound is in pieces at pesent but I can compile it
>>> >> >>> >> OK
>>> >> >>> >> and
>>> >> >>> >> get
>>> >> >>> >> a couple of divide by zeros before my bust system stops.
>>> >> >>> >>
>>> >> >>> >> I guess you are using Windows and possibly csoundQt, neiter of
>>> >> >>> >> which I
>>> >> >>> >> ave
>>> >> >>> >> so not sure I can help much tonigt.
>>> >> >>> >>
>>> >> >>> >> Csound mailing list
>>> >> >>> >> [hidden email]
>>> >> >>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> >> >>> >> Send bugs reports to
>>> >> >>> >>        https://github.com/csound/csound/issues
>>> >> >>> >> Discussions of bugs and features can be posted here
>>> >> >>> >
>>> >> >>> > Csound mailing list [hidden email]
>>> >> >>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>> >> >>> > reports to
>>> >> >>> > https://github.com/csound/csound/issues Discussions of bugs and
>>> >> >>> > features can
>>> >> >>> > be posted here
>>> >> >>>
>>> >> >>>
>>> >> >>>
>>> >> >>> --
>>> >> >>>
>>> >> >>> Oeyvind Brandtsegg
>>> >> >>> Professor of Music Technology
>>> >> >>> NTNU
>>> >> >>> 7491 Trondheim
>>> >> >>> Norway
>>> >> >>> Cell: +47 92 203 205
>>> >> >>>
>>> >> >>> http://www.partikkelaudio.com/
>>> >> >>> http://crossadaptive.hf.ntnu.no
>>> >> >>> http://gdsp.hf.ntnu.no/
>>> >> >>> http://soundcloud.com/brandtsegg
>>> >> >>> http://flyndresang.no/
>>> >> >>> http://soundcloud.com/t-emp
>>> >> >>>
>>> >> >>> Csound mailing list
>>> >> >>> [hidden email]
>>> >> >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> >> >>> Send bugs reports to
>>> >> >>>         https://github.com/csound/csound/issues
>>> >> >>> Discussions of bugs and features can be posted here
>>> >> >>
>>> >> >> Csound mailing list [hidden email]
>>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>>> >> >> to
>>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>>> >> >> features can
>>> >> >> be posted here
>>> >> >>
>>> >> >> Csound mailing list [hidden email]
>>> >> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>>> >> >> to
>>> >> >> https://github.com/csound/csound/issues Discussions of bugs and
>>> >> >> features can
>>> >> >> be posted here
>>> >> >
>>> >> >
>>> >> > Csound mailing list [hidden email]
>>> >> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>> >> > https://github.com/csound/csound/issues Discussions of bugs and
>>> >> > features
>>> >> > can
>>> >> > be posted here
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >>
>>> >> Oeyvind Brandtsegg
>>> >> Professor of Music Technology
>>> >> NTNU
>>> >> 7491 Trondheim
>>> >> Norway
>>> >> Cell: +47 92 203 205
>>> >>
>>> >> http://www.partikkelaudio.com/
>>> >> http://crossadaptive.hf.ntnu.no
>>> >> http://gdsp.hf.ntnu.no/
>>> >> http://soundcloud.com/brandtsegg
>>> >> http://flyndresang.no/
>>> >> http://soundcloud.com/t-emp
>>> >>
>>> >> Csound mailing list
>>> >> [hidden email]
>>> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> >> Send bugs reports to
>>> >>         https://github.com/csound/csound/issues
>>> >> Discussions of bugs and features can be posted here
>>> >
>>> >
>>> > Csound mailing list [hidden email]
>>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>> > https://github.com/csound/csound/issues Discussions of bugs and
>>> > features can
>>> > be posted here
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
12
Loading...