Csound Csound-dev Csound-tekno Search About

[Csnd-dev] csoundGetNchnls()..issue..

Date2017-05-07 10:38
FromRory Walsh
Subject[Csnd-dev] csoundGetNchnls()..issue..
It seems that any instrument with an error will cause Csound to return 1 as the number of channels regardless of what nchnls is set to. In my modular system I need to know the desired number of channels for any instrument regardless of errors. Is there anyway this could be modified so that it always reports what the user has set as nchnls?  

Date2017-05-07 16:02
Fromjpff
SubjectRe: [Csnd-dev] csoundGetNchnls()..issue..
the code just returns csound->nchnls so a example would helpto idetify t 
problem

PUBLIC uint32_t csoundGetNchnls(CSOUND *csound)
{
     return csound->nchnls;
}


On Sun, 7 May 2017, Rory Walsh wrote:

> It seems that any instrument with an error will cause Csound to return 1 as
> the number of channels regardless of what nchnls is set to. In my modular
> system I need to know the desired number of channels for any instrument
> regardless of errors. Is there anyway this could be modified so that it always
> reports what the user has set as nchnls?  
> 
>

Date2017-05-07 16:56
FromRory Walsh
SubjectRe: [Csnd-dev] csoundGetNchnls()..issue..
AttachmentscompileCSDNchnls.cpp  test.csd  
Attached is a simple example. When the test.csd file is fine my program reports two channels. When there is an error is reports only one. I would rather it reports what is declared in nchnls at all times?  

On 7 May 2017 at 16:02, jpff <jpff@codemist.co.uk> wrote:
the code just returns csound->nchnls so a example would helpto idetify t problem

PUBLIC uint32_t csoundGetNchnls(CSOUND *csound)
{
    return csound->nchnls;

}


On Sun, 7 May 2017, Rory Walsh wrote:

It seems that any instrument with an error will cause Csound to return 1 as
the number of channels regardless of what nchnls is set to. In my modular
system I need to know the desired number of channels for any instrument
regardless of errors. Is there anyway this could be modified so that it always
reports what the user has set as nchnls?  



Date2017-05-07 19:48
Fromjpff
SubjectRe: [Csnd-dev] csoundGetNchnls()..issue..
Sorry cannot help as cannot build your code; but I notice you do not check 
retu value of csound->CompileCcd which should indicate an error so this 
field will still  be at defalt value


On Sun, 7 May 2017, Rory Walsh wrote:

> Attached is a simple example. When the test.csd file is fine my program
> reports two channels. When there is an error is reports only one. I would
> rather it reports what is declared in nchnls at all times?  
> 
> On 7 May 2017 at 16:02, jpff  wrote:
>       the code just returns csound->nchnls so a example would helpto
>       idetify t problem
>
>       PUBLIC uint32_t csoundGetNchnls(CSOUND *csound)
>       {
>           return csound->nchnls;
>       }
> 
>
>       On Sun, 7 May 2017, Rory Walsh wrote:
>
>             It seems that any instrument with an error will cause
>             Csound to return 1 as
>             the number of channels regardless of what nchnls is
>             set to. In my modular
>             system I need to know the desired number of channels
>             for any instrument
>             regardless of errors. Is there anyway this could be
>             modified so that it always
>             reports what the user has set as nchnls?  
> 
> 
> 
>

Date2017-05-07 19:54
FromVictor Lazzarini
SubjectRe: [Csnd-dev] csoundGetNchnls()..issue..
I don’t think it’s possible because the error might happen before nchnls is set.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 7 May 2017, at 16:56, Rory Walsh  wrote:
> 
> Attached is a simple example. When the test.csd file is fine my program reports two channels. When there is an error is reports only one. I would rather it reports what is declared in nchnls at all times?  
> 
> On 7 May 2017 at 16:02, jpff  wrote:
> the code just returns csound->nchnls so a example would helpto idetify t problem
> 
> PUBLIC uint32_t csoundGetNchnls(CSOUND *csound)
> {
>     return csound->nchnls;
> 
> }
> 
> 
> On Sun, 7 May 2017, Rory Walsh wrote:
> 
> It seems that any instrument with an error will cause Csound to return 1 as
> the number of channels regardless of what nchnls is set to. In my modular
> system I need to know the desired number of channels for any instrument
> regardless of errors. Is there anyway this could be modified so that it always
> reports what the user has set as nchnls?  
> 
> 
> 

Date2017-05-07 19:56
FromRory Walsh
SubjectRe: [Csnd-dev] csoundGetNchnls()..issue..
I've always assumed that the header information is read first when Csound parses an orchestra?  

On 7 May 2017 at 19:54, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I don’t think it’s possible because the error might happen before nchnls is set.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 7 May 2017, at 16:56, Rory Walsh <rorywalsh@ear.ie> wrote:
>
> Attached is a simple example. When the test.csd file is fine my program reports two channels. When there is an error is reports only one. I would rather it reports what is declared in nchnls at all times?
>
> On 7 May 2017 at 16:02, jpff <jpff@codemist.co.uk> wrote:
> the code just returns csound->nchnls so a example would helpto idetify t problem
>
> PUBLIC uint32_t csoundGetNchnls(CSOUND *csound)
> {
>     return csound->nchnls;
>
> }
>
>
> On Sun, 7 May 2017, Rory Walsh wrote:
>
> It seems that any instrument with an error will cause Csound to return 1 as
> the number of channels regardless of what nchnls is set to. In my modular
> system I need to know the desired number of channels for any instrument
> regardless of errors. Is there anyway this could be modified so that it always
> reports what the user has set as nchnls?
>
>
> <compileCSDNchnls.cpp><test.csd>



Date2017-05-07 20:03
Fromjpff
SubjectRe: [Csnd-dev] csoundGetNchnls()..issue..
Not so; it parses te orc completely before actig on it so as not to 
mislead

Return values should be checked.

On Sun, 7 May 2017, Rory Walsh wrote:

> I've always assumed that the header information is read first when Csound
> parses an orchestra?  
> 
> On 7 May 2017 at 19:54, Victor Lazzarini  wrote:
>       I don’t think it’s possible because the error might happen before
>       nchnls is set.
>       ========================
>       Prof. Victor Lazzarini
>       Dean of Arts, Celtic Studies, and Philosophy,
>       Maynooth University,
>       Maynooth, Co Kildare, Ireland
>       Tel: 00 353 7086936
>       Fax: 00 353 1 7086952
>
>       > On 7 May 2017, at 16:56, Rory Walsh  wrote:
>       >
>       > Attached is a simple example. When the test.csd file is fine my
>       program reports two channels. When there is an error is reports
>       only one. I would rather it reports what is declared in nchnls at
>       all times?
>       >
>       > On 7 May 2017 at 16:02, jpff  wrote:
>       > the code just returns csound->nchnls so a example would helpto
>       idetify t problem
>       >
>       > PUBLIC uint32_t csoundGetNchnls(CSOUND *csound)
>       > {
>       >     return csound->nchnls;
>       >
>       > }
>       >
>       >
>       > On Sun, 7 May 2017, Rory Walsh wrote:
>       >
>       > It seems that any instrument with an error will cause Csound to
>       return 1 as
>       > the number of channels regardless of what nchnls is set to. In
>       my modular
>       > system I need to know the desired number of channels for any
>       instrument
>       > regardless of errors. Is there anyway this could be modified so
>       that it always
>       > reports what the user has set as nchnls?
>       >
>       >
> > 
> 
> 
> 
>

Date2017-05-07 20:03
FromVictor Lazzarini
SubjectRe: [Csnd-dev] csoundGetNchnls()..issue..
The orchestra is parsed, if there is an error, it fails there and will not compile. 
The setting of nchnls is done in the compilation stage.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 7 May 2017, at 19:56, Rory Walsh  wrote:
> 
> I've always assumed that the header information is read first when Csound parses an orchestra?  
> 
> On 7 May 2017 at 19:54, Victor Lazzarini  wrote:
> I don’t think it’s possible because the error might happen before nchnls is set.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 7 May 2017, at 16:56, Rory Walsh  wrote:
> >
> > Attached is a simple example. When the test.csd file is fine my program reports two channels. When there is an error is reports only one. I would rather it reports what is declared in nchnls at all times?
> >
> > On 7 May 2017 at 16:02, jpff  wrote:
> > the code just returns csound->nchnls so a example would helpto idetify t problem
> >
> > PUBLIC uint32_t csoundGetNchnls(CSOUND *csound)
> > {
> >     return csound->nchnls;
> >
> > }
> >
> >
> > On Sun, 7 May 2017, Rory Walsh wrote:
> >
> > It seems that any instrument with an error will cause Csound to return 1 as
> > the number of channels regardless of what nchnls is set to. In my modular
> > system I need to know the desired number of channels for any instrument
> > regardless of errors. Is there anyway this could be modified so that it always
> > reports what the user has set as nchnls?
> >
> >
> > 

Date2017-05-07 20:14
FromRory Walsh
SubjectRe: [Csnd-dev] csoundGetNchnls()..issue..
Darn it. I guess I'll have to parse the orchestra myself.

On 7 May 2017 at 20:03, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
The orchestra is parsed, if there is an error, it fails there and will not compile.
The setting of nchnls is done in the compilation stage.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 7 May 2017, at 19:56, Rory Walsh <rorywalsh@ear.ie> wrote:
>
> I've always assumed that the header information is read first when Csound parses an orchestra?
>
> On 7 May 2017 at 19:54, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> I don’t think it’s possible because the error might happen before nchnls is set.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 7 May 2017, at 16:56, Rory Walsh <rorywalsh@ear.ie> wrote:
> >
> > Attached is a simple example. When the test.csd file is fine my program reports two channels. When there is an error is reports only one. I would rather it reports what is declared in nchnls at all times?
> >
> > On 7 May 2017 at 16:02, jpff <jpff@codemist.co.uk> wrote:
> > the code just returns csound->nchnls so a example would helpto idetify t problem
> >
> > PUBLIC uint32_t csoundGetNchnls(CSOUND *csound)
> > {
> >     return csound->nchnls;
> >
> > }
> >
> >
> > On Sun, 7 May 2017, Rory Walsh wrote:
> >
> > It seems that any instrument with an error will cause Csound to return 1 as
> > the number of channels regardless of what nchnls is set to. In my modular
> > system I need to know the desired number of channels for any instrument
> > regardless of errors. Is there anyway this could be modified so that it always
> > reports what the user has set as nchnls?
> >
> >
> > <compileCSDNchnls.cpp><test.csd>
>
>