[Csnd] Any one interested: implementing a kind of object/struct in Csound?
Date | 2020-08-08 16:31 |
From | "Jeanette C." |
Subject | [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
Hey hey, I had the idea that I could write an article/guide on how to implement a kind of object or struct in Csound by using UDOs. This would be somewhat like the FILE struct in C. It has storage, a lifetime, can be manipulated and queried and be save to/loaded from disk. It could even have primitive error handling, has a "sort of typesafety" and is fun. :) I just began and then noticed that such an article would mean some work after all. :) So I thought, I might ask first if someone is interested and if there would be a good home for such an article somewhere central. Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * SoundCloud: https://soundcloud.com/jeanette_c * Twitter: https://twitter.com/jeanette_c_s * Audiobombs: https://www.audiobombs.com/users/jeanette_c * GitHub: https://github.com/jeanette-c I believe We all have one true love Somewhere in this world <3 (Britney Spears) 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 |
Date | 2020-08-08 19:03 |
From | Steven Yi |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
Not quite sure what this will look like, but sounds interesting! I should note that the feature/parser3 branch has had user-defined structs for the past number of years. Hopefully we'll get on with CS7 after this release and can work on bringing that up to date and polished. On Sat, Aug 8, 2020 at 11:31 AM Jeanette C. <julien@mail.upb.de> wrote: Hey hey, |
Date | 2020-08-08 19:20 |
From | Joseph Hughes |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
I would read that article On Sat, Aug 8, 2020 at 2:04 PM Steven Yi <stevenyi@gmail.com> wrote:
|
Date | 2020-08-08 19:47 |
From | Justin Smith |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
I've experimented with some success in this style of programming in csound myself. Using a table where specific parameters are stored at offsets in a fixed pattern (the way C structs are implemented in fact). I'm reluctant to share the work because it's a young project, and the first of its kind for me, and my past experience with software design tells me this is the sort of thing that needs 1000 hours of contemplation for each hour of writing code or you leave yourself with bad choices that are nearly impossible to back out of. With this talk of OO, and data structures in csound, it's very likely I'll stop using csound as my preferred language for DSP (or use the "old version" without these abstractions). Most languages (and especially ones that emphasize Objects) make bad trade offs in both their design of such things, and the idioms the community adopts in using them. I come to csound as a relief from these constraints. On Sat, Aug 8, 2020 at 11:20 AM Joseph Hughes |
Date | 2020-08-08 20:23 |
From | Dave Seidel |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
I think it's a bit premature to consider ditching Csound just because these new features might get added. Remember, one of the prime directives regarding Csound development is to preserve backwards compatibility. The addition of new capabilities will never make existing code or techniques obsolete or unusable. As a good example, the functional orchestra syntax added in Csound 5 didn't make the classic ASM-style code stop working, or work any differently. Just because new syntax is added it doesn't mean you have to use it. On Sat, Aug 8, 2020 at 2:47 PM Justin Smith <noisesmith@gmail.com> wrote: I've experimented with some success in this style of programming in |
Date | 2020-08-08 20:51 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
I guess it should be possible to implement lookup tables with csound-macros and tables. That wouldn't need any internal change. But it would be a macrophobic's nightmare. On Sat, 8 Aug 2020 at 21:23, Dave Seidel <dave.seidel@gmail.com> wrote:
|
Date | 2020-08-08 20:57 |
From | Dave Seidel |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
Hah, yes, "macrophobic's nightmare" takes me back decades to my C days, when I certainly committed a few of such crimes. :-) Much happier these days with Python and (increasingly) Kotlin. On Sat, Aug 8, 2020 at 3:51 PM Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
|
Date | 2020-08-08 20:59 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
Justin Smith, I agree with you but I'm not sure I'm approaching that view from same place. I guess my point of view is that csound would be a turnoff to me too if it were to be strictly typed or ceremonial like java, keep it flexible, hacky, forgiving and non-opinionated. But knowing you're very familiar with clojure, I'd say that expressiveness is very much lacking in Csound which Clojure excels at, and writing a musical piece, being able to specify 1000 different notes in 20~30 chars, would open creativity, simply via not writing every single statement verbosly. On Sat, 8 Aug 2020 at 21:51, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
|
Date | 2020-08-09 00:45 |
From | Justin Smith |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
I'm quite fond of Clojure as a language for back end services. It's poorly suited for real time audio processing. There are existing bindings to use Csound with Python, Lua, C++, Java, and other languages. It's also trivial to generate note lists from Clojure, or any other language where it's trivial to print strings. You can write new Csound opcodes in any language that can create shared objects recognizable by your C runtime (and they'll be usable if you can write code that doesn't allocate memory inside perf time subprograms). My admittedly grumpy concern is that what I find interesting about Csound would be neglected in favor of features that I can already get from hundreds of other projects (SuperCollider in particular does a great job of making performant object oriented code to generate audio, and has great filters and pattern generation objects, I enjoyed it for a while but came back to Csound for a reason). On Sat, Aug 8, 2020 at 12:59 PM Hlöðver Sigurðsson |
Date | 2020-08-09 01:19 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
The extremely conservative evolution of Csound has been it's strength compared to Supercollider, which jumped on the server and multicore bandwagon, making it very unportable, hard to install and hard to maintain. But I feel it's sad that the only way to be expressive is to rely on the API, because it completely ignores Csound as synthesizer and language capable of creating loops and patterns internally. For me Csound has the best sound and is the easiest audio programming language to port it into other systems. But as a language it's great for designing synths, with easy to read flows (mentally visualizing the diagram is very easy). But as live-coding, creative and composing tool, Csound is still in the middle ages. There are many things to learn from Lua, Java, Python, SuperCollider and the populist winner JavaScript. But a small backwards compatible additions to csound the language like first class functions would alone be a huge step forwards. On Sun, 9 Aug 2020 at 01:46, Justin Smith <noisesmith@gmail.com> wrote: I'm quite fond of Clojure as a language for back end services. It's |
Date | 2020-08-10 23:14 |
From | Steven Yi |
Subject | Re: [Csnd] Any one interested: implementing a kind of object/struct in Csound? |
Well the way I frame this in thinking about Csound is "how do I solve use case x?". For a large part of Csound's codebase, the existing data types are sufficient and appropriate and I don't see anything new that would replace that. Those are use cases that are sufficiently supported with known solutions that are optimal (at least, IMO). On the other hand, there are use cases which are not supported well with the existing datatypes or abstractions. One has to abuse the existing abstractions and data types to get a problem solved. It is for the cases that aren't supported well (or not at all) that introducing new language features makes sense to me. As for OOP, I think that is a separate matter than user-defined types. I don't see the latter as being incongruent with the existing coding practices of Csound, just opening up more of what could be developed by users in user-code without having to drop down to C. It's generally at really low-level or high-level code that I see UDTs becoming useful, areas that aren't covered by existing data types/opcodes. I don't imagine the proposed changes will invalidate any existing practice (or even overlap), so nothing to worry about. On Sat, Aug 8, 2020 at 2:47 PM Justin Smith <noisesmith@gmail.com> wrote: I've experimented with some success in this style of programming in |