[Csnd] Csound for Android Apps and Sample Rates

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] Csound for Android Apps and Sample Rates

Arthur Hunkins
Just checking:

Does Csound for Android use the sample rate specified in a .csd, or does it override the specified rate with its own "fixed" rate, e.g., 48000?

I assume Android uses the .csd's specified rate, but wanted to ask those who know.

(I have a GEN05 routine which is specifying a filter cutoff point as a fraction of SR, and it is acting in a somewhat peculiar fashion.)
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound for Android Apps and Sample Rates

Steven Yi
Hi Art,

I looked through the code and did not see anything in particular
overriding the sample rate. You could always add a "print sr" in the
instr 0 space to double check.  For example, the attached CSD prints
"sr = 48000" by default, but if I use "csound --sample-rate=44100
sr_test.csd" it prints the overridden value of "sr = 44100".

steven

On Tue, Jun 27, 2017 at 10:03 AM, Arthur Hunkins
<[hidden email]> wrote:

> Just checking:
>
> Does Csound for Android use the sample rate specified in a .csd, or does it
> override the specified rate with its own "fixed" rate, e.g., 48000?
>
> I assume Android uses the .csd's specified rate, but wanted to ask those who
> know.
>
> (I have a GEN05 routine which is specifying a filter cutoff point as a
> fraction of SR, and it is acting in a somewhat peculiar fashion.)
>
> Art Hunkins
> http://www.arthunkins.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

sr_test.csd (414 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound for Android Apps and Sample Rates

Brian Redfern-2
I've been setting it to 48khz in my apps, as far as I know opensl uses the orchestra's sr setting however there are all kinds of strange implementations per device. The device itself could resample to whatever it wants. Android itself can in theory handle from 8khz tto 48khz. Some devices downsample from 48khz to 44100khz and some upsample from 44100 to 48000 without any control from the developer.

On Thu, Jun 29, 2017 at 6:46 AM Steven Yi <[hidden email]> wrote:
Hi Art,

I looked through the code and did not see anything in particular
overriding the sample rate. You could always add a "print sr" in the
instr 0 space to double check.  For example, the attached CSD prints
"sr = 48000" by default, but if I use "csound --sample-rate=44100
sr_test.csd" it prints the overridden value of "sr = 44100".

steven

On Tue, Jun 27, 2017 at 10:03 AM, Arthur Hunkins
<[hidden email]> wrote:
> Just checking:
>
> Does Csound for Android use the sample rate specified in a .csd, or does it
> override the specified rate with its own "fixed" rate, e.g., 48000?
>
> I assume Android uses the .csd's specified rate, but wanted to ask those who
> know.
>
> (I have a GEN05 routine which is specifying a filter cutoff point as a
> fraction of SR, and it is acting in a somewhat peculiar fashion.)
>
> Art Hunkins
> http://www.arthunkins.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound for Android Apps and Sample Rates

Arthur Hunkins
Thanks for the feedback, Brian and Steven.

I can't quite figure out what *might* be going on with my Nexus 6, but I guess you just have to put up with this possible variation (in sample rate) on Android devices.

In any case, my .csd (Android) seems to do somewhat better (more consistently) when I define a filter cutoff point as a given frequency rather than a % of sample rate.

Art Hunkins


On Thu, Jun 29, 2017 at 5:17 PM, Brian Redfern <[hidden email]> wrote:
I've been setting it to 48khz in my apps, as far as I know opensl uses the orchestra's sr setting however there are all kinds of strange implementations per device. The device itself could resample to whatever it wants. Android itself can in theory handle from 8khz tto 48khz. Some devices downsample from 48khz to 44100khz and some upsample from 44100 to 48000 without any control from the developer.

On Thu, Jun 29, 2017 at 6:46 AM Steven Yi <[hidden email]> wrote:
Hi Art,

I looked through the code and did not see anything in particular
overriding the sample rate. You could always add a "print sr" in the
instr 0 space to double check.  For example, the attached CSD prints
"sr = 48000" by default, but if I use "csound --sample-rate=44100
sr_test.csd" it prints the overridden value of "sr = 44100".

steven

On Tue, Jun 27, 2017 at 10:03 AM, Arthur Hunkins
<[hidden email]> wrote:
> Just checking:
>
> Does Csound for Android use the sample rate specified in a .csd, or does it
> override the specified rate with its own "fixed" rate, e.g., 48000?
>
> I assume Android uses the .csd's specified rate, but wanted to ask those who
> know.
>
> (I have a GEN05 routine which is specifying a filter cutoff point as a
> fraction of SR, and it is acting in a somewhat peculiar fashion.)
>
> Art Hunkins
> http://www.arthunkins.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound for Android Apps and Sample Rates

Brian Redfern-2
Yeah that's going to give you more predictable results on android because that frequency will always be the same but the jump from 44100 to 48000 or vice versa could play havoc with your filter.

On Thu, Jun 29, 2017 at 7:10 PM Arthur Hunkins <[hidden email]> wrote:
Thanks for the feedback, Brian and Steven.

I can't quite figure out what *might* be going on with my Nexus 6, but I guess you just have to put up with this possible variation (in sample rate) on Android devices.

In any case, my .csd (Android) seems to do somewhat better (more consistently) when I define a filter cutoff point as a given frequency rather than a % of sample rate.

Art Hunkins

On Thu, Jun 29, 2017 at 5:17 PM, Brian Redfern <[hidden email]> wrote:
I've been setting it to 48khz in my apps, as far as I know opensl uses the orchestra's sr setting however there are all kinds of strange implementations per device. The device itself could resample to whatever it wants. Android itself can in theory handle from 8khz tto 48khz. Some devices downsample from 48khz to 44100khz and some upsample from 44100 to 48000 without any control from the developer.

On Thu, Jun 29, 2017 at 6:46 AM Steven Yi <[hidden email]> wrote:
Hi Art,

I looked through the code and did not see anything in particular
overriding the sample rate. You could always add a "print sr" in the
instr 0 space to double check.  For example, the attached CSD prints
"sr = 48000" by default, but if I use "csound --sample-rate=44100
sr_test.csd" it prints the overridden value of "sr = 44100".

steven

On Tue, Jun 27, 2017 at 10:03 AM, Arthur Hunkins
<[hidden email]> wrote:
> Just checking:
>
> Does Csound for Android use the sample rate specified in a .csd, or does it
> override the specified rate with its own "fixed" rate, e.g., 48000?
>
> I assume Android uses the .csd's specified rate, but wanted to ask those who
> know.
>
> (I have a GEN05 routine which is specifying a filter cutoff point as a
> fraction of SR, and it is acting in a somewhat peculiar fashion.)
>
> Art Hunkins
> http://www.arthunkins.com
> Csound mailing list [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Loading...