Re: [Csnd-dev] ctcsound, api channel_ptr
Francois PINOT <[email protected]> Sun, 5 Jul 2026 22:03:58 +0200
| Newsgroups | gmane.comp.audio.csound.devel |
|---|---|
| Message-ID | <CAKXOhL=Em=bN4e-e5N4b_WUde+hT51hqdxSr=bBtq2=43pZwHQ@mail.gmail.com> |
--0000000000003008de0655e2a9ee
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
The channel_ptr method returns an opaque pointer to one of the data
structures describing the type of the data in the channel. This pointer can
then be used as an argument to the different access methods for getting the
channel features and/or data.
Here is a python script with your csd:
arraydat.csd:
<CsoundSynthesizer>
<CsOptions>
-s -d -+rtaudio=3DALSA -odevaudio -b1024 -B1024
</CsOptions>
<CsInstruments>
sr =3D 48000
ksmps =3D 32
nchnls =3D 2
0dbfs =3D 1
array_size@global:i =3D init(1024)
instr 1
ndx:k =3D init(0)
;trig:k =3D init(1)
out_array:k[] =3D init(array_size)
// Generate some data (e.g., sine wave values)
val:k =3D oscili(1, 1)
; Fill the array
out_array[ndx] =3D val
ndx +=3D 1
cnt:k =3D init(0)
if ndx =3D=3D array_size then
chnset(out_array, "python_array_channel")
ndx =3D 0
// test print some array contents
while cnt < 10 do
printks2("%f\n", out_array[cnt])
cnt +=3D1
od
endif
endin
instr 2 // get k-values as proof working
cnt:k init 0
out_array:k[] =3D init(array_size)
vals:k[] =3D chngetk("python_array_channel")
while cnt < 10 do
printks2("%f\n", vals[cnt])
cnt +=3D1
od
;if metro(1) =3D=3D 1 then
; printarray(vals, 1)
;endif
endin
</CsInstruments>
<CsScore>
i 1 1 2
;i 2 2 2
</CsScore>
</CsoundSynthesizer>
arraydat.py:
import ctcsound
cs =3D ctcsound.Csound()
cs.start()
res =3D cs.compile_csd("arraydat.csd", 0)
if res =3D=3D 0:
cs.event_string("i1 0 1", 0)
cs.perform_ksmps()
ptr, err =3D cs.channel_ptr("python_array_channel",
ctcsound.CSOUND_ARRAY_CHANNEL |
ctcsound.CSOUND_OUTPUT_CHANNEL)
if err =3D=3D '':
dim =3D cs.array_data_dimensions(ptr)
data_type =3D cs.array_data_type(ptr)
sizes =3D cs.array_data_sizes(ptr)
# We can read the array dim, data type, and shape
# Using API methods
print("\n", "Data array features read from API methods:")
print(f"dim: {dim}, data type: {data_type}, sizes: {sizes}\n")
data =3D cs.array_data(ptr)
# But we can read the same array features than above
# directly from the numpy array returned by array_data()
print("\n", "Data array features read from numpy array:")
print(f"dim: {data.ndim}, data type: {data.dtype}, shape: {data.shape}\n")
print("Data printed by csd")
for i in range(sizes[0]):
cs.perform_ksmps()
print("\nData printed by python script")
for i in range(10):
print(f"{i}: {data[i]:f}")
the command python arraydat.py will generate this output:
--Csound version 7.0 (double samples) Jun 26 2026
[commit: 6579dd1bba88fe97a65a9ae73231e1f1a5e23523]
using libsndfile-1.2.2
graphics suppressed, ascii substituted
sr =3D 44100.0, kr =3D 4410.000, ksmps =3D 10
0dBFS level =3D 32768.0, A4 tuning =3D 440.0
audio buffered in 256 sample-frame blocks
writing 512-byte blks of shorts to /home/pinot/csound/sfdir/test.wav (WAV)
SECTION 1:
Skipping <CsOptions>
new alloc for instr 1:
Data array features read from API methods:
dim: 1, data type: k, sizes: [1024]
Data array features read from numpy array:
dim: 1, data type: float64, shape: (1024,)
Data printed by csd
0.000000
0.001425
0.002850
0.004274
0.005699
0.007124
0.008548
0.009973
0.011398
0.012822
Data printed by python script
0: 0.000000
1: 0.001425
2: 0.002850
3: 0.004274
4: 0.005699
5: 0.007124
6: 0.008548
7: 0.009973
8: 0.011398
9: 0.012822
inactive allocs returned to freespace
overall amps: 0.0
overall samples out of range: 0
0 errors in performance
Elapsed time at end of performance: real: 0.011s, CPU: 0.040s
256 512 sample blks of shorts written to /home/pinot/csound/sfdir/test.wav
(WAV)
Nota Bene: to get this to work you need to use the last updated version of
ctcsound.py:
https://raw.githubusercontent.com/csound/csound/refs/heads/develop/Python/c=
tcsound.py
Hope this helps
Fran=C3=A7ois
Le dim. 5 juil. 2026 =C3=A0 01:14, James Hearon <[email protected]> a =
=C3=A9crit :
> Enjoying looking at changes to csound7 since csound6. Trying some of the
> new array features, but a bit stuck on getting a ARRAYDAT_p returned from
> ctcsound. I'm not sure I'm going about it the right way, using
> channel_ptr to directly retrieve chnset array data from csd.
> ....
> result =3D cs.compile_csd('arraydat.csd', 0)
> ....
> ptr, _ =3D csound.channel_ptr("python_array_channel",
> ctcsound.CSOUND_ARRAY_CHANNEL | ctcsound.CSOUND_OUTPUT_CHANNEL)
> print("ptr type:", type(ptr))
>
> Seems to ever only return: ctypes.c_void_p, the pvs type instead of an
> ndarray
>
> ...from ctcsound
> def channel_ptr(self, name, type_):
> #Get a pointer to the specified channel and an error message.
>
> length =3D 1 # default buf length for CSOUND_CONTROL_CHANNEL:
> ptr =3D ct.c_void_p()
> chan_type =3D type_ & CSOUND_CHANNEL_TYPE_MASK
> err =3D ''
> ret =3D libcsound.csoundGetChannelPtr(self.cs, ct.byref(ptr),
> cstring(name), type_)
> if ret =3D=3D CSOUND_SUCCESS:
> if chan_type =3D=3D CSOUND_STRING_CHANNEL:
> return ct.cast(ptr, STRINGDAT_p), err
> elif chan_type =3D=3D CSOUND_ARRAY_CHANNEL:
> return ct.cast(ptr, ARRAYDAT_p), err
> elif chan_type =3D=3D CSOUND_PVS_CHANNEL:
> return ct.cast(ptr, PVSDAT_p), err
> elif chan_type =3D=3D CSOUND_AUDIO_CHANNEL:
> length =3D libcsound.csoundGetKsmps(self.cs)
> array_type =3D np.ctypeslib.ndpointer(MYFLT, 1, (length,),
> 'C_CONTIGUOUS')
> p =3D ct.cast(ptr, array_type)
> return array_from_pointer(p), err
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> arraydat.csd
>
> <CsoundSynthesizer>
> <CsOptions>
> -csound -s -d -+rtaudio=3DALSA -odevaudio -b1024 -B1024
> </CsOptions>
> <CsInstruments>
> sr =3D 48000
> ksmps =3D 32
> nchnls =3D 2
> 0dbfs =3D 1
>
> gi_array_size init 1024
>
> instr 1
> k_index init 0
> k_trigger init 1
> k_out_array[] init gi_array_size
>
> ; Generate some data (e.g., sine wave values)
> k_val oscili 1, 1
>
> ; Fill the array
> k_out_array[k_index] =3D k_val
> k_index +=3D 1
>
> kcnt init 0
>
> if k_index =3D=3D gi_array_size then
> chnset k_out_array, "python_array_channel"
> k_index =3D 0
>
> ;test print some array contents
> ;while kcnt < 10 do
> ;printks2 "%f\n", k_out_array[kcnt]
> ;kcnt +=3D1
> ;od
>
> endif
> endin
>
> instr 2; get k-values as proof working
> kcnt init 0
> k_out_array[] init gi_array_size
>
> kVals[] chngetk "python_array_channel"
>
> while kcnt < 10 do
> printks2 "%f\n", kVals[kcnt]
> kcnt +=3D1
> od
>
> ;if metro(1) =3D=3D 1 then
> ;printarray kVals, 1
> ;endif
>
> endin
>
> </CsInstruments>
> <CsScore>
> i 1 1 2
> ;i 2 2 2
> </CsScore>
> </CsoundSynthesizer>
>
--0000000000003008de0655e2a9ee
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div dir=3D"ltr">The channel_ptr=C2=A0method returns an op=
aque pointer to one of the data structures describing the type of the data =
in the channel. This pointer can then be used as an argument to the differe=
nt access=C2=A0methods for getting the channel features and/or data.<div><b=
r></div><div>Here is a python script with your csd:</div><div><br></div><di=
v>arraydat.csd:</div><div><br></div><div><div style=3D"color:rgb(187,190,19=
1);background-color:rgb(18,19,20);font-family:"Droid Sans Mono",m=
onospace;font-size:14px;line-height:19px;white-space:pre"><div><span style=
=3D"color:rgb(128,128,128)"><</span><span style=3D"color:rgb(126,231,135=
)">CsoundSynthesizer</span><span style=3D"color:rgb(128,128,128)">></spa=
n></div><div><span style=3D"color:rgb(128,128,128)"><</span><span style=
=3D"color:rgb(126,231,135)">CsOptions</span><span style=3D"color:rgb(128,12=
8,128)">></span></div><div> -s -d -+rtaudio=3DALSA -odevaudio -b1024 -B=
1024</div><div><span style=3D"color:rgb(128,128,128)"></</span><span sty=
le=3D"color:rgb(126,231,135)">CsOptions</span><span style=3D"color:rgb(128,=
128,128)">></span></div><div><span style=3D"color:rgb(128,128,128)"><=
</span><span style=3D"color:rgb(126,231,135)">CsInstruments</span><span sty=
le=3D"color:rgb(128,128,128)">></span></div><div><span style=3D"color:rg=
b(121,192,255)">sr</span> <span style=3D"color:rgb(212,212,212)">=3D</s=
pan> <span style=3D"color:rgb(181,206,168)">48000</span></div><div><span st=
yle=3D"color:rgb(121,192,255)">ksmps</span> <span style=3D"color:rgb(212,2=
12,212)">=3D</span> <span style=3D"color:rgb(181,206,168)">32</span></div><=
div><span style=3D"color:rgb(121,192,255)">nchnls</span> <span style=3D"col=
or:rgb(212,212,212)">=3D</span> <span style=3D"color:rgb(181,206,168)">2</s=
pan></div><div><span style=3D"color:rgb(121,192,255)">0dbfs</span> <span s=
tyle=3D"color:rgb(212,212,212)">=3D</span> <span style=3D"color:rgb(181,206=
,168)">1</span></div><br><div><span style=3D"color:rgb(201,209,217)">array_=
size</span><span style=3D"color:rgb(255,123,114)">@</span><span style=3D"co=
lor:rgb(201,209,217)">global</span><span style=3D"color:rgb(212,212,212)">:=
</span><span style=3D"color:rgb(220,220,170)">i</span> <span style=3D"color=
:rgb(212,212,212)">=3D</span> <span style=3D"color:rgb(220,220,170)">init</=
span>(<span style=3D"color:rgb(181,206,168)">1024</span>)</div><br><div><sp=
an style=3D"color:rgb(255,123,114)">instr</span> <span style=3D"color:rgb(2=
10,168,255)">1</span></div><div> <span style=3D"color:rgb(201,209,217)">nd=
x</span><span style=3D"color:rgb(212,212,212)">:</span><span style=3D"color=
:rgb(220,220,170)">k</span> <span style=3D"color:rgb(212,212,212)">=3D</spa=
n> <span style=3D"color:rgb(220,220,170)">init</span>(<span style=3D"color:=
rgb(181,206,168)">0</span>)</div><div> <span style=3D"color:rgb(139,148,15=
8)">;trig:k =3D init(1)</span></div><div> <span style=3D"color:rgb(201,209=
,217)">out_array</span><span style=3D"color:rgb(212,212,212)">:</span><span=
style=3D"color:rgb(220,220,170)">k</span>[] <span style=3D"color:rgb(212,2=
12,212)">=3D</span> <span style=3D"color:rgb(220,220,170)">init</span>(<spa=
n style=3D"color:rgb(201,209,217)">array_size</span>)</div><div> </div><di=
v> <span style=3D"color:rgb(139,148,158)">// Generate some data (e.g., sin=
e wave values)</span></div><div> <span style=3D"color:rgb(201,209,217)">va=
l</span><span style=3D"color:rgb(212,212,212)">:</span><span style=3D"color=
:rgb(220,220,170)">k</span> <span style=3D"color:rgb(212,212,212)">=3D</spa=
n> <span style=3D"color:rgb(220,220,170)">oscili</span>(<span style=3D"colo=
r:rgb(181,206,168)">1</span>, <span style=3D"color:rgb(181,206,168)">1</spa=
n>)</div><div> </div><div> <span style=3D"color:rgb(139,148,158)">; Fill =
the array</span></div><div> <span style=3D"color:rgb(201,209,217)">out_arr=
ay</span>[<span style=3D"color:rgb(201,209,217)">ndx</span>] <span style=3D=
"color:rgb(212,212,212)">=3D</span> <span style=3D"color:rgb(201,209,217)">=
val</span></div><div> <span style=3D"color:rgb(201,209,217)">ndx</span> <s=
pan style=3D"color:rgb(212,212,212)">+=3D</span> <span style=3D"color:rgb(1=
81,206,168)">1</span></div><div> </div><div> <span style=3D"color:rgb(201=
,209,217)">cnt</span><span style=3D"color:rgb(212,212,212)">:</span><span s=
tyle=3D"color:rgb(220,220,170)">k</span> <span style=3D"color:rgb(212,212,2=
12)">=3D</span> <span style=3D"color:rgb(220,220,170)">init</span>(<span st=
yle=3D"color:rgb(181,206,168)">0</span>)</div><div> </div><div> <span sty=
le=3D"color:rgb(197,134,192)">if</span> <span style=3D"color:rgb(201,209,21=
7)">ndx</span> <span style=3D"color:rgb(212,212,212)">=3D=3D</span> <span s=
tyle=3D"color:rgb(201,209,217)">array_size</span> <span style=3D"color:rgb(=
197,134,192)">then</span></div><div> <span style=3D"color:rgb(220,220,17=
0)">chnset</span>(<span style=3D"color:rgb(201,209,217)">out_array</span>, =
<span style=3D"color:rgb(165,214,255)">"python_array_channel"</sp=
an>)</div><div> <span style=3D"color:rgb(201,209,217)">ndx</span> <span =
style=3D"color:rgb(212,212,212)">=3D</span> <span style=3D"color:rgb(181,20=
6,168)">0</span></div><div> </div><div> <span style=3D"color:rgb(139,=
148,158)">// test print some array contents</span></div><div> <span styl=
e=3D"color:rgb(197,134,192)">while</span> <span style=3D"color:rgb(201,209,=
217)">cnt</span> <span style=3D"color:rgb(212,212,212)"><</span> <span s=
tyle=3D"color:rgb(181,206,168)">10</span> <span style=3D"color:rgb(197,134,=
192)">do</span></div><div> <span style=3D"color:rgb(220,220,170)">prin=
tks2</span>(<span style=3D"color:rgb(165,214,255)">"</span><span style=
=3D"color:rgb(255,123,114)">%f</span><span style=3D"color:rgb(215,186,125)"=
>\n</span><span style=3D"color:rgb(165,214,255)">"</span>, <span style=
=3D"color:rgb(201,209,217)">out_array</span>[<span style=3D"color:rgb(201,2=
09,217)">cnt</span>])</div><div> <span style=3D"color:rgb(201,209,217)=
">cnt</span> <span style=3D"color:rgb(212,212,212)">+=3D</span><span style=
=3D"color:rgb(181,206,168)">1</span></div><div> <span style=3D"color:rgb=
(197,134,192)">od</span></div><div> <span style=3D"color:rgb(197,134,192=
)">endif</span></div><div><span style=3D"color:rgb(255,123,114)">endin</spa=
n></div><div> </div><div><span style=3D"color:rgb(255,123,114)">instr</s=
pan> <span style=3D"color:rgb(210,168,255)">2</span> <span style=3D"color:r=
gb(139,148,158)">// get k-values as proof working</span></div><div> <span =
style=3D"color:rgb(201,209,217)">cnt</span><span style=3D"color:rgb(212,212=
,212)">:</span><span style=3D"color:rgb(220,220,170)">k</span> <span style=
=3D"color:rgb(220,220,170)">init</span> <span style=3D"color:rgb(181,206,16=
8)">0</span></div><div> <span style=3D"color:rgb(201,209,217)">out_array</=
span><span style=3D"color:rgb(212,212,212)">:</span><span style=3D"color:rg=
b(220,220,170)">k</span>[] <span style=3D"color:rgb(212,212,212)">=3D</span=
> <span style=3D"color:rgb(220,220,170)">init</span>(<span style=3D"color:r=
gb(201,209,217)">array_size</span>)</div><br><div> <span style=3D"color:rg=
b(201,209,217)">vals</span><span style=3D"color:rgb(212,212,212)">:</span><=
span style=3D"color:rgb(220,220,170)">k</span>[] <span style=3D"color:rgb(2=
12,212,212)">=3D</span> <span style=3D"color:rgb(220,220,170)">chngetk</spa=
n>(<span style=3D"color:rgb(165,214,255)">"python_array_channel"<=
/span>)</div><br><div> <span style=3D"color:rgb(197,134,192)">while</span>=
<span style=3D"color:rgb(201,209,217)">cnt</span> <span style=3D"color:rgb=
(212,212,212)"><</span> <span style=3D"color:rgb(181,206,168)">10</span>=
<span style=3D"color:rgb(197,134,192)">do</span></div><div> <span style=
=3D"color:rgb(220,220,170)">printks2</span>(<span style=3D"color:rgb(165,21=
4,255)">"</span><span style=3D"color:rgb(255,123,114)">%f</span><span =
style=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(165,214,=
255)">"</span>, <span style=3D"color:rgb(201,209,217)">vals</span>[<sp=
an style=3D"color:rgb(201,209,217)">cnt</span>])</div><div> <span style=
=3D"color:rgb(201,209,217)">cnt</span> <span style=3D"color:rgb(212,212,212=
)">+=3D</span><span style=3D"color:rgb(181,206,168)">1</span></div><div> <=
span style=3D"color:rgb(197,134,192)">od</span></div><div> </div>=
<div> <span style=3D"color:rgb(139,148,158)">;if metro(1) =3D=3D 1 then</s=
pan></div><div> <span style=3D"color:rgb(139,148,158)">; printarray(vals,=
1)</span></div><div> <span style=3D"color:rgb(139,148,158)">;endif </span=
></div><div><span style=3D"color:rgb(255,123,114)">endin</span></div><br><d=
iv><span style=3D"color:rgb(128,128,128)"></</span><span style=3D"color:=
rgb(126,231,135)">CsInstruments</span><span style=3D"color:rgb(128,128,128)=
">></span></div><div><span style=3D"color:rgb(128,128,128)"><</span><=
span style=3D"color:rgb(126,231,135)">CsScore</span><span style=3D"color:rg=
b(128,128,128)">></span></div><div><span style=3D"color:rgb(197,134,192)=
">i</span> <span style=3D"color:rgb(181,206,168)">1</span> <span style=3D"c=
olor:rgb(181,206,168)">1</span> <span style=3D"color:rgb(181,206,168)">2</s=
pan></div><div><span style=3D"color:rgb(139,148,158)">;i 2 2 2</span></div>=
<div><span style=3D"color:rgb(128,128,128)"></</span><span style=3D"colo=
r:rgb(126,231,135)">CsScore</span><span style=3D"color:rgb(128,128,128)">&g=
t;</span></div><div><span style=3D"color:rgb(128,128,128)"></</span><spa=
n style=3D"color:rgb(126,231,135)">CsoundSynthesizer</span><span style=3D"c=
olor:rgb(128,128,128)">></span></div><br><br></div></div><div><br></div>=
<div>arraydat.py:</div><div><br></div><div><div style=3D"color:rgb(187,190,=
191);background-color:rgb(18,19,20);font-family:"Droid Sans Mono"=
,monospace;font-size:14px;line-height:19px;white-space:pre"><div><span styl=
e=3D"color:rgb(197,134,192)">import</span> <span style=3D"color:rgb(78,201,=
176)">ctcsound</span></div><br><div><span style=3D"color:rgb(201,209,217)">=
cs</span> <span style=3D"color:rgb(212,212,212)">=3D</span> <span style=3D"=
color:rgb(78,201,176)">ctcsound</span>.<span style=3D"color:rgb(78,201,176)=
">Csound</span>()</div><div><span style=3D"color:rgb(201,209,217)">cs</span=
>.<span style=3D"color:rgb(210,168,255)">start</span>()</div><div><span sty=
le=3D"color:rgb(201,209,217)">res</span> <span style=3D"color:rgb(212,212,2=
12)">=3D</span> <span style=3D"color:rgb(201,209,217)">cs</span>.<span styl=
e=3D"color:rgb(210,168,255)">compile_csd</span>(<span style=3D"color:rgb(16=
5,214,255)">"arraydat.csd"</span>, <span style=3D"color:rgb(181,2=
06,168)">0</span>)</div><div><span style=3D"color:rgb(197,134,192)">if</spa=
n> <span style=3D"color:rgb(201,209,217)">res</span> <span style=3D"color:r=
gb(212,212,212)">=3D=3D</span> <span style=3D"color:rgb(181,206,168)">0</sp=
an>:</div><div> <span style=3D"color:rgb(201,209,217)">cs</span>.<span s=
tyle=3D"color:rgb(210,168,255)">event_string</span>(<span style=3D"color:rg=
b(165,214,255)">"i1 0 1"</span>, <span style=3D"color:rgb(181,206=
,168)">0</span>)</div><div> <span style=3D"color:rgb(201,209,217)">cs</s=
pan>.<span style=3D"color:rgb(210,168,255)">perform_ksmps</span>()</div><di=
v> <span style=3D"color:rgb(201,209,217)">ptr</span>, <span style=3D"col=
or:rgb(201,209,217)">err</span> <span style=3D"color:rgb(212,212,212)">=3D<=
/span> <span style=3D"color:rgb(201,209,217)">cs</span>.<span style=3D"colo=
r:rgb(210,168,255)">channel_ptr</span>(<span style=3D"color:rgb(165,214,255=
)">"python_array_channel"</span>,</div><div> =
<span style=3D"color:rgb(78,201,176)">ctcsound</span>.<span style=
=3D"color:rgb(201,209,217)">CSOUND_ARRAY_CHANNEL</span> <span style=3D"colo=
r:rgb(212,212,212)">|</span></div><div> <span =
style=3D"color:rgb(78,201,176)">ctcsound</span>.<span style=3D"color:rgb(20=
1,209,217)">CSOUND_OUTPUT_CHANNEL</span>)</div><div> <span style=3D"colo=
r:rgb(197,134,192)">if</span> <span style=3D"color:rgb(201,209,217)">err</s=
pan> <span style=3D"color:rgb(212,212,212)">=3D=3D</span> <span style=3D"co=
lor:rgb(165,214,255)">''</span>:</div><div> <span style=3D"c=
olor:rgb(201,209,217)">dim</span> <span style=3D"color:rgb(212,212,212)">=
=3D</span> <span style=3D"color:rgb(201,209,217)">cs</span>.<span style=3D"=
color:rgb(210,168,255)">array_data_dimensions</span>(<span style=3D"color:r=
gb(201,209,217)">ptr</span>)</div><div> <span style=3D"color:rgb(201=
,209,217)">data_type</span> <span style=3D"color:rgb(212,212,212)">=3D</spa=
n> <span style=3D"color:rgb(201,209,217)">cs</span>.<span style=3D"color:rg=
b(210,168,255)">array_data_type</span>(<span style=3D"color:rgb(201,209,217=
)">ptr</span>)</div><div> <span style=3D"color:rgb(201,209,217)">siz=
es</span> <span style=3D"color:rgb(212,212,212)">=3D</span> <span style=3D"=
color:rgb(201,209,217)">cs</span>.<span style=3D"color:rgb(210,168,255)">ar=
ray_data_sizes</span>(<span style=3D"color:rgb(201,209,217)">ptr</span>)</d=
iv><div> <span style=3D"color:rgb(139,148,158)"># We can read the ar=
ray dim, data type, and shape</span></div><div> <span style=3D"color=
:rgb(139,148,158)"># Using API methods</span></div><div> <span style=
=3D"color:rgb(210,168,255)">print</span>(<span style=3D"color:rgb(165,214,2=
55)">"</span><span style=3D"color:rgb(215,186,125)">\n</span><span sty=
le=3D"color:rgb(165,214,255)">"</span>, <span style=3D"color:rgb(165,2=
14,255)">"Data array features read from API methods:"</span>)</di=
v><div> <span style=3D"color:rgb(210,168,255)">print</span>(<span st=
yle=3D"color:rgb(255,123,114)">f</span><span style=3D"color:rgb(165,214,255=
)">"dim: </span><span style=3D"color:rgb(255,123,114)">{</span><span s=
tyle=3D"color:rgb(201,209,217)">dim</span><span style=3D"color:rgb(255,123,=
114)">}</span><span style=3D"color:rgb(165,214,255)">, data type: </span><s=
pan style=3D"color:rgb(255,123,114)">{</span><span style=3D"color:rgb(201,2=
09,217)">data_type</span><span style=3D"color:rgb(255,123,114)">}</span><sp=
an style=3D"color:rgb(165,214,255)">, sizes: </span><span style=3D"color:rg=
b(255,123,114)">{</span><span style=3D"color:rgb(201,209,217)">sizes</span>=
<span style=3D"color:rgb(255,123,114)">}</span><span style=3D"color:rgb(215=
,186,125)">\n</span><span style=3D"color:rgb(165,214,255)">"</span>)</=
div><br><div> <span style=3D"color:rgb(201,209,217)">data</span> <sp=
an style=3D"color:rgb(212,212,212)">=3D</span> <span style=3D"color:rgb(201=
,209,217)">cs</span>.<span style=3D"color:rgb(210,168,255)">array_data</spa=
n>(<span style=3D"color:rgb(201,209,217)">ptr</span>)</div><div> <sp=
an style=3D"color:rgb(139,148,158)"># But we can read the same array featur=
es than above</span></div><div> <span style=3D"color:rgb(139,148,158=
)"># directly from the numpy array returned by array_data()</span></div><di=
v> <span style=3D"color:rgb(210,168,255)">print</span>(<span style=
=3D"color:rgb(165,214,255)">"</span><span style=3D"color:rgb(215,186,1=
25)">\n</span><span style=3D"color:rgb(165,214,255)">"</span>, <span s=
tyle=3D"color:rgb(165,214,255)">"Data array features read from numpy a=
rray:"</span>)</div><div> <span style=3D"color:rgb(210,168,255)=
">print</span>(<span style=3D"color:rgb(255,123,114)">f</span><span style=
=3D"color:rgb(165,214,255)">"dim: </span><span style=3D"color:rgb(255,=
123,114)">{</span><span style=3D"color:rgb(201,209,217)">data</span>.<span =
style=3D"color:rgb(201,209,217)">ndim</span><span style=3D"color:rgb(255,12=
3,114)">}</span><span style=3D"color:rgb(165,214,255)">, data type: </span>=
<span style=3D"color:rgb(255,123,114)">{</span><span style=3D"color:rgb(201=
,209,217)">data</span>.<span style=3D"color:rgb(201,209,217)">dtype</span><=
span style=3D"color:rgb(255,123,114)">}</span><span style=3D"color:rgb(165,=
214,255)">, shape: </span><span style=3D"color:rgb(255,123,114)">{</span><s=
pan style=3D"color:rgb(201,209,217)">data</span>.<span style=3D"color:rgb(2=
01,209,217)">shape</span><span style=3D"color:rgb(255,123,114)">}</span><sp=
an style=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(165,2=
14,255)">"</span>)</div><div> <span style=3D"color:rgb(210,168,=
255)">print</span>(<span style=3D"color:rgb(165,214,255)">"Data printe=
d by csd"</span>)</div><div> <span style=3D"color:rgb(197,134,1=
92)">for</span> <span style=3D"color:rgb(201,209,217)">i</span> <span style=
=3D"color:rgb(197,134,192)">in</span> <span style=3D"color:rgb(78,201,176)"=
>range</span>(<span style=3D"color:rgb(201,209,217)">sizes</span>[<span sty=
le=3D"color:rgb(181,206,168)">0</span>]):</div><div> <span style=
=3D"color:rgb(201,209,217)">cs</span>.<span style=3D"color:rgb(210,168,255)=
">perform_ksmps</span>()</div><div> <span style=3D"color:rgb(210,168=
,255)">print</span>(<span style=3D"color:rgb(165,214,255)">"</span><sp=
an style=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(165,2=
14,255)">Data printed by python script"</span>)</div><div> <spa=
n style=3D"color:rgb(197,134,192)">for</span> <span style=3D"color:rgb(201,=
209,217)">i</span> <span style=3D"color:rgb(197,134,192)">in</span> <span s=
tyle=3D"color:rgb(78,201,176)">range</span>(<span style=3D"color:rgb(181,20=
6,168)">10</span>):</div><div> <span style=3D"color:rgb(210,168,=
255)">print</span>(<span style=3D"color:rgb(255,123,114)">f</span><span sty=
le=3D"color:rgb(165,214,255)">"</span><span style=3D"color:rgb(255,123=
,114)">{</span><span style=3D"color:rgb(201,209,217)">i</span><span style=
=3D"color:rgb(255,123,114)">}</span><span style=3D"color:rgb(165,214,255)">=
: </span><span style=3D"color:rgb(255,123,114)">{</span><span style=3D"colo=
r:rgb(201,209,217)">data</span>[<span style=3D"color:rgb(201,209,217)">i</s=
pan>]<span style=3D"color:rgb(255,123,114)">:f}</span><span style=3D"color:=
rgb(165,214,255)">"</span>)</div><br></div></div></div><div><br></div>=
the command python arraydat.py will generate this output:<div><br></div><di=
v>--Csound version 7.0 (double samples) Jun 26 2026<br>[commit: 6579dd1bba8=
8fe97a65a9ae73231e1f1a5e23523]<br>using libsndfile-1.2.2<br>graphics suppre=
ssed, ascii substituted<br>sr =3D 44100.0, kr =3D 4410.000, ksmps =3D 10<br=
>0dBFS level =3D 32768.0, A4 tuning =3D 440.0<br>audio buffered in 256 samp=
le-frame blocks<br>writing 512-byte blks of shorts to /home/pinot/csound/sf=
dir/test.wav (WAV)<br>SECTION 1:<br>Skipping <CsOptions><br>new alloc=
for instr 1:<br><br>=C2=A0Data array features read from API methods:<br>di=
m: 1, data type: k, sizes: [1024]<br><br><br>=C2=A0Data array features read=
from numpy array:<br>dim: 1, data type: float64, shape: (1024,)<br><br>Dat=
a printed by csd<br>0.000000<br>0.001425<br>0.002850<br>0.004274<br>0.00569=
9<br>0.007124<br>0.008548<br>0.009973<br>0.011398<br>0.012822<br><br>Data p=
rinted by python script<br>0: 0.000000<br>1: 0.001425<br>2: 0.002850<br>3: =
0.004274<br>4: 0.005699<br>5: 0.007124<br>6: 0.008548<br>7: 0.009973<br>8: =
0.011398<br>9: 0.012822<br>inactive allocs returned to freespace<br> =C2=
=A0 overall amps: =C2=A0 =C2=A0 =C2=A00.0<br> =C2=A0 overall samples out o=
f range: =C2=A0 =C2=A0 =C2=A0 =C2=A00<br>0 errors in performance<br>Elapsed=
time at end of performance: real: 0.011s, CPU: 0.040s<br>256 512 sample bl=
ks of shorts written to /home/pinot/csound/sfdir/test.wav (WAV)<br><div><br=
></div><div>Nota Bene: to get this to work you need to use the last updated=
version of ctcsound.py:</div><div><a href=3D"https://raw.githubusercontent=
.com/csound/csound/refs/heads/develop/Python/ctcsound.py">https://raw.githu=
busercontent.com/csound/csound/refs/heads/develop/Python/ctcsound.py</a></d=
iv><div><br></div><div>Hope this helps</div><div><br></div><div>Fran=C3=A7o=
is</div><div><br></div><div><br><div class=3D"gmail_quote gmail_quote_conta=
iner"><div dir=3D"ltr" class=3D"gmail_attr">Le=C2=A0dim. 5 juil. 2026 =C3=
=A0=C2=A001:14, James Hearon <<a href=3D"mailto:[email protected]">j_=
[email protected]</a>> a =C3=A9crit=C2=A0:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex"><div class=3D"msg-475238589843715847">
<div dir=3D"ltr">
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
Enjoying looking at changes to csound7 since csound6.=C2=A0 Trying some of =
the new array features, but a bit stuck on getting a ARRAYDAT_p returned fr=
om</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
ctcsound.=C2=A0 I'm not sure I'm going about it the right way, usin=
g channel_ptr to directly retrieve chnset array data from csd.</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=E2=80=82=E2=80=82=E2=80=82=E2=80=82=C2=A0 ....</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 result =3D cs.compile_csd(&#=
39;arraydat.csd', 0)=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=E2=80=82=E2=80=82=E2=80=82=E2=80=82=C2=A0 ....</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ptr, _ =3D csound.channel_ptr(&qu=
ot;python_array_channel", ctcsound.CSOUND_ARRAY_CHANNEL | ctcsound.CSO=
UND_OUTPUT_CHANNEL)</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 print("ptr type:",=
type(ptr))=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
Seems to ever only return: ctypes.c_void_p, the pvs type instead of an ndar=
ray</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 ...from ctcsound</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 def channel_ptr(self, name, type_):</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 #Get a pointer to the specified channel and an =
error message.</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 length =3D 1 =C2=A0# default buf length for CSO=
UND_CONTROL_CHANNEL:</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ptr =3D ct.c_void_p()</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 chan_type =3D type_ & CSOUND_CHANNEL_TYPE_M=
ASK</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 err =3D ''</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret =3D libcsound.csoundGetChannelPtr(self.cs, =
ct.byref(ptr), cstring(name), type_)</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ret =3D=3D CSOUND_SUCCESS:</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if chan_type =3D=3D CSOUND_STRING=
_CHANNEL:</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ct.cast(ptr,=
STRINGDAT_p), err</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 elif chan_type =3D=3D CSOUND_ARRA=
Y_CHANNEL:</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ct.cast(ptr,=
ARRAYDAT_p), err</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 elif chan_type =3D=3D CSOUND_PVS_=
CHANNEL:</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ct.cast(ptr,=
PVSDAT_p), err</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 elif chan_type =3D=3D CSOUND_AUDI=
O_CHANNEL:</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 length =3D libcsoun=
d.csoundGetKsmps(self.cs)</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 array_type =3D np.ctypeslib.ndpoi=
nter(MYFLT, 1, (length,), 'C_CONTIGUOUS')</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 p =3D ct.cast(ptr, array_type)</d=
iv>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return array_from_pointer(p), err=
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
arraydat.csd</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<CsoundSynthesizer></div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<CsOptions></div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
-csound -s -d -+rtaudio=3DALSA -odevaudio -b1024 -B1024</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
</CsOptions></div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<CsInstruments></div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
sr =C2=A0 =C2=A0 =3D 48000</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
ksmps =3D 32</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
nchnls =3D 2</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
0dbfs =3D 1</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
gi_array_size init 1024</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
instr 1</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 k_index init 0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 k_trigger init 1</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 k_out_array[] init gi_array_size</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 ; Generate some data (e.g., sine wave values)</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 k_val oscili 1, 1</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 ; Fill the array</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 k_out_array[k_index] =3D k_val</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 k_index +=3D 1</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 kcnt init 0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 if k_index =3D=3D gi_array_size then</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 chnset k_out_array, "python_array_channel"</=
div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 k_index =3D 0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;test print some array contents</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;while kcnt < 10 do</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;printks2 "%f\n", k_out_array[kcnt]</=
div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;kcnt +=3D1</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;od</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 endif</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
endin</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0instr 2; get k-values as proof working</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0kcnt init 0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 k_out_array[] init gi_array_size</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 kVals[] chngetk "python_array_channel"</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 while kcnt < 10 do</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 printks2 "%f\n", kVals[kcnt]</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 kcnt +=3D1</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0od</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 ;if metro(1) =3D=3D 1 then</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;printarray kVals, 1</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
=C2=A0 =C2=A0 ;endif=C2=A0</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
endin</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
</CsInstruments></div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<CsScore></div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
i 1 1 2</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
;i 2 2 2</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
</CsScore></div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
</CsoundSynthesizer></div>
</div>
</div></blockquote></div></div></div></div>
--0000000000003008de0655e2a9ee--