Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] setoption not overriding when compileCsd used
Victor Lazzarini <[email protected]> Wed, 5 Nov 2025 23:59:41 +0000
| Newsgroups | gmane.comp.audio.csound.devel |
|---|---|
| Message-ID | <[email protected]> |
I think the call order may be the factor here. csoundSetOption() is called and then the CSD is read, setting the options again. I think that if it is called after the CSD is read, then it will override it, but not before. If you look at the code, csoundSetOption() calls argdecode to set the options passed to it. Then the csoundCompileCSD() reads the CSD and calls argdecode to do the same. So I think basically it can override previously set options. As far as I can remember, this was also how the 6.x API worked (the functions did not change in that regard). Prof. Victor Lazzarini Maynooth University Ireland > On 5 Nov 2025, at 23:14, Steven Yi <[email protected]> wrote: > > *Warning* > > This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe. > > Hi All, > > Not sure if it's just me but I'm working on a webaudio example and > found that if I had "-Wooutput.wav" in CsOptions in a csd, then in my > code used: > > cs.setOption("-odac") > cs.compileCsd("test.csd", 0) > > the setOption would not override the csd's CsOptions. I was expecting > setOption to override in the same way that: > > csound -odac test.csd > > would have the command-line option override the CsOptions. > > Wondering if this is a bug in the API? > > Steven