Csound Csound-dev Csound-tekno Search About

2 instances of Partikkel

Date2017-02-11 19:43
FromT Lopez
Subject2 instances of Partikkel
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 Csound@listserv.heanet.ie 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

Date2017-02-11 20:52
Fromjpff
SubjectRe: 2 instances of Partikkel
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
> 
> 
> 
> 
> 
> 
> 
> -o1_partikkel_basic.wav
> 
> 
> 
> 
> 
> 
> ;***************************************************
> 
> ; 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
> 
> 
> ;******************************************************
> 
> 
> 
> 
> 
> 
> 
> ; start dur
> 
> i1 0 60
> 
> i2 0 60
> 
> i3 0 60
> 
> i4 0 60
> 
> 
> 
> 
> 
> 
> 
> 
> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2017-02-11 21:03
FromT Lopez
SubjectRe: 2 instances of Partikkel
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 <jpff@codemist.co.uk> 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 Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-11 21:24
Fromjpff
SubjectRe: 2 instances of Partikkel
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
Csound@listserv.heanet.ie
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

Date2017-02-11 21:29
Fromjpff
SubjectRe: 2 instances of Partikkel
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
Csound@listserv.heanet.ie
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

Date2017-02-11 21:36
FromT Lopez
SubjectRe: 2 instances of Partikkel
Attachments1_partikkel_basic_time.edit.csd  
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 <jpff@codemist.co.uk> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-11 21:51
Fromjpff
SubjectRe: 2 instances of Partikkel
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
Csound@listserv.heanet.ie
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

Date2017-02-11 22:41
FromT Lopez
SubjectRe: 2 instances of Partikkel

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" <jpff@codemist.co.uk> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-12 06:11
FromOeyvind Brandtsegg
SubjectRe: 2 instances of Partikkel
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 :
> 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"  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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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


Date2017-02-12 10:45
FromT Lopez
SubjectRe: 2 instances of Partikkel

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" <oyvind.brandtsegg@ntnu.no> 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 <wstlopez@gmail.com>:
> 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" <jpff@codemist.co.uk> 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-12 13:48
FromMichael Gogins
SubjectRe: 2 instances of Partikkel
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" <oyvind.brandtsegg@ntnu.no> 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 <wstlopez@gmail.com>:
> 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" <jpff@codemist.co.uk> 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-12 14:57
FromVictor Lazzarini
SubjectRe: 2 instances of Partikkel
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 <michael.gogins@GMAIL.COM> 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" <oyvind.brandtsegg@ntnu.no> 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 <wstlopez@gmail.com>:
> 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" <jpff@codemist.co.uk> 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-12 20:51
FromT Lopez
SubjectRe: 2 instances of Partikkel
Attachments1_partikkel_basic_time6.csd  
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 <Victor.Lazzarini@nuim.ie> 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 <michael.gogins@GMAIL.COM> 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" <oyvind.brandtsegg@ntnu.no> 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 <wstlopez@gmail.com>:
> 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" <jpff@codemist.co.uk> 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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

Date2017-02-12 20:51
FromT Lopez
SubjectRe: 2 instances of Partikkel
Thanks for everyone's input

On 12 February 2017 at 21:51, T Lopez <wstlopez@gmail.com> 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 <Victor.Lazzarini@nuim.ie> 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 <michael.gogins@GMAIL.COM> 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" <oyvind.brandtsegg@ntnu.no> 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 <wstlopez@gmail.com>:
> 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" <jpff@codemist.co.uk> 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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

Date2017-02-13 06:38
FromOeyvind Brandtsegg
SubjectRe: 2 instances of Partikkel
AttachmentsOeyv_1_partikkel_basic_time60.csd  
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 :
> 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 
> 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  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" 
>> 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 :
>>> > 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"  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
>>> >> Csound@listserv.heanet.ie
>>> >> 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 Csound@listserv.heanet.ie
>>> > 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
>>> Csound@listserv.heanet.ie
>>> 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 Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2017-02-13 12:09
FromT Lopez
SubjectRe: 2 instances of Partikkel
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 <oyvind.brandtsegg@ntnu.no> 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 <wstlopez@gmail.com>:
> 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 <Victor.Lazzarini@nuim.ie>
> 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 <michael.gogins@GMAIL.COM> 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" <oyvind.brandtsegg@ntnu.no>
>> 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 <wstlopez@gmail.com>:
>>> > 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" <jpff@codemist.co.uk> 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
>>> >> Csound@listserv.heanet.ie
>>> >> 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 Csound@listserv.heanet.ie
>>> > 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
>>> Csound@listserv.heanet.ie
>>> 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 Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-13 16:36
FromOeyvind Brandtsegg
SubjectRe: 2 instances of Partikkel
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 :
> 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 
> 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 :
>> > 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
>> > 
>> > 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 
>> >> 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"
>> >> 
>> >> 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 :
>> >>> > 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"  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
>> >>> >> Csound@listserv.heanet.ie
>> >>> >> 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 Csound@listserv.heanet.ie
>> >>> > 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
>> >>> Csound@listserv.heanet.ie
>> >>> 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 Csound@listserv.heanet.ie
>> >> 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 Csound@listserv.heanet.ie
>> >> 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 Csound@listserv.heanet.ie
>> > 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2017-02-13 19:39
FromT Lopez
SubjectRe: 2 instances of Partikkel

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

On 13 Feb 2017 17:37, "Oeyvind Brandtsegg" <oyvind.brandtsegg@ntnu.no> 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 <wstlopez@gmail.com>:
> 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 <oyvind.brandtsegg@ntnu.no>
> 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 <wstlopez@gmail.com>:
>> > 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
>> > <Victor.Lazzarini@nuim.ie>
>> > 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 <michael.gogins@GMAIL.COM>
>> >> 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"
>> >> <oyvind.brandtsegg@ntnu.no>
>> >> 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 <wstlopez@gmail.com>:
>> >>> > 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" <jpff@codemist.co.uk> 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
>> >>> >> Csound@listserv.heanet.ie
>> >>> >> 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 Csound@listserv.heanet.ie
>> >>> > 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
>> >>> Csound@listserv.heanet.ie
>> >>> 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 Csound@listserv.heanet.ie
>> >> 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 Csound@listserv.heanet.ie
>> >> 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 Csound@listserv.heanet.ie
>> > 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-14 16:38
FromT Lopez
SubjectRe: 2 instances of Partikkel

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" <wstlopez@gmail.com> wrote:

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

On 13 Feb 2017 17:37, "Oeyvind Brandtsegg" <oyvind.brandtsegg@ntnu.no> 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 <wstlopez@gmail.com>:
> 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 <oyvind.brandtsegg@ntnu.no>
> 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 <wstlopez@gmail.com>:
>> > 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
>> > <Victor.Lazzarini@nuim.ie>
>> > 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 <michael.gogins@GMAIL.COM>
>> >> 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"
>> >> <oyvind.brandtsegg@ntnu.no>
>> >> 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 <wstlopez@gmail.com>:
>> >>> > 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" <jpff@codemist.co.uk> 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
>> >>> >> Csound@listserv.heanet.ie
>> >>> >> 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 Csound@listserv.heanet.ie
>> >>> > 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
>> >>> Csound@listserv.heanet.ie
>> >>> 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 Csound@listserv.heanet.ie
>> >> 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 Csound@listserv.heanet.ie
>> >> 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 Csound@listserv.heanet.ie
>> > 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-14 18:39
FromOeyvind Brandtsegg
SubjectRe: 2 instances of Partikkel
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 :
> 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"  wrote:
>>
>> Excellent and thorough answer, thanks a million, will try it out when I
>> get home.
>>
>> On 13 Feb 2017 17:37, "Oeyvind Brandtsegg" 
>> 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 :
>>> > 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
>>> > 
>>> > 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 :
>>> >> > 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
>>> >> > 
>>> >> > 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 
>>> >> >> 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"
>>> >> >> 
>>> >> >> 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 :
>>> >> >>> > 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"  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
>>> >> >>> >> Csound@listserv.heanet.ie
>>> >> >>> >> 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 Csound@listserv.heanet.ie
>>> >> >>> > 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
>>> >> >>> Csound@listserv.heanet.ie
>>> >> >>> 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 Csound@listserv.heanet.ie
>>> >> >> 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 Csound@listserv.heanet.ie
>>> >> >> 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 Csound@listserv.heanet.ie
>>> >> > 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
>>> >> Csound@listserv.heanet.ie
>>> >> 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 Csound@listserv.heanet.ie
>>> > 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
>>> Csound@listserv.heanet.ie
>>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2017-02-20 13:00
FromT Lopez
SubjectRe: 2 instances of Partikkel
Thanks a million again, sorry for late reply...busy days.

Yes, what I was referring to was post processing after sound generation. So, for example, sound a, would have a low pass filter and sound b, a high pass filter.

I am a bit confused as the filters would be separate instruments would they not? In the same way that the lowpass filter is implemented in my example, however, as the the (filter) instrument cannot be coded within the partikkel code itself(indeed, after), it filters both sound a and b.

Hoping you had a nice weekend:)



On 14 February 2017 at 19:39, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
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 <wstlopez@gmail.com>:
> 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" <wstlopez@gmail.com> wrote:
>>
>> Excellent and thorough answer, thanks a million, will try it out when I
>> get home.
>>
>> On 13 Feb 2017 17:37, "Oeyvind Brandtsegg" <oyvind.brandtsegg@ntnu.no>
>> 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 <wstlopez@gmail.com>:
>>> > 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
>>> > <oyvind.brandtsegg@ntnu.no>
>>> > 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 <wstlopez@gmail.com>:
>>> >> > 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
>>> >> > <Victor.Lazzarini@nuim.ie>
>>> >> > 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 <michael.gogins@GMAIL.COM>
>>> >> >> 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"
>>> >> >> <oyvind.brandtsegg@ntnu.no>
>>> >> >> 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 <wstlopez@gmail.com>:
>>> >> >>> > 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" <jpff@codemist.co.uk> 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
>>> >> >>> >> Csound@listserv.heanet.ie
>>> >> >>> >> 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 Csound@listserv.heanet.ie
>>> >> >>> > 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
>>> >> >>> Csound@listserv.heanet.ie
>>> >> >>> 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 Csound@listserv.heanet.ie
>>> >> >> 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 Csound@listserv.heanet.ie
>>> >> >> 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 Csound@listserv.heanet.ie
>>> >> > 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
>>> >> Csound@listserv.heanet.ie
>>> >> 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 Csound@listserv.heanet.ie
>>> > 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
>>> Csound@listserv.heanet.ie
>>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-02-21 23:19
FromOeyvind Brandtsegg
SubjectRe: 2 instances of Partikkel
Ok, I was initially thinking of having the efx inside the partikkel
instrument, but it is actually better to use separate efx processing
instruments as you suggest.

Here's a quick attempt, hope the variable names help explain what I
mean. Do feel free to ask if it is not clear.
And I feel like all this could be implemented much more elegantly
(however I fail to see how just now), but it should work ok like this:

(a1 is your audio output that you want to route to different efx processors)
(p5 sets the control channel, as a way to separate the different
instances, to be able to route them each differently)
(not tested code, might have typos)

icontrolchannel = p5
iefx_select1   invalue "efx1"
iefx_select2   invalue "efx2"
if icontrolchannel == 1 then
iefx_select = igrainrate1
else
iefx_select = igrainrate2
endif

if iefx_select == 1 then
chnset a1, "lowpass_send"
elif iefx_select == 2 then
chnset a1, "hipass_send"
elif iefx_select == 3 then
chnset a1, "some_other_efx_send"
else
chnset a1, "dry_out_send"
endif



2017-02-20 5:00 GMT-08:00 T Lopez :
> Thanks a million again, sorry for late reply...busy days.
>
> Yes, what I was referring to was post processing after sound generation. So,
> for example, sound a, would have a low pass filter and sound b, a high pass
> filter.
>
> I am a bit confused as the filters would be separate instruments would they
> not? In the same way that the lowpass filter is implemented in my example,
> however, as the the (filter) instrument cannot be coded within the partikkel
> code itself(indeed, after), it filters both sound a and b.
>
> Hoping you had a nice weekend:)
>
>
>
> On 14 February 2017 at 19:39, Oeyvind Brandtsegg 
> wrote:
>>
>> 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 :
>> > 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"  wrote:
>> >>
>> >> Excellent and thorough answer, thanks a million, will try it out when I
>> >> get home.
>> >>
>> >> On 13 Feb 2017 17:37, "Oeyvind Brandtsegg" 
>> >> 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 :
>> >>> > 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
>> >>> > 
>> >>> > 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 :
>> >>> >> > 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
>> >>> >> > 
>> >>> >> > 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
>> >>> >> >> 
>> >>> >> >> 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"
>> >>> >> >> 
>> >>> >> >> 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 :
>> >>> >> >>> > 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"  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
>> >>> >> >>> >> Csound@listserv.heanet.ie
>> >>> >> >>> >> 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 Csound@listserv.heanet.ie
>> >>> >> >>> > 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
>> >>> >> >>> Csound@listserv.heanet.ie
>> >>> >> >>> 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 Csound@listserv.heanet.ie
>> >>> >> >> 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 Csound@listserv.heanet.ie
>> >>> >> >> 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 Csound@listserv.heanet.ie
>> >>> >> > 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
>> >>> >> Csound@listserv.heanet.ie
>> >>> >> 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 Csound@listserv.heanet.ie
>> >>> > 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
>> >>> Csound@listserv.heanet.ie
>> >>> 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 Csound@listserv.heanet.ie
>> > 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2017-02-22 16:39
FromJohn ff
SubjectRe: 2 instances of Partikkel
Just a thought; if you used the binary decomposition of p5 you could combine different effects with ease.  We have logical and operations for that.

Sent from TypeApp
On 21 Feb 2017, at 23:21, Oeyvind Brandtsegg <oyvind.brandtsegg@NTNU.NO> wrote:
Ok, I was initially thinking of having the efx inside the partikkel
instrument, but it is actually better to use separate efx processing
instruments as you suggest.

Here's a quick attempt, hope the variable names help explain what I
mean. Do feel free to ask if it is not clear.
And I feel like all this could be implemented much more elegantly
(however I fail to see how just now), but it should work ok like this:

(a1 is your audio output that you want to route to different efx processors)
(p5 sets the control channel, as a way to separate the different
instances, to be able to route them each differently)
(not tested code, might have typos)

icontrolchannel = p5
iefx_select1 invalue "efx1"
iefx_select2 invalue "efx2"
if icontrolchannel == 1 then
iefx_select = igrainrate1
else
iefx_select = igrainrate2
endif

if iefx_select == 1 then
chnset a1, "lowpass_send"
elif iefx_select == 2 then
chnset a1, "hipass_send"
elif iefx_select == 3 then
chnset a1, "some_other_efx_send"
else
chnset a1, "dry_out_send"
endif



2017-02-20 5:00 GMT-08:00 T Lopez <wstlopez@gmail.com>:
Thanks a million again, sorry for late reply...busy days.

Yes, what I was referring to was post processing after sound generation. So,
for example, sound a, would have a low pass filter and sound b, a high pass
filter.

I am a bit confused as the filters would be separate instruments would they
not? In the same way that the lowpass filter is implemented in my example,
however, as the the (filter) instrument cannot be coded within the partikkel
code itself(indeed, after), it filters both sound a and b.

Hoping you had a nice weekend:)



On 14 February 2017 at 19:39, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no>
wrote:

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 <wstlopez@gmail.com>:
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" <wstlopez@gmail.com> wrote:

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

On 13 Feb 2017 17:37, "Oeyvind Brandtsegg" <oyvind.brandtsegg@ntnu.no>
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 <wstlopez@gmail.com>:
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
<oyvind.brandtsegg@ntnu.no>
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 <wstlopez@gmail.com>:
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
<Victor.Lazzarini@nuim.ie>
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
<michael.gogins@GMAIL.COM>
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"
<oyvind.brandtsegg@ntnu.no>
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 <wstlopez@gmail.com>:
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" <jpff@codemist.co.uk> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie
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



Date2017-02-22 20:51
FromOeyvind Brandtsegg
SubjectRe: 2 instances of Partikkel
Yes, that's a good idea.

2017-02-22 8:39 GMT-08:00 John ff :
> Just a thought; if you used the binary decomposition of p5 you could combine
> different effects with ease.  We have logical and operations for that.
>
> Sent from TypeApp
> On 21 Feb 2017, at 23:21, Oeyvind Brandtsegg 
> wrote:
>>
>> Ok, I was initially thinking of having the efx inside the partikkel
>> instrument, but it is actually better to use separate efx processing
>> instruments as you suggest.
>>
>> Here's a quick attempt, hope the variable names help explain what I
>> mean. Do feel free to ask if it is not clear.
>> And I feel like all this could be implemented much more elegantly
>> (however I fail to see how just now), but it should work ok like this:
>>
>> (a1 is your audio output that you want to route to different efx
>> processors)
>> (p5 sets the control channel, as a way to separate the different
>> instances, to be able to route them each differently)
>> (not tested code, might have typos)
>>
>> icontrolchannel = p5
>> iefx_select1   invalue "efx1"
>> iefx_select2   invalue "efx2"
>> if icontrolchannel == 1 then
>> iefx_select = igrainrate1
>> else
>> iefx_select = igrainrate2
>> endif
>>
>> if iefx_select == 1 then
>> chnset a1, "lowpass_send"
>> elif iefx_select == 2 then
>> chnset a1, "hipass_send"
>> elif iefx_select == 3 then
>> chnset a1, "some_other_efx_send"
>> else
>> chnset a1, "dry_out_send"
>> endif
>>
>>
>>
>> 2017-02-20 5:00 GMT-08:00 T Lopez :
>>>
>>>  Thanks a million again, sorry for late reply...busy days.
>>>
>>>  Yes, what I was referring to was post processing after sound generation.
>>> So,
>>>  for example, sound a, would have a low pass filter and sound b, a high
>>> pass
>>>  filter.
>>>
>>>  I am a bit confused as the filters would be separate instruments would
>>> they
>>>  not? In the same way that the lowpass filter is implemented in my
>>> example,
>>>  however, as the the (filter) instrument cannot be coded within the
>>> partikkel
>>>  code itself(indeed, after), it filters both sound a and b.
>>>
>>>  Hoping you had a nice weekend:)
>>>
>>>
>>>
>>>  On 14 February 2017 at 19:39, Oeyvind Brandtsegg
>>> 
>>>  wrote:
>>>>
>>>>
>>>>  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 :
>>>>>
>>>>>  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"  wrote:
>>>>>>
>>>>>>
>>>>>>  Excellent and thorough answer, thanks a million, will try it out when
>>>>>> I
>>>>>>  get home.
>>>>>>
>>>>>>  On 13 Feb 2017 17:37, "Oeyvind Brandtsegg"
>>>>>> 
>>>>>>  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 :
>>>>>>>>
>>>>>>>>  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
>>>>>>>>  
>>>>>>>>  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 :
>>>>>>>>>>
>>>>>>>>>>  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
>>>>>>>>>>  
>>>>>>>>>>  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
>>>>>>>>>>>  
>>>>>>>>>>>  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"
>>>>>>>>>>>  
>>>>>>>>>>>  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 :
>>>>>>>>>>>>>
>>>>>>>>>>>>>  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"  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
>>>>>>>>>>>>>>  Csound@listserv.heanet.ie
>>>>>>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>>>>>>  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
>>>>>>>>>>>>  Csound@listserv.heanet.ie
>>>>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>>>  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
>>>>>>>>>  Csound@listserv.heanet.ie
>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>  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
>>>>>>>  Csound@listserv.heanet.ie
>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>  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
>>>>  Csound@listserv.heanet.ie
>>>>  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 Csound@listserv.heanet.ie
>>>  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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2017-03-05 12:48
FromT Lopez
SubjectRe: 2 instances of Partikkel

Hi...a little late to the party on this one due to personal affairs..

Could someone be kind enough to clarify what 'binary decomposition of p5' would entail?

Thanks!

On 22 Feb 2017 21:51, "Oeyvind Brandtsegg" <oyvind.brandtsegg@ntnu.no> wrote:
Yes, that's a good idea.

2017-02-22 8:39 GMT-08:00 John ff <jpff@codemist.co.uk>:
> Just a thought; if you used the binary decomposition of p5 you could combine
> different effects with ease.  We have logical and operations for that.
>
> Sent from TypeApp
> On 21 Feb 2017, at 23:21, Oeyvind Brandtsegg <oyvind.brandtsegg@NTNU.NO>
> wrote:
>>
>> Ok, I was initially thinking of having the efx inside the partikkel
>> instrument, but it is actually better to use separate efx processing
>> instruments as you suggest.
>>
>> Here's a quick attempt, hope the variable names help explain what I
>> mean. Do feel free to ask if it is not clear.
>> And I feel like all this could be implemented much more elegantly
>> (however I fail to see how just now), but it should work ok like this:
>>
>> (a1 is your audio output that you want to route to different efx
>> processors)
>> (p5 sets the control channel, as a way to separate the different
>> instances, to be able to route them each differently)
>> (not tested code, might have typos)
>>
>> icontrolchannel = p5
>> iefx_select1   invalue "efx1"
>> iefx_select2   invalue "efx2"
>> if icontrolchannel == 1 then
>> iefx_select = igrainrate1
>> else
>> iefx_select = igrainrate2
>> endif
>>
>> if iefx_select == 1 then
>> chnset a1, "lowpass_send"
>> elif iefx_select == 2 then
>> chnset a1, "hipass_send"
>> elif iefx_select == 3 then
>> chnset a1, "some_other_efx_send"
>> else
>> chnset a1, "dry_out_send"
>> endif
>>
>>
>>
>> 2017-02-20 5:00 GMT-08:00 T Lopez <wstlopez@gmail.com>:
>>>
>>>  Thanks a million again, sorry for late reply...busy days.
>>>
>>>  Yes, what I was referring to was post processing after sound generation.
>>> So,
>>>  for example, sound a, would have a low pass filter and sound b, a high
>>> pass
>>>  filter.
>>>
>>>  I am a bit confused as the filters would be separate instruments would
>>> they
>>>  not? In the same way that the lowpass filter is implemented in my
>>> example,
>>>  however, as the the (filter) instrument cannot be coded within the
>>> partikkel
>>>  code itself(indeed, after), it filters both sound a and b.
>>>
>>>  Hoping you had a nice weekend:)
>>>
>>>
>>>
>>>  On 14 February 2017 at 19:39, Oeyvind Brandtsegg
>>> <oyvind.brandtsegg@ntnu.no>
>>>  wrote:
>>>>
>>>>
>>>>  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 <wstlopez@gmail.com>:
>>>>>
>>>>>  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" <wstlopez@gmail.com> wrote:
>>>>>>
>>>>>>
>>>>>>  Excellent and thorough answer, thanks a million, will try it out when
>>>>>> I
>>>>>>  get home.
>>>>>>
>>>>>>  On 13 Feb 2017 17:37, "Oeyvind Brandtsegg"
>>>>>> <oyvind.brandtsegg@ntnu.no>
>>>>>>  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 <wstlopez@gmail.com>:
>>>>>>>>
>>>>>>>>  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
>>>>>>>>  <oyvind.brandtsegg@ntnu.no>
>>>>>>>>  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 <wstlopez@gmail.com>:
>>>>>>>>>>
>>>>>>>>>>  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
>>>>>>>>>>  <Victor.Lazzarini@nuim.ie>
>>>>>>>>>>  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
>>>>>>>>>>>  <michael.gogins@GMAIL.COM>
>>>>>>>>>>>  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"
>>>>>>>>>>>  <oyvind.brandtsegg@ntnu.no>
>>>>>>>>>>>  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 <wstlopez@gmail.com>:
>>>>>>>>>>>>>
>>>>>>>>>>>>>  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" <jpff@codemist.co.uk> 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
>>>>>>>>>>>>>>  Csound@listserv.heanet.ie
>>>>>>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>>>>>>  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
>>>>>>>>>>>>  Csound@listserv.heanet.ie
>>>>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>>>  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
>>>>>>>>>  Csound@listserv.heanet.ie
>>>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>>>>  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
>>>>>>>  Csound@listserv.heanet.ie
>>>>>>>  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 Csound@listserv.heanet.ie
>>>>>  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
>>>>  Csound@listserv.heanet.ie
>>>>  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 Csound@listserv.heanet.ie
>>>  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 Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2017-03-07 17:01
Fromjpff
SubjectRe: 2 instances of Partikkel
On Sun, 5 Mar 2017, T Lopez wrote:

> 
> Hi...a little late to the party on this one due to personal affairs..
> 
> Could someone be kind enough to clarify what 'binary decomposition of p5'
> would entail?
> 
> Thanks!
>


Sorry for delay in response -- othestuff intervened

Any positive integer has a unique representation in binary
b0+b1*2+b2*2^2+b3*2^3+....+ bn*2^n+.....
were eacn b is 0 or 1

wat I was suggesting was if you wanted a numbr of possible effects 
(lowpass, higpass, reverb, allpass,....0 then you assig then an index ans 
then code like

if (p5&1==1) au = do_lowpass(au)
if (p5&2==2) au = do_hipass(au)
if (p5&4==4) au = do_reverb(au)
if (p5&8==8) au = do_allpass(au)
...

So p5 contrls anumber of effects

eg is p5=5 then as 5 = 1 +0*2 + 1*4
we will get lowpass and reverb;  Just add the indices ofthe effets you wat

Hope tat is cleaar -- if not I can try again

==John ff

Csound mailing list
Csound@listserv.heanet.ie
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

Date2017-03-09 00:24
FromT Lopez
SubjectRe: 2 instances of Partikkel

Thanks so much for your detailed response! It's a bit over my head as I'm still in newbie status, but I'll try to implement it and let you know;-)

On 7 Mar 2017 18:02, "jpff" <jpff@codemist.co.uk> wrote:
On Sun, 5 Mar 2017, T Lopez wrote:


Hi...a little late to the party on this one due to personal affairs..

Could someone be kind enough to clarify what 'binary decomposition of p5'
would entail?

Thanks!



Sorry for delay in response -- othestuff intervened

Any positive integer has a unique representation in binary
b0+b1*2+b2*2^2+b3*2^3+....+ bn*2^n+.....
were eacn b is 0 or 1

wat I was suggesting was if you wanted a numbr of possible effects (lowpass, higpass, reverb, allpass,....0 then you assig then an index ans then code like

if (p5&1==1) au = do_lowpass(au)
if (p5&2==2) au = do_hipass(au)
if (p5&4==4) au = do_reverb(au)
if (p5&8==8) au = do_allpass(au)
...

So p5 contrls anumber of effects

eg is p5=5 then as 5 = 1 +0*2 + 1*4
we will get lowpass and reverb;  Just add the indices ofthe effets you wat

Hope tat is cleaar -- if not I can try again

==John ff

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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