partikkelset

partikkelset — Set mask index for a specific mask parameter of a running partikkel instance.

Description

partikkelset is an opcode for setting the partikkel mask index for a specific parameter. Used together with partikkelget, it can be used to synchronize partikkel masking between several running instances of the partikkel opcode. It can also be used to set the internal mask index basaed on other processes, for example to create more complex masking patterns than is available with the regular grain masking system.

Syntax

partikkelset kparameterindex, kmaskindex, iopcode_id

Initialization

iopcode_id -- the opcode id, linking an instance of partikkel to an instance of partikkelsync.

Performance

kparameterindex -- mask parameter. Selection of the masking parameter for which to set the current mask index. The different parameters are identified as:

  • 0: gain mask

  • 1: pitch sweep start mask

  • 2: pitch sweep end mask

  • 3: fm modulation index mask

  • 4: channel mask

  • 5: waveform mix mask

kmaskindex -- value to set mask index to. Sets the current mask index for the parameter specified with kparameterindex in the partikkel instance identified with iopcode_id.

Example

Here is an example of the partikkelget and partikkelset opcodes. It uses the file partikkelgetset.csd.

Example 738. Example of manipulating the internal mask index of partikkel, based on the value of other mask indices in the same partikkel instance.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out  
-odac           ;;;RT audio 
; For Non-realtime ouput leave only the line below:
 -o partikkel-getset.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

nchnls 	= 2
0dbfs	= 1

giSine ftgen 0, 0, 65536, 10, 1
giCosine ftgen 0, 0, 8192, 9, 1, 1, 90
giSigmoRise ftgen 0, 0, 8193, 19, 0.5, 1, 270, 1
giSigmoFall ftgen 0, 0, 8193, 19, 0.5, 1, 90, 1

instr 1

; freqstart masking table, simple ascending semitones pattern
iwavfreqstarttab ftgentmp 0, 0, 32, -2, 0, 11,  
    semitone(0), semitone(1), semitone(2), semitone(3),
    semitone(4), semitone(5), semitone(6), semitone(7),
    semitone(8), semitone(9), semitone(10), semitone(11)

iwavfreqendtab ftgentmp 0, 0, 32, -2, 0, 11, 
    semitone(0), semitone(1), semitone(2), semitone(3),
    semitone(4), semitone(5), semitone(6), semitone(7),
    semitone(8), semitone(9), semitone(10), semitone(11)

; channel masking table, simple panning back and forth
ichannelmasks ftgentmp 0, 0, 32, -2, 0, 7, 0.0, 0.25, 0.5, 0.75, 1.0, 0.75, 0.5, 0.25

; init unused arate signals
awavfm = 0
asamplepos1	= 0
async = 0

; system
id = 1

a1,a2 partikkel 6, 0, -1, async, 0, -1, giSigmoRise, giSigmoFall, 
    0.9, 0.5, 100, ampdbfs(-9), -1, 1, 0,iwavfreqstarttab, iwavfreqendtab, awavfm, 
    -1, -1, giCosine, 1, 1, 1, ichannelmasks, 0, 
    giSine, giSine, giSine, giSine, 
    -1, asamplepos1, asamplepos1, asamplepos1, asamplepos1, 
    440, 440, 440, 440, 100, id

outch 1, a1, 2, a2

; using partikkelget and partikkelset to make the channelmask and freqmask indices 
; interact to create a more complex pattern
kfqmask partikkelget 1, id
kchmask partikkelget 4, id
kcount1 init 0
kcount2 init 0
if kchmask > (kfqmask+kchmask)%11  then
partikkelset 1, kcount1, id
partikkelset 2, kcount1, id
kcount1 = (kcount1+1)%7
elseif kfqmask > (kfqmask*kchmask)%7  then
partikkelset 4, kcount2, id
kcount2 = (kcount2+kcount1)%6
endif
        
endin

</CsInstruments>
<CsScore>
i1 0 30
</CsScore>
</CsoundSynthesizer>


See Also

partikkel

Credits

Author: Thom Johansen
Author: Øyvind Brandtsegg
May 2017

New in version 6.09