I have created some web request plugin opcodes, which allow GET and POST requests to be made from Csound at init time and k-rate, using libcurl. These can be used with the JSON opcodes I wrote, to allow for interacting with web services. May be of use to someone - my main motivation for these is to store/obtain state information on a server, eg presets etc.
I’d like to see a variation of this built-in to csound one day (e.g. import “https://my-csound-udo-file.com”)
json being built-in would be even of higher importance (for later not necessarily csound7), I didn’t know you’ve made json opcode, nice <3
Very cool! This can be super useful in some context, like interactive works getting data from some web hosted live statistics or otherwise.
Thanks for this!
tarmo
Kontakt Richard Knight (<richard@1bpm.net>) kirjutas kuupäeval K, 10. aprill 2024 kell 01:35:
I have created some web request plugin opcodes, which allow GET and POST
requests to be made from Csound at init time and k-rate, using libcurl.
These can be used with the JSON opcodes I wrote, to allow for
interacting with web services. May be of use to someone - my main
motivation for these is to store/obtain state information on a server,
eg presets etc.
#include works with any URL that CURL can handle - if Csound has been built with CURL - I think that does what you are mentioning in the first line there… It does have a brief mention on the #include man page
If the version of Csound is built with the CURL library the filename in an #include statement can be an URL, recognised by including the substring “://” in the name. This will include text via protocols such as http, https, and ftp.
Yes json built-in would be nice. It’s a bit of an awkward one to handle in a non object based form / without associative arrays and such, so there may be some things in the future of Csound that make it easier to manipulate json.