Csound Csound-dev Csound-tekno Search About

[Csnd] Csound 7 array of struct

Date2025-03-08 08:57
FromTarmo Johannes
Subject[Csnd] Csound 7 array of struct
Hi!

Can I and how can I declare an array of struct objects in Csound 7?

Tarmo
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

Date2025-03-08 10:59
Fromvlz
SubjectRe: [Csnd] Csound 7 array of struct
Absolutely



Prof. Victor Lazzarini
Maynooth University
Ireland

On 8 Mar 2025, at 08:58, Tarmo Johannes <trmjhnns@gmail.com> wrote:


Hi!

Can I and how can I declare an array of struct objects in Csound 7?

Tarmo
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

Date2025-03-08 11:34
FromTarmo Johannes
SubjectRe: [Csnd] Csound 7 array of struct
This is very, very nice, thanks!

Now, if I want to fill the array, there is probably not other way than somethilng like:

var[0].imaginary = 1
var[0].real=2

var[1].imaginary = 3
var[1].real=4

etc? Of course, I could have an one-dimensional array  like 
iValues fillarray 1,2, 3, 4

  and to write a couple lines of code ot fill the array.

It probably still makes sense as it makes the overall code more readable.

Best!
tarmo






Kontakt vlz (<viclazzarini@gmail.com>) kirjutas kuupäeval L, 8. märts 2025 kell 12:59:
Absolutely



Prof. Victor Lazzarini
Maynooth University
Ireland

On 8 Mar 2025, at 08:58, Tarmo Johannes <trmjhnns@gmail.com> wrote:


Hi!

Can I and how can I declare an array of struct objects in Csound 7?

Tarmo
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

Date2025-03-08 13:05
Fromvlz
SubjectRe: [Csnd] Csound 7 array of struct
Fillarray will likely give you a syntax error if you try to use it with anything but the types it's designed for (like i-, k-)


Prof. Victor Lazzarini
Maynooth University
Ireland

On 8 Mar 2025, at 11:35, Tarmo Johannes <trmjhnns@gmail.com> wrote:


This is very, very nice, thanks!

Now, if I want to fill the array, there is probably not other way than somethilng like:

var[0].imaginary = 1
var[0].real=2

var[1].imaginary = 3
var[1].real=4

etc? Of course, I could have an one-dimensional array  like 
iValues fillarray 1,2, 3, 4

  and to write a couple lines of code ot fill the array.

It probably still makes sense as it makes the overall code more readable.

Best!
tarmo






Kontakt vlz (<viclazzarini@gmail.com>) kirjutas kuupäeval L, 8. märts 2025 kell 12:59:
Absolutely



Prof. Victor Lazzarini
Maynooth University
Ireland

On 8 Mar 2025, at 08:58, Tarmo Johannes <trmjhnns@gmail.com> wrote:


Hi!

Can I and how can I declare an array of struct objects in Csound 7?

Tarmo
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