Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] setoption not overriding when compileCsd used
Steven Yi <[email protected]> Wed, 5 Nov 2025 19:44:00 -0500
| Newsgroups | gmane.comp.audio.csound.devel |
|---|---|
| Message-ID | <CANtcCs7pL3Fk2QzcAvhEF8YyUnjgfOwdr28HS3hWBQEpCb-0og@mail.gmail.com> |
Setting it after compileCsd looks to be working. It's odd as in other scenarios where I use compileOrc with string text, I usually call setOption() prior to compileOrc. I'll review some things and sort it out. Thanks for that! On Wed, Nov 5, 2025 at 6:59 PM Victor Lazzarini <[email protected]> wrote: > > 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