p — Show the value in a given p-field.


Show the value in a given p-field.



This function works at i-rate and k-rate.


x -- the number of the p-field.


The value returned by the p function is the value in a p-field.


Here is an example of the p opcode. It uses the file p.csd.

Example 742. Example of the p opcode.

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

; Select audio/midi flags here according to platform
-odac      ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o p.wav -W ;;; for file output any platform

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

; by Menno Knevel - 2022

instr 1

ipr	= p(4)
prints  "\nrandom number is now %f\n", ipr               ; find out the values of p4
aenv    linen   1, 0, p3, .2
asig    poscil  .5, p4
outs    asig * aenv, asig * aenv


i1  0   1   [~ * 200]    ; random between 0-200    
i1  +   1   [~ * 200]
i1  +   2   [~ * 200]  


Its output should include lines like:

random number is now 105.248963
random number is now 32.504969
random number is now 139.496898

See also

Initialization and Reinitialization