[Csnd] sr when using a backend with fixed sr

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] sr when using a backend with fixed sr

moguillansky
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
[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
|

Re: [Csnd] sr when using a backend with fixed sr

rorywalsh
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
<[hidden email]> 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
> [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
|

Re: [Csnd] sr when using a backend with fixed sr

moguillansky
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
> <[hidden email]> 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
>> [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
|

Re: [Csnd] sr when using a backend with fixed sr

hlolli
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 <[hidden email]> 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
> <[hidden email]> 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
>> [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
|

Re: [Csnd] sr when using a backend with fixed sr

Victor Lazzarini-2
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 <[hidden email]> 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 <[hidden email]> 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
> > <[hidden email]> 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
> >> [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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] sr when using a backend with fixed sr

Victor Lazzarini-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
>>> <[hidden email]> 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
>>>> [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


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
|

Re: [Csnd] sr when using a backend with fixed sr

luis jure
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
[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
|

Re: [Csnd] sr when using a backend with fixed sr

moguillansky
In reply to this post by Victor Lazzarini-2

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 [hidden email] 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 [hidden email] 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 [hidden email] 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
[hidden email] 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
[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

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
|

Re: [Csnd] sr when using a backend with fixed sr

Victor Lazzarini-2
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 <[hidden email]> 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 <[hidden email]>
>>>  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 <[hidden email]>
>>>>  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
>>>> <[hidden email]>
>>>>  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
>>>>>
>>>>> <[hidden email]>
>>>>>  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
>>>>>>
>>>>>> [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
>>>
>>
>> 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
|

Re: [Csnd] sr when using a backend with fixed sr

genell
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 <[hidden email]>:

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 <[hidden email]> 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 <[hidden email]>
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 <[hidden email]>
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
<[hidden email]>
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

<[hidden email]>
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

[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


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
|

Re: [Csnd] sr when using a backend with fixed sr

Victor Lazzarini-2
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 <[hidden email]> 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 <[hidden email]>:

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 <[hidden email]> 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 <[hidden email]>
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 <[hidden email]>
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
<[hidden email]>
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

<[hidden email]>
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

[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


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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] sr when using a backend with fixed sr

jpff
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 <[hidden email]> 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 < [hidden email]> 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 < [hidden email]>:

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 <[hidden email]> 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 <[hidden email]>
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 <[hidden email]>
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
<[hidden email]>
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

<[hidden email]>
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

[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


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
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
|

Re: [Csnd] sr when using a backend with fixed sr

Victor Lazzarini-2
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 <[hidden email]> 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 <[hidden email]> 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 < [hidden email]> 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 < [hidden email]>:

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 <[hidden email]> 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 <[hidden email]>
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 <[hidden email]>
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
<[hidden email]>
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

<[hidden email]>
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

[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


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
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
|

Re: [Csnd] sr when using a backend with fixed sr

Victor Lazzarini-2
In reply to this post by Victor Lazzarini-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>:
>>
>>> 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 <[hidden email]> 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 <[hidden email]>
>>>>>> 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 <[hidden email]>
>>>>>>> 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
>>>>>>> <[hidden email]>
>>>>>>> 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
>>>>>>>>
>>>>>>>> <[hidden email]>
>>>>>>>> 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
>>>>>>>>>
>>>>>>>>> [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
>>>>>>
>>>>>
>>>>> 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


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
|

Re: [Csnd] sr when using a backend with fixed sr

moguillansky

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 [hidden email] 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 [hidden email] 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 [hidden email]:

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 [hidden email] 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 [hidden email]
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 [hidden email]
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 
[hidden email]
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

[hidden email]
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

[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

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

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
|

Re: [Csnd] sr when using a backend with fixed sr

Victor Lazzarini-2
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 <[hidden email]> 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.
>
>
> <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 <[hidden email]>
>>>  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
>>> <[hidden email]>
>>>  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
>>>> <[hidden email]>
>>>> :
>>>>
>>>>
>>>>> 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 <[hidden email]>
>>>>>>  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 <[hidden email]>
>>>>>>>>
>>>>>>>> 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 <[hidden email]>
>>>>>>>>>
>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>> <[hidden email]>
>>>>>>>>>
>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> <[hidden email]>
>>>>>>>>>>
>>>>>>>>>> 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
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> [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
>>>>>>>>
>>>>>>>>
>>>>>>> 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
>>>
>>
>> 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
|

Re: [Csnd] sr when using a backend with fixed sr

moguillansky
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 <[hidden email]> 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.
>>
>>
>> <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 <[hidden email]>
>>>>   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
>>>> <[hidden email]>
>>>>   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
>>>>> <[hidden email]>
>>>>> :
>>>>>
>>>>>
>>>>>> 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 <[hidden email]>
>>>>>>>   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 <[hidden email]>
>>>>>>>>>
>>>>>>>>> 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 <[hidden email]>
>>>>>>>>>>
>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>>>> <[hidden email]>
>>>>>>>>>>
>>>>>>>>>> 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
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> <[hidden email]>
>>>>>>>>>>>
>>>>>>>>>>> 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
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> [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
>>>>>>>>>
>>>>>>>>>
>>>>>>>> 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
>>>>
>>> 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