Csound Csound-dev Csound-tekno Search About

[Cs-dev] sample size functions

Date2013-03-18 05:15
FromAndres Cabrera
Subject[Cs-dev] sample size functions
Hi,

What's the difference between these three functions?

PUBLIC int  	csoundGetSampleFormat (CSOUND *)
 	Returns the sample format.
PUBLIC int 	csoundGetSampleSize (CSOUND *)
 	Returns the size in bytes of a single sample.
PUBLIC int 	csoundGetSizeOfMYFLT (void)
 	Return the size of MYFLT in bytes.

I suspect one of those mught refer to the sample format of the audio
file, but wouldn't one of the other two be redundant?

Cheers,
Andrés

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https:

Date2013-03-18 10:49
FromSteven Yi
SubjectRe: [Cs-dev] sample size functions
Hi Andres,

I don't think these are redundant, but should be better commented.
Commentary inline below:

PUBLIC int      csoundGetSampleFormat (CSOUND *)
        Returns the sample format (i.e. AE_SHORT, AE_LONG, AE_FLOAT, etc.)

Oddly, I see these constants defined only in fgens.c:

static const int gen01_format_table[11] = {
    0,
    0,          AE_CHAR,    AE_ALAW,    AE_ULAW,    AE_SHORT,
    AE_LONG,    AE_FLOAT,   AE_UNCH,    AE_24INT,   AE_DOUBLE
};

So, I wonder, are these even public for API users to compare against?
I don't see them when using "import csnd; dir(csnd)" in python...


PUBLIC int      csoundGetSampleSize (CSOUND *)
        Returns the size in bytes of a single sample. i.e. 2 (16bit),
3(24bit), 4(32bit), 8 (double)

This is resolved in libsnd_u.c:

int sfsampsize(int type)

{

    switch (type & SF_FORMAT_SUBMASK) {
      case SF_FORMAT_PCM_16:  return 2;     /* Signed 16 bit data */
      case SF_FORMAT_PCM_32:  return 4;     /* Signed 32 bit data */
      case SF_FORMAT_FLOAT:   return 4;     /* 32 bit float data */
      case SF_FORMAT_PCM_24:  return 3;     /* Signed 24 bit data */
      case SF_FORMAT_DOUBLE:  return 8;     /* 64 bit float data */
    }

    return 1;
}




PUBLIC int      csoundGetSizeOfMYFLT (void)
        Return the size of MYFLT in bytes. Typically 4 bytes for
MYFLT=float, and 8 bytes for MYFLT=double, but will depend on
sizeof(float) and sizeof(double) on the host architecture.



At least, that's how I understand it. :)

steven

On Mon, Mar 18, 2013 at 5:15 AM, Andres Cabrera  wrote:
> Hi,
>
> What's the difference between these three functions?
>
> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>         Returns the sample format.
> PUBLIC int      csoundGetSampleSize (CSOUND *)
>         Returns the size in bytes of a single sample.
> PUBLIC int      csoundGetSizeOfMYFLT (void)
>         Return the size of MYFLT in bytes.
>
> I suspect one of those mught refer to the sample format of the audio
> file, but wouldn't one of the other two be redundant?
>
> Cheers,
> Andrés
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-03-18 12:45
FromMichael Gogins
SubjectRe: [Cs-dev] sample size functions
I think better names instead of better comments:

csoundGetAudioOutputStreamFormat
csoundGetAudioOutputSampleSize
csoundGetAudioInternalSampleSize

On Mon, Mar 18, 2013 at 6:49 AM, Steven Yi  wrote:
> Hi Andres,
>
> I don't think these are redundant, but should be better commented.
> Commentary inline below:
>
> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>         Returns the sample format (i.e. AE_SHORT, AE_LONG, AE_FLOAT, etc.)
>
> Oddly, I see these constants defined only in fgens.c:
>
> static const int gen01_format_table[11] = {
>     0,
>     0,          AE_CHAR,    AE_ALAW,    AE_ULAW,    AE_SHORT,
>     AE_LONG,    AE_FLOAT,   AE_UNCH,    AE_24INT,   AE_DOUBLE
> };
>
> So, I wonder, are these even public for API users to compare against?
> I don't see them when using "import csnd; dir(csnd)" in python...
>
>
> PUBLIC int      csoundGetSampleSize (CSOUND *)
>         Returns the size in bytes of a single sample. i.e. 2 (16bit),
> 3(24bit), 4(32bit), 8 (double)
>
> This is resolved in libsnd_u.c:
>
> int sfsampsize(int type)
>
> {
>
>     switch (type & SF_FORMAT_SUBMASK) {
>       case SF_FORMAT_PCM_16:  return 2;     /* Signed 16 bit data */
>       case SF_FORMAT_PCM_32:  return 4;     /* Signed 32 bit data */
>       case SF_FORMAT_FLOAT:   return 4;     /* 32 bit float data */
>       case SF_FORMAT_PCM_24:  return 3;     /* Signed 24 bit data */
>       case SF_FORMAT_DOUBLE:  return 8;     /* 64 bit float data */
>     }
>
>     return 1;
> }
>
>
>
>
> PUBLIC int      csoundGetSizeOfMYFLT (void)
>         Return the size of MYFLT in bytes. Typically 4 bytes for
> MYFLT=float, and 8 bytes for MYFLT=double, but will depend on
> sizeof(float) and sizeof(double) on the host architecture.
>
>
>
> At least, that's how I understand it. :)
>
> steven
>
> On Mon, Mar 18, 2013 at 5:15 AM, Andres Cabrera  wrote:
>> Hi,
>>
>> What's the difference between these three functions?
>>
>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>         Returns the sample format.
>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>         Returns the size in bytes of a single sample.
>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>         Return the size of MYFLT in bytes.
>>
>> I suspect one of those mught refer to the sample format of the audio
>> file, but wouldn't one of the other two be redundant?
>>
>> Cheers,
>> Andrés
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_mar
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-03-20 00:20
FromAndres Cabrera
SubjectRe: [Cs-dev] sample size functions
Hi,

Thanks Steven for the info. I would propose removing the first two of
these functions from the API. I think there is no real reason for them
to be there.

If it's argued that they should be there, I will move them to the FIle
I/O section of the API where thay belong and the formats for
csoundGetSampleFormat should be expanded to include all the currently
used formats. Does this function even return something meaningful
currently, from my quick browse fo the sources it seems those macros
are only relevant for aiff formats...

Cheers,
Andrés

On Mon, Mar 18, 2013 at 5:45 AM, Michael Gogins
 wrote:
> I think better names instead of better comments:
>
> csoundGetAudioOutputStreamFormat
> csoundGetAudioOutputSampleSize
> csoundGetAudioInternalSampleSize
>
> On Mon, Mar 18, 2013 at 6:49 AM, Steven Yi  wrote:
>> Hi Andres,
>>
>> I don't think these are redundant, but should be better commented.
>> Commentary inline below:
>>
>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>         Returns the sample format (i.e. AE_SHORT, AE_LONG, AE_FLOAT, etc.)
>>
>> Oddly, I see these constants defined only in fgens.c:
>>
>> static const int gen01_format_table[11] = {
>>     0,
>>     0,          AE_CHAR,    AE_ALAW,    AE_ULAW,    AE_SHORT,
>>     AE_LONG,    AE_FLOAT,   AE_UNCH,    AE_24INT,   AE_DOUBLE
>> };
>>
>> So, I wonder, are these even public for API users to compare against?
>> I don't see them when using "import csnd; dir(csnd)" in python...
>>
>>
>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>         Returns the size in bytes of a single sample. i.e. 2 (16bit),
>> 3(24bit), 4(32bit), 8 (double)
>>
>> This is resolved in libsnd_u.c:
>>
>> int sfsampsize(int type)
>>
>> {
>>
>>     switch (type & SF_FORMAT_SUBMASK) {
>>       case SF_FORMAT_PCM_16:  return 2;     /* Signed 16 bit data */
>>       case SF_FORMAT_PCM_32:  return 4;     /* Signed 32 bit data */
>>       case SF_FORMAT_FLOAT:   return 4;     /* 32 bit float data */
>>       case SF_FORMAT_PCM_24:  return 3;     /* Signed 24 bit data */
>>       case SF_FORMAT_DOUBLE:  return 8;     /* 64 bit float data */
>>     }
>>
>>     return 1;
>> }
>>
>>
>>
>>
>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>         Return the size of MYFLT in bytes. Typically 4 bytes for
>> MYFLT=float, and 8 bytes for MYFLT=double, but will depend on
>> sizeof(float) and sizeof(double) on the host architecture.
>>
>>
>>
>> At least, that's how I understand it. :)
>>
>> steven
>>
>> On Mon, Mar 18, 2013 at 5:15 AM, Andres Cabrera  wrote:
>>> Hi,
>>>
>>> What's the difference between these three functions?
>>>
>>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>>         Returns the sample format.
>>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>>         Returns the size in bytes of a single sample.
>>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>>         Return the size of MYFLT in bytes.
>>>
>>> I suspect one of those mught refer to the sample format of the audio
>>> file, but wouldn't one of the other two be redundant?
>>>
>>> Cheers,
>>> Andrés
>>>
>>> ------------------------------------------------------------------------------
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_mar
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> --
> Michael Gogins
> Irreducible Productions
> http://www.michael-gogins.com
> Michael dot Gogins at gmail dot com
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cso

Date2013-03-22 04:02
FromAndres Cabrera
SubjectRe: [Cs-dev] sample size functions
Any thoughts on this? My finger is itching to remove them...

Cheers,
Andrés

On Tue, Mar 19, 2013 at 5:20 PM, Andres Cabrera  wrote:
> Hi,
>
> Thanks Steven for the info. I would propose removing the first two of
> these functions from the API. I think there is no real reason for them
> to be there.
>
> If it's argued that they should be there, I will move them to the FIle
> I/O section of the API where thay belong and the formats for
> csoundGetSampleFormat should be expanded to include all the currently
> used formats. Does this function even return something meaningful
> currently, from my quick browse fo the sources it seems those macros
> are only relevant for aiff formats...
>
> Cheers,
> Andrés
>
> On Mon, Mar 18, 2013 at 5:45 AM, Michael Gogins
>  wrote:
>> I think better names instead of better comments:
>>
>> csoundGetAudioOutputStreamFormat
>> csoundGetAudioOutputSampleSize
>> csoundGetAudioInternalSampleSize
>>
>> On Mon, Mar 18, 2013 at 6:49 AM, Steven Yi  wrote:
>>> Hi Andres,
>>>
>>> I don't think these are redundant, but should be better commented.
>>> Commentary inline below:
>>>
>>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>>         Returns the sample format (i.e. AE_SHORT, AE_LONG, AE_FLOAT, etc.)
>>>
>>> Oddly, I see these constants defined only in fgens.c:
>>>
>>> static const int gen01_format_table[11] = {
>>>     0,
>>>     0,          AE_CHAR,    AE_ALAW,    AE_ULAW,    AE_SHORT,
>>>     AE_LONG,    AE_FLOAT,   AE_UNCH,    AE_24INT,   AE_DOUBLE
>>> };
>>>
>>> So, I wonder, are these even public for API users to compare against?
>>> I don't see them when using "import csnd; dir(csnd)" in python...
>>>
>>>
>>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>>         Returns the size in bytes of a single sample. i.e. 2 (16bit),
>>> 3(24bit), 4(32bit), 8 (double)
>>>
>>> This is resolved in libsnd_u.c:
>>>
>>> int sfsampsize(int type)
>>>
>>> {
>>>
>>>     switch (type & SF_FORMAT_SUBMASK) {
>>>       case SF_FORMAT_PCM_16:  return 2;     /* Signed 16 bit data */
>>>       case SF_FORMAT_PCM_32:  return 4;     /* Signed 32 bit data */
>>>       case SF_FORMAT_FLOAT:   return 4;     /* 32 bit float data */
>>>       case SF_FORMAT_PCM_24:  return 3;     /* Signed 24 bit data */
>>>       case SF_FORMAT_DOUBLE:  return 8;     /* 64 bit float data */
>>>     }
>>>
>>>     return 1;
>>> }
>>>
>>>
>>>
>>>
>>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>>         Return the size of MYFLT in bytes. Typically 4 bytes for
>>> MYFLT=float, and 8 bytes for MYFLT=double, but will depend on
>>> sizeof(float) and sizeof(double) on the host architecture.
>>>
>>>
>>>
>>> At least, that's how I understand it. :)
>>>
>>> steven
>>>
>>> On Mon, Mar 18, 2013 at 5:15 AM, Andres Cabrera  wrote:
>>>> Hi,
>>>>
>>>> What's the difference between these three functions?
>>>>
>>>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>>>         Returns the sample format.
>>>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>>>         Returns the size in bytes of a single sample.
>>>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>>>         Return the size of MYFLT in bytes.
>>>>
>>>> I suspect one of those mught refer to the sample format of the audio
>>>> file, but wouldn't one of the other two be redundant?
>>>>
>>>> Cheers,
>>>> Andrés
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Everyone hates slow websites. So do we.
>>>> Make your web apps faster with AppDynamics
>>>> Download AppDynamics Lite for free today:
>>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_mar
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.

Date2013-03-22 07:16
FromVictor Lazzarini
SubjectRe: [Cs-dev] sample size functions
Fine as far as I am concerned.
On 22 Mar 2013, at 04:02, Andres Cabrera wrote:

> Any thoughts on this? My finger is itching to remove them...
> 
> Cheers,
> Andrés
> 
> On Tue, Mar 19, 2013 at 5:20 PM, Andres Cabrera  wrote:
>> Hi,
>> 
>> Thanks Steven for the info. I would propose removing the first two of
>> these functions from the API. I think there is no real reason for them
>> to be there.
>> 
>> If it's argued that they should be there, I will move them to the FIle
>> I/O section of the API where thay belong and the formats for
>> csoundGetSampleFormat should be expanded to include all the currently
>> used formats. Does this function even return something meaningful
>> currently, from my quick browse fo the sources it seems those macros
>> are only relevant for aiff formats...
>> 
>> Cheers,
>> Andrés
>> 
>> On Mon, Mar 18, 2013 at 5:45 AM, Michael Gogins
>>  wrote:
>>> I think better names instead of better comments:
>>> 
>>> csoundGetAudioOutputStreamFormat
>>> csoundGetAudioOutputSampleSize
>>> csoundGetAudioInternalSampleSize
>>> 
>>> On Mon, Mar 18, 2013 at 6:49 AM, Steven Yi  wrote:
>>>> Hi Andres,
>>>> 
>>>> I don't think these are redundant, but should be better commented.
>>>> Commentary inline below:
>>>> 
>>>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>>>        Returns the sample format (i.e. AE_SHORT, AE_LONG, AE_FLOAT, etc.)
>>>> 
>>>> Oddly, I see these constants defined only in fgens.c:
>>>> 
>>>> static const int gen01_format_table[11] = {
>>>>    0,
>>>>    0,          AE_CHAR,    AE_ALAW,    AE_ULAW,    AE_SHORT,
>>>>    AE_LONG,    AE_FLOAT,   AE_UNCH,    AE_24INT,   AE_DOUBLE
>>>> };
>>>> 
>>>> So, I wonder, are these even public for API users to compare against?
>>>> I don't see them when using "import csnd; dir(csnd)" in python...
>>>> 
>>>> 
>>>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>>>        Returns the size in bytes of a single sample. i.e. 2 (16bit),
>>>> 3(24bit), 4(32bit), 8 (double)
>>>> 
>>>> This is resolved in libsnd_u.c:
>>>> 
>>>> int sfsampsize(int type)
>>>> 
>>>> {
>>>> 
>>>>    switch (type & SF_FORMAT_SUBMASK) {
>>>>      case SF_FORMAT_PCM_16:  return 2;     /* Signed 16 bit data */
>>>>      case SF_FORMAT_PCM_32:  return 4;     /* Signed 32 bit data */
>>>>      case SF_FORMAT_FLOAT:   return 4;     /* 32 bit float data */
>>>>      case SF_FORMAT_PCM_24:  return 3;     /* Signed 24 bit data */
>>>>      case SF_FORMAT_DOUBLE:  return 8;     /* 64 bit float data */
>>>>    }
>>>> 
>>>>    return 1;
>>>> }
>>>> 
>>>> 
>>>> 
>>>> 
>>>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>>>        Return the size of MYFLT in bytes. Typically 4 bytes for
>>>> MYFLT=float, and 8 bytes for MYFLT=double, but will depend on
>>>> sizeof(float) and sizeof(double) on the host architecture.
>>>> 
>>>> 
>>>> 
>>>> At least, that's how I understand it. :)
>>>> 
>>>> steven
>>>> 
>>>> On Mon, Mar 18, 2013 at 5:15 AM, Andres Cabrera  wrote:
>>>>> Hi,
>>>>> 
>>>>> What's the difference between these three functions?
>>>>> 
>>>>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>>>>        Returns the sample format.
>>>>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>>>>        Returns the size in bytes of a single sample.
>>>>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>>>>        Return the size of MYFLT in bytes.
>>>>> 
>>>>> I suspect one of those mught refer to the sample format of the audio
>>>>> file, but wouldn't one of the other two be redundant?
>>>>> 
>>>>> Cheers,
>>>>> Andrés
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Everyone hates slow websites. So do we.
>>>>> Make your web apps faster with AppDynamics
>>>>> Download AppDynamics Lite for free today:
>>>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Everyone hates slow websites. So do we.
>>>> Make your web apps faster with AppDynamics
>>>> Download AppDynamics Lite for free today:
>>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> 
>>> 
>>> 
>>> --
>>> Michael Gogins
>>> Irreducible Productions
>>> http://www.michael-gogins.com
>>> Michael dot Gogins at gmail dot com
>>> 
>>> ------------------------------------------------------------------------------
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-03-25 17:05
FromAndres Cabrera
SubjectRe: [Cs-dev] sample size functions
OK, unless there are objections, these will be gone today.

Cheers,
Andrés

On Fri, Mar 22, 2013 at 12:16 AM, Victor Lazzarini
 wrote:
> Fine as far as I am concerned.
> On 22 Mar 2013, at 04:02, Andres Cabrera wrote:
>
>> Any thoughts on this? My finger is itching to remove them...
>>
>> Cheers,
>> Andrés
>>
>> On Tue, Mar 19, 2013 at 5:20 PM, Andres Cabrera  wrote:
>>> Hi,
>>>
>>> Thanks Steven for the info. I would propose removing the first two of
>>> these functions from the API. I think there is no real reason for them
>>> to be there.
>>>
>>> If it's argued that they should be there, I will move them to the FIle
>>> I/O section of the API where thay belong and the formats for
>>> csoundGetSampleFormat should be expanded to include all the currently
>>> used formats. Does this function even return something meaningful
>>> currently, from my quick browse fo the sources it seems those macros
>>> are only relevant for aiff formats...
>>>
>>> Cheers,
>>> Andrés
>>>
>>> On Mon, Mar 18, 2013 at 5:45 AM, Michael Gogins
>>>  wrote:
>>>> I think better names instead of better comments:
>>>>
>>>> csoundGetAudioOutputStreamFormat
>>>> csoundGetAudioOutputSampleSize
>>>> csoundGetAudioInternalSampleSize
>>>>
>>>> On Mon, Mar 18, 2013 at 6:49 AM, Steven Yi  wrote:
>>>>> Hi Andres,
>>>>>
>>>>> I don't think these are redundant, but should be better commented.
>>>>> Commentary inline below:
>>>>>
>>>>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>>>>        Returns the sample format (i.e. AE_SHORT, AE_LONG, AE_FLOAT, etc.)
>>>>>
>>>>> Oddly, I see these constants defined only in fgens.c:
>>>>>
>>>>> static const int gen01_format_table[11] = {
>>>>>    0,
>>>>>    0,          AE_CHAR,    AE_ALAW,    AE_ULAW,    AE_SHORT,
>>>>>    AE_LONG,    AE_FLOAT,   AE_UNCH,    AE_24INT,   AE_DOUBLE
>>>>> };
>>>>>
>>>>> So, I wonder, are these even public for API users to compare against?
>>>>> I don't see them when using "import csnd; dir(csnd)" in python...
>>>>>
>>>>>
>>>>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>>>>        Returns the size in bytes of a single sample. i.e. 2 (16bit),
>>>>> 3(24bit), 4(32bit), 8 (double)
>>>>>
>>>>> This is resolved in libsnd_u.c:
>>>>>
>>>>> int sfsampsize(int type)
>>>>>
>>>>> {
>>>>>
>>>>>    switch (type & SF_FORMAT_SUBMASK) {
>>>>>      case SF_FORMAT_PCM_16:  return 2;     /* Signed 16 bit data */
>>>>>      case SF_FORMAT_PCM_32:  return 4;     /* Signed 32 bit data */
>>>>>      case SF_FORMAT_FLOAT:   return 4;     /* 32 bit float data */
>>>>>      case SF_FORMAT_PCM_24:  return 3;     /* Signed 24 bit data */
>>>>>      case SF_FORMAT_DOUBLE:  return 8;     /* 64 bit float data */
>>>>>    }
>>>>>
>>>>>    return 1;
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>>>>        Return the size of MYFLT in bytes. Typically 4 bytes for
>>>>> MYFLT=float, and 8 bytes for MYFLT=double, but will depend on
>>>>> sizeof(float) and sizeof(double) on the host architecture.
>>>>>
>>>>>
>>>>>
>>>>> At least, that's how I understand it. :)
>>>>>
>>>>> steven
>>>>>
>>>>> On Mon, Mar 18, 2013 at 5:15 AM, Andres Cabrera  wrote:
>>>>>> Hi,
>>>>>>
>>>>>> What's the difference between these three functions?
>>>>>>
>>>>>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>>>>>        Returns the sample format.
>>>>>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>>>>>        Returns the size in bytes of a single sample.
>>>>>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>>>>>        Return the size of MYFLT in bytes.
>>>>>>
>>>>>> I suspect one of those mught refer to the sample format of the audio
>>>>>> file, but wouldn't one of the other two be redundant?
>>>>>>
>>>>>> Cheers,
>>>>>> Andrés
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Everyone hates slow websites. So do we.
>>>>>> Make your web apps faster with AppDynamics
>>>>>> Download AppDynamics Lite for free today:
>>>>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Everyone hates slow websites. So do we.
>>>>> Make your web apps faster with AppDynamics
>>>>> Download AppDynamics Lite for free today:
>>>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>>
>>>> --
>>>> Michael Gogins
>>>> Irreducible Productions
>>>> http://www.michael-gogins.com
>>>> Michael dot Gogins at gmail dot com
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Everyone hates slow websites. So do we.
>>>> Make your web apps faster with AppDynamics
>>>> Download AppDynamics Lite for free today:
>>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_mar
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/l

Date2013-03-25 17:15
FromSteven Yi
SubjectRe: [Cs-dev] sample size functions
AttachmentsNone  None  
Go for it! :)  (Worst case, someone asks for it and we put it back in, no biggie. :) )


On Mon, Mar 25, 2013 at 5:05 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:
OK, unless there are objections, these will be gone today.

Cheers,
Andrés

On Fri, Mar 22, 2013 at 12:16 AM, Victor Lazzarini
<Victor.Lazzarini@nuim.ie> wrote:
> Fine as far as I am concerned.
> On 22 Mar 2013, at 04:02, Andres Cabrera wrote:
>
>> Any thoughts on this? My finger is itching to remove them...
>>
>> Cheers,
>> Andrés
>>
>> On Tue, Mar 19, 2013 at 5:20 PM, Andres Cabrera <mantaraya36@gmail.com> wrote:
>>> Hi,
>>>
>>> Thanks Steven for the info. I would propose removing the first two of
>>> these functions from the API. I think there is no real reason for them
>>> to be there.
>>>
>>> If it's argued that they should be there, I will move them to the FIle
>>> I/O section of the API where thay belong and the formats for
>>> csoundGetSampleFormat should be expanded to include all the currently
>>> used formats. Does this function even return something meaningful
>>> currently, from my quick browse fo the sources it seems those macros
>>> are only relevant for aiff formats...
>>>
>>> Cheers,
>>> Andrés
>>>
>>> On Mon, Mar 18, 2013 at 5:45 AM, Michael Gogins
>>> <michael.gogins@gmail.com> wrote:
>>>> I think better names instead of better comments:
>>>>
>>>> csoundGetAudioOutputStreamFormat
>>>> csoundGetAudioOutputSampleSize
>>>> csoundGetAudioInternalSampleSize
>>>>
>>>> On Mon, Mar 18, 2013 at 6:49 AM, Steven Yi <stevenyi@gmail.com> wrote:
>>>>> Hi Andres,
>>>>>
>>>>> I don't think these are redundant, but should be better commented.
>>>>> Commentary inline below:
>>>>>
>>>>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>>>>        Returns the sample format (i.e. AE_SHORT, AE_LONG, AE_FLOAT, etc.)
>>>>>
>>>>> Oddly, I see these constants defined only in fgens.c:
>>>>>
>>>>> static const int gen01_format_table[11] = {
>>>>>    0,
>>>>>    0,          AE_CHAR,    AE_ALAW,    AE_ULAW,    AE_SHORT,
>>>>>    AE_LONG,    AE_FLOAT,   AE_UNCH,    AE_24INT,   AE_DOUBLE
>>>>> };
>>>>>
>>>>> So, I wonder, are these even public for API users to compare against?
>>>>> I don't see them when using "import csnd; dir(csnd)" in python...
>>>>>
>>>>>
>>>>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>>>>        Returns the size in bytes of a single sample. i.e. 2 (16bit),
>>>>> 3(24bit), 4(32bit), 8 (double)
>>>>>
>>>>> This is resolved in libsnd_u.c:
>>>>>
>>>>> int sfsampsize(int type)
>>>>>
>>>>> {
>>>>>
>>>>>    switch (type & SF_FORMAT_SUBMASK) {
>>>>>      case SF_FORMAT_PCM_16:  return 2;     /* Signed 16 bit data */
>>>>>      case SF_FORMAT_PCM_32:  return 4;     /* Signed 32 bit data */
>>>>>      case SF_FORMAT_FLOAT:   return 4;     /* 32 bit float data */
>>>>>      case SF_FORMAT_PCM_24:  return 3;     /* Signed 24 bit data */
>>>>>      case SF_FORMAT_DOUBLE:  return 8;     /* 64 bit float data */
>>>>>    }
>>>>>
>>>>>    return 1;
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>>>>        Return the size of MYFLT in bytes. Typically 4 bytes for
>>>>> MYFLT=float, and 8 bytes for MYFLT=double, but will depend on
>>>>> sizeof(float) and sizeof(double) on the host architecture.
>>>>>
>>>>>
>>>>>
>>>>> At least, that's how I understand it. :)
>>>>>
>>>>> steven
>>>>>
>>>>> On Mon, Mar 18, 2013 at 5:15 AM, Andres Cabrera <mantaraya36@gmail.com> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> What's the difference between these three functions?
>>>>>>
>>>>>> PUBLIC int      csoundGetSampleFormat (CSOUND *)
>>>>>>        Returns the sample format.
>>>>>> PUBLIC int      csoundGetSampleSize (CSOUND *)
>>>>>>        Returns the size in bytes of a single sample.
>>>>>> PUBLIC int      csoundGetSizeOfMYFLT (void)
>>>>>>        Return the size of MYFLT in bytes.
>>>>>>
>>>>>> I suspect one of those mught refer to the sample format of the audio
>>>>>> file, but wouldn't one of the other two be redundant?
>>>>>>
>>>>>> Cheers,
>>>>>> Andrés
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Everyone hates slow websites. So do we.
>>>>>> Make your web apps faster with AppDynamics
>>>>>> Download AppDynamics Lite for free today:
>>>>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Everyone hates slow websites. So do we.
>>>>> Make your web apps faster with AppDynamics
>>>>> Download AppDynamics Lite for free today:
>>>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>>
>>>> --
>>>> Michael Gogins
>>>> Irreducible Productions
>>>> http://www.michael-gogins.com
>>>> Michael dot Gogins at gmail dot com
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Everyone hates slow websites. So do we.
>>>> Make your web apps faster with AppDynamics
>>>> Download AppDynamics Lite for free today:
>>>> http://p.sf.net/sfu/appdyn_d2d_mar
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_d2d_mar
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel