[Csnd-dev] New API function
Date | 2016-10-02 15:59 |
From | Francois PINOT |
Subject | [Csnd-dev] New API function |
Hello Victor, I tried your new csoundGetOutputFormat function with this code:#include <csound/csound.h> int main(int argc, char **argv) { int result; char *type = "dummy"; char *format = "dummy--"; CSOUND *csound = csoundCreate(NULL); result = csoundCompile(csound, argc, (const char **)argv); if (result == 0) { csoundSetOutput(csound, "myfile", "wav", "float"); csoundGetOutputFormat(csound, type, format); printf("%s, %s\n", type, format); } csoundDestroy(csound); return (result >= 0 ? 0 : result); } |
Date | 2016-10-02 16:12 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] New API function |
You need to give it some memory: char type[6]; char format[8]; Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 2 Oct 2016, at 15:59, Francois PINOT |
Date | 2016-10-02 16:20 |
From | Francois PINOT |
Subject | Re: [Csnd-dev] New API function |
It doesn't change anything: char type = "dummy" or char type[6] yield the same result... 2016-10-02 17:12 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: You need to give it some memory: |
Date | 2016-10-02 16:31 |
From | Francois PINOT |
Subject | Re: [Csnd-dev] New API function |
Could you try my code on your system: char *type = "dummy" and char type[6] should be equivalent... François2016-10-02 17:20 GMT+02:00 Francois PINOT <fggpinot@gmail.com>:
|
Date | 2016-10-02 17:56 |
From | Francois PINOT |
Subject | Re: [Csnd-dev] New API function |
I get the same segmentation fault with both flavors. 2016-10-02 18:52 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: Should they? "dummy" is a constant and char * is pointing to it, so |
Date | 2016-10-02 18:56 |
From | Francois PINOT |
Subject | Re: [Csnd-dev] New API function |
Just rebuilt Csound from github, but still seg fault... 2016-10-02 19:24 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: Fixed. Thanks. |
Date | 2016-10-02 19:05 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] New API function |
it's working here. I wonder if the commit did not work Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland
|
Date | 2016-10-02 19:54 | |
From | Francois PINOT | |
Subject | Re: [Csnd-dev] New API function | |
Here I still get a seg fault even with your version... 2016-10-02 20:12 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: but using |
Date | 2016-10-02 20:01 | |
From | Francois PINOT | |
Subject | Re: [Csnd-dev] New API function | |
Repulled and now it's working. Thank you Victor. François2016-10-02 20:12 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: but using |
Date | 2016-10-03 03:09 | |
From | Francois PINOT | |
Subject | Re: [Csnd-dev] New API function | |
If the output format has been defined either by a call to csoundSetOutput or by the compilation of a csd file, csoundGetOutputFormat works fine. But if the output format has not been set, we get a seg fault like in the following example: Is it normal behavior or should we have default values?int main(int argc, char **argv) { int result; char type[6]; char format[8]; CSOUND *csound = csoundCreate(NULL); //csoundSetOutput(csound, "myfile", "wav", "float"); csoundGetOutputFormat(csound, type, format); printf("%s, %s\n", type, format); csoundDestroy(csound); return (result >= 0 ? 0 : result); } 2016-10-02 21:14 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: Thanks for checking it. |
Date | 2016-10-03 15:34 | |
From | Francois PINOT | |
Subject | Re: [Csnd-dev] New API function | |
Thank you Victor. Now in ctcsound. François2016-10-03 9:54 GMT+02:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>: The segfault was a bug. I fixed it. |
Date | 2016-10-03 15:37 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] New API function |
Attachments | None |