Csound Csound-dev Csound-tekno Search About

[Csnd] sr when using a backend with fixed sr

Date2019-04-29 11:35
FromEduardo Moguillansky
Subject[Csnd] sr when using a backend with fixed sr
Maybe this has been solved already. I remember participating in a 
discussion over default sr being hardcoded to 44100. Is there currently 
an option to specify "use the system sr" when using -odac and a backend 
with a fixed sr (jack) ?

Csound mailing list
Csound@listserv.heanet.ie
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

Date2019-04-29 13:32
FromRory Walsh
SubjectRe: [Csnd] sr when using a backend with fixed sr
I'm not sure about this, but you can override the orchestra SR using
the ```--sample-rate=N``` command line flag. I do this when loading
Csound instruments in a DAW, so that they use the same SR as the host.


On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
 wrote:
>
> Maybe this has been solved already. I remember participating in a
> discussion over default sr being hardcoded to 44100. Is there currently
> an option to specify "use the system sr" when using -odac and a backend
> with a fixed sr (jack) ?
>
> Csound mailing list
> Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2019-04-29 13:49
FromEduardo Moguillansky
SubjectRe: [Csnd] sr when using a backend with fixed sr
I know about that. I was secretly hoping that csound would be smart 
enough and when leaving sr unset it would use the system sr, but it 
defaults to 44100. In most cases the backend has a fixed samplerate and 
csound already knows about it, so the question is: would it be possible 
to default to the system sr when no sr is present and output is to dac? 
Or maybe add a possibility to do something like `--sample-rate=system`?

On 29.04.19 14:32, Rory Walsh wrote:
> I'm not sure about this, but you can override the orchestra SR using
> the ```--sample-rate=N``` command line flag. I do this when loading
> Csound instruments in a DAW, so that they use the same SR as the host.
>
>
> On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
>  wrote:
>> Maybe this has been solved already. I remember participating in a
>> discussion over default sr being hardcoded to 44100. Is there currently
>> an option to specify "use the system sr" when using -odac and a backend
>> with a fixed sr (jack) ?
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> 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
> Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2019-04-29 14:27
FromHlöðver Sigurðsson
SubjectRe: [Csnd] sr when using a backend with fixed sr
In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.

On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
I know about that. I was secretly hoping that csound would be smart
enough and when leaving sr unset it would use the system sr, but it
defaults to 44100. In most cases the backend has a fixed samplerate and
csound already knows about it, so the question is: would it be possible
to default to the system sr when no sr is present and output is to dac?
Or maybe add a possibility to do something like `--sample-rate=system`?

On 29.04.19 14:32, Rory Walsh wrote:
> I'm not sure about this, but you can override the orchestra SR using
> the ```--sample-rate=N``` command line flag. I do this when loading
> Csound instruments in a DAW, so that they use the same SR as the host.
>
>
> On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
> <eduardo.moguillansky@gmail.com> wrote:
>> Maybe this has been solved already. I remember participating in a
>> discussion over default sr being hardcoded to 44100. Is there currently
>> an option to specify "use the system sr" when using -odac and a backend
>> with a fixed sr (jack) ?
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> 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
> Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2019-04-29 15:24
FromVictor Lazzarini
SubjectRe: [Csnd] sr when using a backend with fixed sr
The only thing that exists at the moment is --get-system-sr to query the system sr:

csound -odac --get-system-sr

========================
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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson  wrote:
> 
> In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.
> 
> On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky  wrote:
> I know about that. I was secretly hoping that csound would be smart 
> enough and when leaving sr unset it would use the system sr, but it 
> defaults to 44100. In most cases the backend has a fixed samplerate and 
> csound already knows about it, so the question is: would it be possible 
> to default to the system sr when no sr is present and output is to dac? 
> Or maybe add a possibility to do something like `--sample-rate=system`?
> 
> On 29.04.19 14:32, Rory Walsh wrote:
> > I'm not sure about this, but you can override the orchestra SR using
> > the ```--sample-rate=N``` command line flag. I do this when loading
> > Csound instruments in a DAW, so that they use the same SR as the host.
> >
> >
> > On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
> >  wrote:
> >> Maybe this has been solved already. I remember participating in a
> >> discussion over default sr being hardcoded to 44100. Is there currently
> >> an option to specify "use the system sr" when using -odac and a backend
> >> with a fixed sr (jack) ?
> >>
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> 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
> > Csound@listserv.heanet.ie
> > 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
> Csound@listserv.heanet.ie
> 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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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

Date2019-04-29 15:40
FromVictor Lazzarini
SubjectRe: [Csnd] sr when using a backend with fixed sr
I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
to be defined first, e.g.

csound -odac0 --use-system-sr test.csd

========================
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 29 Apr 2019, at 15:24, Victor Lazzarini  wrote:
> 
> The only thing that exists at the moment is --get-system-sr to query the system sr:
> 
> csound -odac --get-system-sr
> 
> ========================
> 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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson  wrote:
>> 
>> In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.
>> 
>> On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky  wrote:
>> I know about that. I was secretly hoping that csound would be smart 
>> enough and when leaving sr unset it would use the system sr, but it 
>> defaults to 44100. In most cases the backend has a fixed samplerate and 
>> csound already knows about it, so the question is: would it be possible 
>> to default to the system sr when no sr is present and output is to dac? 
>> Or maybe add a possibility to do something like `--sample-rate=system`?
>> 
>> On 29.04.19 14:32, Rory Walsh wrote:
>>> I'm not sure about this, but you can override the orchestra SR using
>>> the ```--sample-rate=N``` command line flag. I do this when loading
>>> Csound instruments in a DAW, so that they use the same SR as the host.
>>> 
>>> 
>>> On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
>>>  wrote:
>>>> Maybe this has been solved already. I remember participating in a
>>>> discussion over default sr being hardcoded to 44100. Is there currently
>>>> an option to specify "use the system sr" when using -odac and a backend
>>>> with a fixed sr (jack) ?
>>>> 
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> 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
>>> Csound@listserv.heanet.ie
>>> 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
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie 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
> Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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

Date2019-04-29 16:22
Fromluis jure
SubjectRe: [Csnd] sr when using a backend with fixed sr
el 2019-04-29 a las 14:40 Victor Lazzarini escribió:

> I’ve added the option --use-system-sr which should do the job. It needs
> -odac or similar to be defined first, e.g.
> 
> csound -odac0 --use-system-sr test.csd


brilliant... 




--

Csound mailing list
Csound@listserv.heanet.ie
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

Date2019-04-29 18:13
FromEduardo Moguillansky
SubjectRe: [Csnd] sr when using a backend with fixed sr

Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error

system sr: 48000.000000 
*** rtjack: sample rate 44100 does not match JACK sample rate 48000

----

<CsoundSynthesizer>
<CsOptions>
-+rtaudio=jack
-odac
--use-system-sr           

--daemon

</CsOptions>

<CsInstruments>
; sr     = 44100
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
    out oscili:a(0.2, 1000)
endin

</CsInstruments>

<CsScore>

i 1 0 -1

</CsScore>
</CsoundSynthesizer>




On 29.04.19 16:40, Victor Lazzarini wrote:

I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
to be defined first, e.g.

csound -odac0 --use-system-sr test.csd

========================
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 29 Apr 2019, at 15:24, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:

The only thing that exists at the moment is --get-system-sr to query the system sr:

csound -odac --get-system-sr

========================
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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:

In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.

On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:
I know about that. I was secretly hoping that csound would be smart 
enough and when leaving sr unset it would use the system sr, but it 
defaults to 44100. In most cases the backend has a fixed samplerate and 
csound already knows about it, so the question is: would it be possible 
to default to the system sr when no sr is present and output is to dac? 
Or maybe add a possibility to do something like `--sample-rate=system`?

On 29.04.19 14:32, Rory Walsh wrote:
I'm not sure about this, but you can override the orchestra SR using
the ```--sample-rate=N``` command line flag. I do this when loading
Csound instruments in a DAW, so that they use the same SR as the host.


On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
<eduardo.moguillansky@gmail.com> wrote:
Maybe this has been solved already. I remember participating in a
discussion over default sr being hardcoded to 44100. Is there currently
an option to specify "use the system sr" when using -odac and a backend
with a fixed sr (jack) ?

Csound mailing list
Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie
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

Date2019-04-29 19:09
FromVictor Lazzarini
SubjectRe: [Csnd] sr when using a backend with fixed sr
No, it doesn’t work with Jack. I think it is to do with the double loading that we need to do to
get the sr from the system. Might need to do something different.
========================
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 29 Apr 2019, at 18:13, Eduardo Moguillansky  wrote:
> 
> Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error 
> 
> system sr: 48000.000000 
> *** rtjack: sample rate 44100 does not match JACK sample rate 48000
> 
> ----
> 
> 
> 
> -+rtaudio=jack
> -odac
> --use-system-sr           
> 
> --daemon
> 
> 
> 
> 
> ; sr     = 44100
> ksmps  = 64
> nchnls = 2
> 0dbfs  = 1
> 
> instr 1
>     out oscili:a(0.2, 1000)
> endin
> 
> 
> 
> 
> 
> i 1 0 -1
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> On 29.04.19 16:40, Victor Lazzarini wrote:
> 
>> I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
>> to be defined first, e.g.
>> 
>> csound -odac0 --use-system-sr test.csd
>> 
>> ========================
>> 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 29 Apr 2019, at 15:24, Victor Lazzarini 
>>>  wrote:
>>> 
>>> The only thing that exists at the moment is --get-system-sr to query the system sr:
>>> 
>>> csound -odac --get-system-sr
>>> 
>>> ========================
>>> 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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson 
>>>>  wrote:
>>>> 
>>>> In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.
>>>> 
>>>> On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky 
>>>> 
>>>>  wrote:
>>>> I know about that. I was secretly hoping that csound would be smart 
>>>> enough and when leaving sr unset it would use the system sr, but it 
>>>> defaults to 44100. In most cases the backend has a fixed samplerate and 
>>>> csound already knows about it, so the question is: would it be possible 
>>>> to default to the system sr when no sr is present and output is to dac? 
>>>> Or maybe add a possibility to do something like `--sample-rate=system`?
>>>> 
>>>> On 29.04.19 14:32, Rory Walsh wrote:
>>>> 
>>>>> I'm not sure about this, but you can override the orchestra SR using
>>>>> the ```--sample-rate=N``` command line flag. I do this when loading
>>>>> Csound instruments in a DAW, so that they use the same SR as the host.
>>>>> 
>>>>> 
>>>>> On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
>>>>> 
>>>>> 
>>>>>  wrote:
>>>>> 
>>>>>> Maybe this has been solved already. I remember participating in a
>>>>>> discussion over default sr being hardcoded to 44100. Is there currently
>>>>>> an option to specify "use the system sr" when using -odac and a backend
>>>>>> with a fixed sr (jack) ?
>>>>>> 
>>>>>> Csound mailing list
>>>>>> 
>>>>>> Csound@listserv.heanet.ie
>>>>>> 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
>>>>> 
>>>>> Csound@listserv.heanet.ie
>>>>> 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
>>>> 
>>>> Csound@listserv.heanet.ie
>>>> 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 
>>>> Csound@listserv.heanet.ie 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
>>> 
>>> Csound@listserv.heanet.ie
>>> 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
>> 
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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

Date2019-04-29 21:30
FromAnders Genell
SubjectRe: [Csnd] sr when using a backend with fixed sr
A colleague was recently trying to get sample rate from jack and found a function for it in the api docs. Don’t know if it helps here though...


Regards,
Anders

29 apr. 2019 kl. 20:09 skrev Victor Lazzarini <Victor.Lazzarini@mu.ie>:

No, it doesn’t work with Jack. I think it is to do with the double loading that we need to do to
get the sr from the system. Might need to do something different.
========================
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 29 Apr 2019, at 18:13, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error

system sr: 48000.000000
*** rtjack: sample rate 44100 does not match JACK sample rate 48000

----

<CsoundSynthesizer>
<CsOptions>
-+rtaudio=jack
-odac
--use-system-sr           

--daemon

</CsOptions>

<CsInstruments>
; sr     = 44100
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
   out oscili:a(0.2, 1000)
endin

</CsInstruments>

<CsScore>

i 1 0 -1

</CsScore>
</CsoundSynthesizer>







On 29.04.19 16:40, Victor Lazzarini wrote:

I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
to be defined first, e.g.

csound -odac0 --use-system-sr test.csd

========================
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 29 Apr 2019, at 15:24, Victor Lazzarini <Victor.Lazzarini@mu.ie>
wrote:

The only thing that exists at the moment is --get-system-sr to query the system sr:

csound -odac --get-system-sr

========================
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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson <hlolli@gmail.com>
wrote:

In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.

On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky
<eduardo.moguillansky@gmail.com>
wrote:
I know about that. I was secretly hoping that csound would be smart
enough and when leaving sr unset it would use the system sr, but it
defaults to 44100. In most cases the backend has a fixed samplerate and
csound already knows about it, so the question is: would it be possible
to default to the system sr when no sr is present and output is to dac?
Or maybe add a possibility to do something like `--sample-rate=system`?

On 29.04.19 14:32, Rory Walsh wrote:

I'm not sure about this, but you can override the orchestra SR using
the ```--sample-rate=N``` command line flag. I do this when loading
Csound instruments in a DAW, so that they use the same SR as the host.


On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky

<eduardo.moguillansky@gmail.com>
wrote:

Maybe this has been solved already. I remember participating in a
discussion over default sr being hardcoded to 44100. Is there currently
an option to specify "use the system sr" when using -odac and a backend
with a fixed sr (jack) ?

Csound mailing list

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie 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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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

Date2019-04-29 21:37
FromVictor Lazzarini
SubjectRe: [Csnd] sr when using a backend with fixed sr
That's not the issue. We get the SR alright, but the way things work currently, we need to open output in the module before we have
it. This is after Csound has set its own SR.

What we do is open, read the value, and close it, then continue on with the Csound
startup. This works but not with the Jack IO  which fails to be reopen. We can get the
SR then end the process, but that's all.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 29 Apr 2019, at 21:31, Anders Genell <anders.genell@gmail.com> wrote:

A colleague was recently trying to get sample rate from jack and found a function for it in the api docs. Don’t know if it helps here though...


Regards,
Anders

29 apr. 2019 kl. 20:09 skrev Victor Lazzarini <Victor.Lazzarini@mu.ie>:

No, it doesn’t work with Jack. I think it is to do with the double loading that we need to do to
get the sr from the system. Might need to do something different.
========================
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 29 Apr 2019, at 18:13, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error

system sr: 48000.000000
*** rtjack: sample rate 44100 does not match JACK sample rate 48000

----

<CsoundSynthesizer>
<CsOptions>
-+rtaudio=jack
-odac
--use-system-sr           

--daemon

</CsOptions>

<CsInstruments>
; sr     = 44100
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
   out oscili:a(0.2, 1000)
endin

</CsInstruments>

<CsScore>

i 1 0 -1

</CsScore>
</CsoundSynthesizer>







On 29.04.19 16:40, Victor Lazzarini wrote:

I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
to be defined first, e.g.

csound -odac0 --use-system-sr test.csd

========================
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 29 Apr 2019, at 15:24, Victor Lazzarini <Victor.Lazzarini@mu.ie>
wrote:

The only thing that exists at the moment is --get-system-sr to query the system sr:

csound -odac --get-system-sr

========================
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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson <hlolli@gmail.com>
wrote:

In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.

On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky
<eduardo.moguillansky@gmail.com>
wrote:
I know about that. I was secretly hoping that csound would be smart
enough and when leaving sr unset it would use the system sr, but it
defaults to 44100. In most cases the backend has a fixed samplerate and
csound already knows about it, so the question is: would it be possible
to default to the system sr when no sr is present and output is to dac?
Or maybe add a possibility to do something like `--sample-rate=system`?

On 29.04.19 14:32, Rory Walsh wrote:

I'm not sure about this, but you can override the orchestra SR using
the ```--sample-rate=N``` command line flag. I do this when loading
Csound instruments in a DAW, so that they use the same SR as the host.


On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky

<eduardo.moguillansky@gmail.com>
wrote:

Maybe this has been solved already. I remember participating in a
discussion over default sr being hardcoded to 44100. Is there currently
an option to specify "use the system sr" when using -odac and a backend
with a fixed sr (jack) ?

Csound mailing list

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie 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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2019-04-29 21:53
FromJohn ff
SubjectRe: [Csnd] sr when using a backend with fixed sr
I would have thought that with suitable flags one could redo the sr calculation late.

Sent from TypeApp
On 29 Apr 2019, at 21:38, Victor Lazzarini <victor.lazzarini@mu.ie> wrote:
That's not the issue. We get the SR alright, but the way things work currently, we need to open output in the module before we have
it. This is after Csound has set its own SR.

What we do is open, read the value, and close it, then continue on with the Csound
startup. This works but not with the Jack IO  which fails to be reopen. We can get the
SR then end the process, but that's all.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 29 Apr 2019, at 21:31, Anders Genell < anders.genell@gmail.com> wrote:

A colleague was recently trying to get sample rate from jack and found a function for it in the api docs. Don’t know if it helps here though...


Regards,
Anders

29 apr. 2019 kl. 20:09 skrev Victor Lazzarini < Victor.Lazzarini@mu.ie>:

No, it doesn’t work with Jack. I think it is to do with the double loading that we need to do to
get the sr from the system. Might need to do something different.
========================
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 29 Apr 2019, at 18:13, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error

system sr: 48000.000000
*** rtjack: sample rate 44100 does not match JACK sample rate 48000

----

<CsoundSynthesizer>
<CsOptions>
-+rtaudio=jack
-odac
--use-system-sr           

--daemon

</CsOptions>

<CsInstruments>
; sr     = 44100
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
   out oscili:a(0.2, 1000)
endin

</CsInstruments>

<CsScore>

i 1 0 -1

</CsScore>
</CsoundSynthesizer>







On 29.04.19 16:40, Victor Lazzarini wrote:

I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
to be defined first, e.g.

csound -odac0 --use-system-sr test.csd

========================
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 29 Apr 2019, at 15:24, Victor Lazzarini <Victor.Lazzarini@mu.ie>
wrote:

The only thing that exists at the moment is --get-system-sr to query the system sr:

csound -odac --get-system-sr

========================
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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson <hlolli@gmail.com>
wrote:

In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.

On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky
<eduardo.moguillansky@gmail.com>
wrote:
I know about that. I was secretly hoping that csound would be smart
enough and when leaving sr unset it would use the system sr, but it
defaults to 44100. In most cases the backend has a fixed samplerate and
csound already knows about it, so the question is: would it be possible
to default to the system sr when no sr is present and output is to dac?
Or maybe add a possibility to do something like `--sample-rate=system`?

On 29.04.19 14:32, Rory Walsh wrote:

I'm not sure about this, but you can override the orchestra SR using
the ```--sample-rate=N``` command line flag. I do this when loading
Csound instruments in a DAW, so that they use the same SR as the host.


On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky

<eduardo.moguillansky@gmail.com>
wrote:

Maybe this has been solved already. I remember participating in a
discussion over default sr being hardcoded to 44100. Is there currently
an option to specify "use the system sr" when using -odac and a backend
with a fixed sr (jack) ?

Csound mailing list

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie 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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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

Date2019-04-29 22:00
FromVictor Lazzarini
SubjectRe: [Csnd] sr when using a backend with fixed sr
Possibly. It needs to be before any code is run in instr 0 though. But that's before the output is opened. 

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 29 Apr 2019, at 21:54, John ff <jpff@codemist.co.uk> wrote:

I would have thought that with suitable flags one could redo the sr calculation late.

Sent from TypeApp
On 29 Apr 2019, at 21:38, Victor Lazzarini <victor.lazzarini@mu.ie> wrote:
That's not the issue. We get the SR alright, but the way things work currently, we need to open output in the module before we have
it. This is after Csound has set its own SR.

What we do is open, read the value, and close it, then continue on with the Csound
startup. This works but not with the Jack IO  which fails to be reopen. We can get the
SR then end the process, but that's all.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 29 Apr 2019, at 21:31, Anders Genell < anders.genell@gmail.com> wrote:

A colleague was recently trying to get sample rate from jack and found a function for it in the api docs. Don’t know if it helps here though...


Regards,
Anders

29 apr. 2019 kl. 20:09 skrev Victor Lazzarini < Victor.Lazzarini@mu.ie>:

No, it doesn’t work with Jack. I think it is to do with the double loading that we need to do to
get the sr from the system. Might need to do something different.
========================
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 29 Apr 2019, at 18:13, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error

system sr: 48000.000000
*** rtjack: sample rate 44100 does not match JACK sample rate 48000

----

<CsoundSynthesizer>
<CsOptions>
-+rtaudio=jack
-odac
--use-system-sr           

--daemon

</CsOptions>

<CsInstruments>
; sr     = 44100
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
   out oscili:a(0.2, 1000)
endin

</CsInstruments>

<CsScore>

i 1 0 -1

</CsScore>
</CsoundSynthesizer>







On 29.04.19 16:40, Victor Lazzarini wrote:

I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
to be defined first, e.g.

csound -odac0 --use-system-sr test.csd

========================
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 29 Apr 2019, at 15:24, Victor Lazzarini <Victor.Lazzarini@mu.ie>
wrote:

The only thing that exists at the moment is --get-system-sr to query the system sr:

csound -odac --get-system-sr

========================
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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson <hlolli@gmail.com>
wrote:

In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.

On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky
<eduardo.moguillansky@gmail.com>
wrote:
I know about that. I was secretly hoping that csound would be smart
enough and when leaving sr unset it would use the system sr, but it
defaults to 44100. In most cases the backend has a fixed samplerate and
csound already knows about it, so the question is: would it be possible
to default to the system sr when no sr is present and output is to dac?
Or maybe add a possibility to do something like `--sample-rate=system`?

On 29.04.19 14:32, Rory Walsh wrote:

I'm not sure about this, but you can override the orchestra SR using
the ```--sample-rate=N``` command line flag. I do this when loading
Csound instruments in a DAW, so that they use the same SR as the host.


On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky

<eduardo.moguillansky@gmail.com>
wrote:

Maybe this has been solved already. I remember participating in a
discussion over default sr being hardcoded to 44100. Is there currently
an option to specify "use the system sr" when using -odac and a backend
with a fixed sr (jack) ?

Csound mailing list

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie 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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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

Date2019-05-01 19:10
FromVictor Lazzarini
SubjectRe: [Csnd] sr when using a backend with fixed sr
So I had a closer look and by re-ordering the operations I managed to provide a better
implementation of the --use-system-sr flag. Tested with portaudio and jack.

Only relevant with realtime output, no-op if other output destinations are used or
if the sampling rate is overridden with another option. 
It is also only guaranteed to be implemented with Csound output modules. 

The flag might not work with host implemented IOs, which need to call the following
function as early as possible, certainly before csoundStart() to record the
value of the system sr.

  /**
   * If val > 0, sets the internal variable holding the system HW sr.
   * Returns the stored value containing the system HW sr.
   */
  PUBLIC MYFLT csoundSystemSr(CSOUND *csound, MYFLT val); 


========================
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 29 Apr 2019, at 21:37, Victor Lazzarini  wrote:
> 
> That's not the issue. We get the SR alright, but the way things work currently, we need to open output in the module before we have
> it. This is after Csound has set its own SR.
> 
> What we do is open, read the value, and close it, then continue on with the Csound
> startup. This works but not with the Jack IO  which fails to be reopen. We can get the
> SR then end the process, but that's all.
> 
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
> 
> On 29 Apr 2019, at 21:31, Anders Genell  wrote:
> 
>> A colleague was recently trying to get sample rate from jack and found a function for it in the api docs. Don’t know if it helps here though...
>> 
>> http://jackaudio.org/files/refman.pdf page 36. 
>> 
>> Regards,
>> Anders
>> 
>> 29 apr. 2019 kl. 20:09 skrev Victor Lazzarini :
>> 
>>> No, it doesn’t work with Jack. I think it is to do with the double loading that we need to do to
>>> get the sr from the system. Might need to do something different.
>>> ========================
>>> 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 29 Apr 2019, at 18:13, Eduardo Moguillansky  wrote:
>>>> 
>>>> Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error 
>>>> 
>>>> system sr: 48000.000000 
>>>> *** rtjack: sample rate 44100 does not match JACK sample rate 48000
>>>> 
>>>> ----
>>>> 
>>>> 
>>>> 
>>>> -+rtaudio=jack
>>>> -odac
>>>> --use-system-sr           
>>>> 
>>>> --daemon
>>>> 
>>>> 
>>>> 
>>>> 
>>>> ; sr     = 44100
>>>> ksmps  = 64
>>>> nchnls = 2
>>>> 0dbfs  = 1
>>>> 
>>>> instr 1
>>>>    out oscili:a(0.2, 1000)
>>>> endin
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> i 1 0 -1
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On 29.04.19 16:40, Victor Lazzarini wrote:
>>>> 
>>>>> I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
>>>>> to be defined first, e.g.
>>>>> 
>>>>> csound -odac0 --use-system-sr test.csd
>>>>> 
>>>>> ========================
>>>>> 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 29 Apr 2019, at 15:24, Victor Lazzarini 
>>>>>> wrote:
>>>>>> 
>>>>>> The only thing that exists at the moment is --get-system-sr to query the system sr:
>>>>>> 
>>>>>> csound -odac --get-system-sr
>>>>>> 
>>>>>> ========================
>>>>>> 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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson 
>>>>>>> wrote:
>>>>>>> 
>>>>>>> In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.
>>>>>>> 
>>>>>>> On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky 
>>>>>>> 
>>>>>>> wrote:
>>>>>>> I know about that. I was secretly hoping that csound would be smart 
>>>>>>> enough and when leaving sr unset it would use the system sr, but it 
>>>>>>> defaults to 44100. In most cases the backend has a fixed samplerate and 
>>>>>>> csound already knows about it, so the question is: would it be possible 
>>>>>>> to default to the system sr when no sr is present and output is to dac? 
>>>>>>> Or maybe add a possibility to do something like `--sample-rate=system`?
>>>>>>> 
>>>>>>> On 29.04.19 14:32, Rory Walsh wrote:
>>>>>>> 
>>>>>>>> I'm not sure about this, but you can override the orchestra SR using
>>>>>>>> the ```--sample-rate=N``` command line flag. I do this when loading
>>>>>>>> Csound instruments in a DAW, so that they use the same SR as the host.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
>>>>>>>> 
>>>>>>>> 
>>>>>>>> wrote:
>>>>>>>> 
>>>>>>>>> Maybe this has been solved already. I remember participating in a
>>>>>>>>> discussion over default sr being hardcoded to 44100. Is there currently
>>>>>>>>> an option to specify "use the system sr" when using -odac and a backend
>>>>>>>>> with a fixed sr (jack) ?
>>>>>>>>> 
>>>>>>>>> Csound mailing list
>>>>>>>>> 
>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>> 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
>>>>>>>> 
>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>> 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
>>>>>>> 
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> 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 
>>>>>>> Csound@listserv.heanet.ie 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
>>>>>> 
>>>>>> Csound@listserv.heanet.ie
>>>>>> 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
>>>>> 
>>>>> Csound@listserv.heanet.ie
>>>>> 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 Csound@listserv.heanet.ie 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
>>> Csound@listserv.heanet.ie
>>> 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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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

Date2019-05-01 20:25
FromEduardo Moguillansky
SubjectRe: [Csnd] sr when using a backend with fixed sr

I can't get this to work. In particular, using a file without any options inside CsOptions and calling it with

csound -+rtaudio=jack -odac --use-system-sr srtest.csd

keeps trying to use 44100 as a samplerate, independent of jack being configured to use 48000.

<CsoundSynthesizer>
<CsOptions>
</CsOptions>

<CsInstruments>
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
    out oscili:a(0.1, 1000)
endin

</CsInstruments>

<CsScore>

i1 0 10

</CsScore>
</CsoundSynthesizer>
On 01.05.19 20:10, Victor Lazzarini wrote:
So I had a closer look and by re-ordering the operations I managed to provide a better
implementation of the --use-system-sr flag. Tested with portaudio and jack.

Only relevant with realtime output, no-op if other output destinations are used or
if the sampling rate is overridden with another option. 
It is also only guaranteed to be implemented with Csound output modules. 

The flag might not work with host implemented IOs, which need to call the following
function as early as possible, certainly before csoundStart() to record the
value of the system sr.

  /**
   * If val > 0, sets the internal variable holding the system HW sr.
   * Returns the stored value containing the system HW sr.
   */
  PUBLIC MYFLT csoundSystemSr(CSOUND *csound, MYFLT val); 


========================
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 29 Apr 2019, at 21:37, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:

That's not the issue. We get the SR alright, but the way things work currently, we need to open output in the module before we have
it. This is after Csound has set its own SR.

What we do is open, read the value, and close it, then continue on with the Csound
startup. This works but not with the Jack IO  which fails to be reopen. We can get the
SR then end the process, but that's all.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 29 Apr 2019, at 21:31, Anders Genell <anders.genell@gmail.com> wrote:

A colleague was recently trying to get sample rate from jack and found a function for it in the api docs. Don’t know if it helps here though...

http://jackaudio.org/files/refman.pdf page 36. 

Regards,
Anders

29 apr. 2019 kl. 20:09 skrev Victor Lazzarini <Victor.Lazzarini@mu.ie>:

No, it doesn’t work with Jack. I think it is to do with the double loading that we need to do to
get the sr from the system. Might need to do something different.
========================
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 29 Apr 2019, at 18:13, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error 

system sr: 48000.000000 
*** rtjack: sample rate 44100 does not match JACK sample rate 48000

----

<CsoundSynthesizer>
<CsOptions>
-+rtaudio=jack
-odac
--use-system-sr           

--daemon

</CsOptions>

<CsInstruments>
; sr     = 44100
ksmps  = 64
nchnls = 2
0dbfs  = 1

instr 1
   out oscili:a(0.2, 1000)
endin

</CsInstruments>

<CsScore>

i 1 0 -1

</CsScore>
</CsoundSynthesizer>







On 29.04.19 16:40, Victor Lazzarini wrote:

I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
to be defined first, e.g.

csound -odac0 --use-system-sr test.csd

========================
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 29 Apr 2019, at 15:24, Victor Lazzarini <Victor.Lazzarini@mu.ie>
wrote:

The only thing that exists at the moment is --get-system-sr to query the system sr:

csound -odac --get-system-sr

========================
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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson <hlolli@gmail.com>
wrote:

In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.

On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky 
<eduardo.moguillansky@gmail.com>
wrote:
I know about that. I was secretly hoping that csound would be smart 
enough and when leaving sr unset it would use the system sr, but it 
defaults to 44100. In most cases the backend has a fixed samplerate and 
csound already knows about it, so the question is: would it be possible 
to default to the system sr when no sr is present and output is to dac? 
Or maybe add a possibility to do something like `--sample-rate=system`?

On 29.04.19 14:32, Rory Walsh wrote:

I'm not sure about this, but you can override the orchestra SR using
the ```--sample-rate=N``` command line flag. I do this when loading
Csound instruments in a DAW, so that they use the same SR as the host.


On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky

<eduardo.moguillansky@gmail.com>
wrote:

Maybe this has been solved already. I remember participating in a
discussion over default sr being hardcoded to 44100. Is there currently
an option to specify "use the system sr" when using -odac and a backend
with a fixed sr (jack) ?

Csound mailing list

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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 
Csound@listserv.heanet.ie 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

Csound@listserv.heanet.ie
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

Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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

Date2019-05-01 21:10
FromVictor Lazzarini
SubjectRe: [Csnd] sr when using a backend with fixed sr
yes, I had to adjust the jack module for this. Try now.
ALSA is not for this ready yet, I have to go into linux to fix it.
========================
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 1 May 2019, at 20:25, Eduardo Moguillansky  wrote:
> 
> I can't get this to work. In particular, using a file without any options inside CsOptions and calling it with
> 
> csound -+rtaudio=jack -odac --use-system-sr srtest.csd
> 
> keeps trying to use 44100 as a samplerate, independent of jack being configured to use 48000.
> 
> 
> 
> 
> 
> 
> 
> ksmps  = 64
> nchnls = 2
> 0dbfs  = 1
> 
> instr 1
>     out oscili:a(0.1, 1000)
> endin
> 
> 
> 
> 
> 
> i1 0 10
> 
> 
> 
> 
> On 01.05.19 20:10, Victor Lazzarini wrote:
>> So I had a closer look and by re-ordering the operations I managed to provide a better
>> implementation of the --use-system-sr flag. Tested with portaudio and jack.
>> 
>> Only relevant with realtime output, no-op if other output destinations are used or
>> if the sampling rate is overridden with another option. 
>> It is also only guaranteed to be implemented with Csound output modules. 
>> 
>> The flag might not work with host implemented IOs, which need to call the following
>> function as early as possible, certainly before csoundStart() to record the
>> value of the system sr.
>> 
>>   /**
>>    * If val > 0, sets the internal variable holding the system HW sr.
>>    * Returns the stored value containing the system HW sr.
>>    */
>>   PUBLIC MYFLT csoundSystemSr(CSOUND *csound, MYFLT val); 
>> 
>> 
>> ========================
>> 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 29 Apr 2019, at 21:37, Victor Lazzarini 
>>>  wrote:
>>> 
>>> That's not the issue. We get the SR alright, but the way things work currently, we need to open output in the module before we have
>>> it. This is after Csound has set its own SR.
>>> 
>>> What we do is open, read the value, and close it, then continue on with the Csound
>>> startup. This works but not with the Jack IO  which fails to be reopen. We can get the
>>> SR then end the process, but that's all.
>>> 
>>> Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy
>>> Maynooth University
>>> Ireland
>>> 
>>> On 29 Apr 2019, at 21:31, Anders Genell 
>>> 
>>>  wrote:
>>> 
>>> 
>>>> A colleague was recently trying to get sample rate from jack and found a function for it in the api docs. Don’t know if it helps here though...
>>>> 
>>>> 
>>>> http://jackaudio.org/files/refman.pdf
>>>>  page 36. 
>>>> 
>>>> Regards,
>>>> Anders
>>>> 
>>>> 29 apr. 2019 kl. 20:09 skrev Victor Lazzarini 
>>>> 
>>>> :
>>>> 
>>>> 
>>>>> No, it doesn’t work with Jack. I think it is to do with the double loading that we need to do to
>>>>> get the sr from the system. Might need to do something different.
>>>>> ========================
>>>>> 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 29 Apr 2019, at 18:13, Eduardo Moguillansky 
>>>>>>  wrote:
>>>>>> 
>>>>>> Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error 
>>>>>> 
>>>>>> system sr: 48000.000000 
>>>>>> *** rtjack: sample rate 44100 does not match JACK sample rate 48000
>>>>>> 
>>>>>> ----
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> -+rtaudio=jack
>>>>>> -odac
>>>>>> --use-system-sr           
>>>>>> 
>>>>>> --daemon
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ; sr     = 44100
>>>>>> ksmps  = 64
>>>>>> nchnls = 2
>>>>>> 0dbfs  = 1
>>>>>> 
>>>>>> instr 1
>>>>>>    out oscili:a(0.2, 1000)
>>>>>> endin
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> i 1 0 -1
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On 29.04.19 16:40, Victor Lazzarini wrote:
>>>>>> 
>>>>>> 
>>>>>>> I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
>>>>>>> to be defined first, e.g.
>>>>>>> 
>>>>>>> csound -odac0 --use-system-sr test.csd
>>>>>>> 
>>>>>>> ========================
>>>>>>> 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 29 Apr 2019, at 15:24, Victor Lazzarini 
>>>>>>>> 
>>>>>>>> wrote:
>>>>>>>> 
>>>>>>>> The only thing that exists at the moment is --get-system-sr to query the system sr:
>>>>>>>> 
>>>>>>>> csound -odac --get-system-sr
>>>>>>>> 
>>>>>>>> ========================
>>>>>>>> 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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson 
>>>>>>>>> 
>>>>>>>>> wrote:
>>>>>>>>> 
>>>>>>>>> In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.
>>>>>>>>> 
>>>>>>>>> On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> wrote:
>>>>>>>>> I know about that. I was secretly hoping that csound would be smart 
>>>>>>>>> enough and when leaving sr unset it would use the system sr, but it 
>>>>>>>>> defaults to 44100. In most cases the backend has a fixed samplerate and 
>>>>>>>>> csound already knows about it, so the question is: would it be possible 
>>>>>>>>> to default to the system sr when no sr is present and output is to dac? 
>>>>>>>>> Or maybe add a possibility to do something like `--sample-rate=system`?
>>>>>>>>> 
>>>>>>>>> On 29.04.19 14:32, Rory Walsh wrote:
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>> I'm not sure about this, but you can override the orchestra SR using
>>>>>>>>>> the ```--sample-rate=N``` command line flag. I do this when loading
>>>>>>>>>> Csound instruments in a DAW, so that they use the same SR as the host.
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> wrote:
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>> Maybe this has been solved already. I remember participating in a
>>>>>>>>>>> discussion over default sr being hardcoded to 44100. Is there currently
>>>>>>>>>>> an option to specify "use the system sr" when using -odac and a backend
>>>>>>>>>>> with a fixed sr (jack) ?
>>>>>>>>>>> 
>>>>>>>>>>> Csound mailing list
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>>>> 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
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>>> 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
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>> 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 
>>>>>>>>> 
>>>>>>>>> Csound@listserv.heanet.ie 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
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>> 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
>>>>>>> 
>>>>>>> 
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> 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 Csound@listserv.heanet.ie 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
>>>>> 
>>>>> Csound@listserv.heanet.ie
>>>>> 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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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
>> 
>> Csound@listserv.heanet.ie
>> 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 Csound@listserv.heanet.ie 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
Csound@listserv.heanet.ie
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

Date2019-05-01 21:43
FromEduardo Moguillansky
SubjectRe: [Csnd] sr when using a backend with fixed sr
Works great, thanks very much for this.

On 01.05.19 22:10, Victor Lazzarini wrote:
> yes, I had to adjust the jack module for this. Try now.
> ALSA is not for this ready yet, I have to go into linux to fix it.
> ========================
> 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 1 May 2019, at 20:25, Eduardo Moguillansky  wrote:
>>
>> I can't get this to work. In particular, using a file without any options inside CsOptions and calling it with
>>
>> csound -+rtaudio=jack -odac --use-system-sr srtest.csd
>>
>> keeps trying to use 44100 as a samplerate, independent of jack being configured to use 48000.
>>
>>
>> 
>> 
>> 
>>
>> 
>> ksmps  = 64
>> nchnls = 2
>> 0dbfs  = 1
>>
>> instr 1
>>      out oscili:a(0.1, 1000)
>> endin
>>
>> 
>>
>> 
>>
>> i1 0 10
>>
>> 
>> 
>>
>> On 01.05.19 20:10, Victor Lazzarini wrote:
>>> So I had a closer look and by re-ordering the operations I managed to provide a better
>>> implementation of the --use-system-sr flag. Tested with portaudio and jack.
>>>
>>> Only relevant with realtime output, no-op if other output destinations are used or
>>> if the sampling rate is overridden with another option.
>>> It is also only guaranteed to be implemented with Csound output modules.
>>>
>>> The flag might not work with host implemented IOs, which need to call the following
>>> function as early as possible, certainly before csoundStart() to record the
>>> value of the system sr.
>>>
>>>    /**
>>>     * If val > 0, sets the internal variable holding the system HW sr.
>>>     * Returns the stored value containing the system HW sr.
>>>     */
>>>    PUBLIC MYFLT csoundSystemSr(CSOUND *csound, MYFLT val);
>>>
>>>
>>> ========================
>>> 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 29 Apr 2019, at 21:37, Victor Lazzarini 
>>>>   wrote:
>>>>
>>>> That's not the issue. We get the SR alright, but the way things work currently, we need to open output in the module before we have
>>>> it. This is after Csound has set its own SR.
>>>>
>>>> What we do is open, read the value, and close it, then continue on with the Csound
>>>> startup. This works but not with the Jack IO  which fails to be reopen. We can get the
>>>> SR then end the process, but that's all.
>>>>
>>>> Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>> Maynooth University
>>>> Ireland
>>>>
>>>> On 29 Apr 2019, at 21:31, Anders Genell
>>>> 
>>>>   wrote:
>>>>
>>>>
>>>>> A colleague was recently trying to get sample rate from jack and found a function for it in the api docs. Don’t know if it helps here though...
>>>>>
>>>>>
>>>>> http://jackaudio.org/files/refman.pdf
>>>>>   page 36.
>>>>>
>>>>> Regards,
>>>>> Anders
>>>>>
>>>>> 29 apr. 2019 kl. 20:09 skrev Victor Lazzarini
>>>>> 
>>>>> :
>>>>>
>>>>>
>>>>>> No, it doesn’t work with Jack. I think it is to do with the double loading that we need to do to
>>>>>> get the sr from the system. Might need to do something different.
>>>>>> ========================
>>>>>> 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 29 Apr 2019, at 18:13, Eduardo Moguillansky 
>>>>>>>   wrote:
>>>>>>>
>>>>>>> Thanks for this. I tested it but I can't get it to work as expected. I am working in linux and if jack is configured with sr=48000 the following csd will not work. I tried changing the order of the arguments, or passing these at the command line, but I always get the error
>>>>>>>
>>>>>>> system sr: 48000.000000
>>>>>>> *** rtjack: sample rate 44100 does not match JACK sample rate 48000
>>>>>>>
>>>>>>> ----
>>>>>>>
>>>>>>> 
>>>>>>> 
>>>>>>> -+rtaudio=jack
>>>>>>> -odac
>>>>>>> --use-system-sr
>>>>>>>
>>>>>>> --daemon
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> 
>>>>>>> ; sr     = 44100
>>>>>>> ksmps  = 64
>>>>>>> nchnls = 2
>>>>>>> 0dbfs  = 1
>>>>>>>
>>>>>>> instr 1
>>>>>>>     out oscili:a(0.2, 1000)
>>>>>>> endin
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> i 1 0 -1
>>>>>>>
>>>>>>> 
>>>>>>> 
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 29.04.19 16:40, Victor Lazzarini wrote:
>>>>>>>
>>>>>>>
>>>>>>>> I’ve added the option --use-system-sr which should do the job. It needs -odac or similar
>>>>>>>> to be defined first, e.g.
>>>>>>>>
>>>>>>>> csound -odac0 --use-system-sr test.csd
>>>>>>>>
>>>>>>>> ========================
>>>>>>>> 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 29 Apr 2019, at 15:24, Victor Lazzarini 
>>>>>>>>>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> The only thing that exists at the moment is --get-system-sr to query the system sr:
>>>>>>>>>
>>>>>>>>> csound -odac --get-system-sr
>>>>>>>>>
>>>>>>>>> ========================
>>>>>>>>> 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 29 Apr 2019, at 14:27, Hlöðver Sigurðsson 
>>>>>>>>>>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> In theory I think this should be possible. I was first skeptical because sometimes jack and alsa are valid dacs. But when not specified, csound will choose alsa as default, therefore it could query alsa's sr. But this would need to be done for all audio modules I assume.
>>>>>>>>>>
>>>>>>>>>> On Mon, 29 Apr 2019 at 14:49, Eduardo Moguillansky
>>>>>>>>>>
>>>>>>>>>> 
>>>>>>>>>>
>>>>>>>>>> wrote:
>>>>>>>>>> I know about that. I was secretly hoping that csound would be smart
>>>>>>>>>> enough and when leaving sr unset it would use the system sr, but it
>>>>>>>>>> defaults to 44100. In most cases the backend has a fixed samplerate and
>>>>>>>>>> csound already knows about it, so the question is: would it be possible
>>>>>>>>>> to default to the system sr when no sr is present and output is to dac?
>>>>>>>>>> Or maybe add a possibility to do something like `--sample-rate=system`?
>>>>>>>>>>
>>>>>>>>>> On 29.04.19 14:32, Rory Walsh wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> I'm not sure about this, but you can override the orchestra SR using
>>>>>>>>>>> the ```--sample-rate=N``` command line flag. I do this when loading
>>>>>>>>>>> Csound instruments in a DAW, so that they use the same SR as the host.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Mon, 29 Apr 2019 at 11:35, Eduardo Moguillansky
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> 
>>>>>>>>>>>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> Maybe this has been solved already. I remember participating in a
>>>>>>>>>>>> discussion over default sr being hardcoded to 44100. Is there currently
>>>>>>>>>>>> an option to specify "use the system sr" when using -odac and a backend
>>>>>>>>>>>> with a fixed sr (jack) ?
>>>>>>>>>>>>
>>>>>>>>>>>> Csound mailing list
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>>>>> 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
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>> Csound@listserv.heanet.ie 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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>> 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 Csound@listserv.heanet.ie 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
>>>>>>
>>>>>> Csound@listserv.heanet.ie
>>>>>> 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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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
>>>
>>> Csound@listserv.heanet.ie
>>> 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 Csound@listserv.heanet.ie 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
> Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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