Csound Csound-dev Csound-tekno Search About

Opcode to get information on which output devices are connected? (CsoundQt)

Date2016-01-04 11:31
FromMarieCurie
SubjectOpcode to get information on which output devices are connected? (CsoundQt)
Is there an Opcode to know which output device will be used?

I'm just starting with Csound. I'm working on multichannel output (5.1). The
preferences in CsoundQt for output are set to dac2, which ist the
multichannel sound card if connected. In case that it is not connected and I
run some code in CsoundQt it sends a warning message to the control window,
that the default will be used and I can hear the sound of the first two
channels (L,R). The sound of the other channels gets lost.

In such a case I want to do the mapping of the 6 channels to two channels:
L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need because this is
redundant - there is no high pass filter applied to the other channels) and
to switch from using outch to outs (or giving only 2 outputs to outch). Is
there an Opcode to detect if dac1 or dac2 is used (or which dac is
connected), such that I can switch accordingly?



-----
cheers,

Karin
--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output-devices-are-connected-CsoundQt-tp5745914.html
Sent from the Csound - General mailing list archive at Nabble.com.

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

Date2016-01-04 11:54
FromRory Walsh
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
No, there isn't one. And you won't be able to switch dynamically during a performance. You need to pick your soundcard in advance, and then stick with it for the duration of the performance.

On 4 January 2016 at 11:31, MarieCurie <karin.daum@desy.de> wrote:
Is there an Opcode to know which output device will be used?

I'm just starting with Csound. I'm working on multichannel output (5.1). The
preferences in CsoundQt for output are set to dac2, which ist the
multichannel sound card if connected. In case that it is not connected and I
run some code in CsoundQt it sends a warning message to the control window,
that the default will be used and I can hear the sound of the first two
channels (L,R). The sound of the other channels gets lost.

In such a case I want to do the mapping of the 6 channels to two channels:
L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need because this is
redundant - there is no high pass filter applied to the other channels) and
to switch from using outch to outs (or giving only 2 outputs to outch). Is
there an Opcode to detect if dac1 or dac2 is used (or which dac is
connected), such that I can switch accordingly?



-----
cheers,

Karin
--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output-devices-are-connected-CsoundQt-tp5745914.html
Sent from the Csound - General mailing list archive at Nabble.com.

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

Date2016-01-04 12:14
FromMarieCurie
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)

I try always to be lazy. I did not want to switch dynamically during the performance. I simply wanted the signals from the other channels to the first two channels if only stereo is available. Since I get the warning message I thought this could be also accessible on the opcode level such that the piece of code could look like this


if gistereo then ; gistereo would be such a global variable which would be set once at the beginning

aoutL = aoutL+aoutSL+aoutC*0.707
aoutR = aoutR+aoutSR+aoutC*0.707
outch 1, aoutL, 2 aoutR
else
  outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
endif 

internally this info exists, otherwise I would not expect the warning to be printed.

It’s a pity that this is not available on the opcode level

Any manual intervention is a potential source of problems. I may simply forget what I did before and spend my time looking for bugs until I realise that I’ve changed something.  

cheers,

Karin

On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]> wrote:

No, there isn't one. And you won't be able to switch dynamically during a performance. You need to pick your soundcard in advance, and then stick with it for the duration of the performance.

On 4 January 2016 at 11:31, MarieCurie <<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
Is there an Opcode to know which output device will be used?

I'm just starting with Csound. I'm working on multichannel output (5.1). The
preferences in CsoundQt for output are set to dac2, which ist the
multichannel sound card if connected. In case that it is not connected and I
run some code in CsoundQt it sends a warning message to the control window,
that the default will be used and I can hear the sound of the first two
channels (L,R). The sound of the other channels gets lost.

In such a case I want to do the mapping of the 6 channels to two channels:
L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need because this is
redundant - there is no high pass filter applied to the other channels) and
to switch from using outch to outs (or giving only 2 outputs to outch). Is
there an Opcode to detect if dac1 or dac2 is used (or which dac is
connected), such that I can switch accordingly?



-----
cheers,

Karin
--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output-devices-are-connected-CsoundQt-tp5745914.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=1" target="_top" rel="nofollow" link="external" class="">[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 <a href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=2" target="_top" rel="nofollow" link="external" class="">[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


To unsubscribe from Opcode to get information on which output devices are connected? (CsoundQt), click here.
NAML

cheers,

Karin


View this message in context: Re: [Csnd] Opcode to get information on which output devices are connected? (CsoundQt)
Sent from the Csound - General mailing list archive at Nabble.com.
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

Date2016-01-04 12:20
FromRory Walsh
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
It looks like CsoundQT chooses the default audio card if the one specified is not connected. Csound won't do this on its own. It will just tell you that it can't connect to the chosen audio card. In this case CsoundQT is providing you the information, it's not coming from Csound.
You could ask the CsoundQT devs to create a NumberOfChannels macro that you could access in your code. With that information you could set up your instrument as you wish.

On 4 January 2016 at 12:14, MarieCurie <karin.daum@desy.de> wrote:
I try always to be lazy. I did not want to switch dynamically during the performance. I simply wanted the signals from the other channels to the first two channels if only stereo is available. Since I get the warning message I thought this could be also accessible on the opcode level such that the piece of code could look like this

if gistereo then ; gistereo would be such a global variable which would be set once at the beginning

aoutL = aoutL+aoutSL+aoutC*0.707
aoutR = aoutR+aoutSR+aoutC*0.707
outch 1, aoutL, 2 aoutR
else
  outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
endif 

internally this info exists, otherwise I would not expect the warning to be printed.

It’s a pity that this is not available on the opcode level

Any manual intervention is a potential source of problems. I may simply forget what I did before and spend my time looking for bugs until I realise that I’ve changed something.  

cheers,

Karin

On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]> wrote:

No, there isn't one. And you won't be able to switch dynamically during a performance. You need to pick your soundcard in advance, and then stick with it for the duration of the performance.

On 4 January 2016 at 11:31, MarieCurie <<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
Is there an Opcode to know which output device will be used?

I'm just starting with Csound. I'm working on multichannel output (5.1). The
preferences in CsoundQt for output are set to dac2, which ist the
multichannel sound card if connected. In case that it is not connected and I
run some code in CsoundQt it sends a warning message to the control window,
that the default will be used and I can hear the sound of the first two
channels (L,R). The sound of the other channels gets lost.

In such a case I want to do the mapping of the 6 channels to two channels:
L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need because this is
redundant - there is no high pass filter applied to the other channels) and
to switch from using outch to outs (or giving only 2 outputs to outch). Is
there an Opcode to detect if dac1 or dac2 is used (or which dac is
connected), such that I can switch accordingly?



-----
cheers,

Karin
--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output-devices-are-connected-CsoundQt-tp5745914.html
Sent from the Csound - General mailing list archive at Nabble.com.

Csound mailing list
<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=1" target="_top" rel="nofollow" link="external" class="">[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 <a href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=2" target="_top" rel="nofollow" link="external" class="">[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


To unsubscribe from Opcode to get information on which output devices are connected? (CsoundQt), click here.
NAML

cheers,

Karin


View this message in context: Re: [Csnd] Opcode to get information on which output devices are connected? (CsoundQt)

Sent from the Csound - General mailing list archive at Nabble.com.
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

Date2016-01-04 12:37
Fromjpff
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
You might be able to harness the nchnls variable to select the right outch 
but  cannot think of an easy way to set nchnls based on dac used.


On Mon, 4 Jan 2016, MarieCurie wrote:

> I try always to be lazy. I did not want to switch dynamically during the
> performance. I simply wanted the signals from the other channels to the first
> two channels if only stereo is available. Since I get the warning message I
> thought this could be also accessible on the opcode level such that the piece
> of code could look like this
> if gistereo then ; gistereo would be such a global variable which would be set
> once at the beginning
> 
> aoutL = aoutL+aoutSL+aoutC*0.707
> aoutR = aoutR+aoutSR+aoutC*0.707
> outch 1, aoutL, 2 aoutR
> else
>   outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
> endif 
> 
> internally this info exists, otherwise I would not expect the warning to be
> printed.
> 
> It???s a pity that this is not available on the opcode level
> 
> Any manual intervention is a potential source of problems. I may simply forget
> what I did before and spend my time looking for bugs until I realise that
> I???ve changed something.  
> 
> cheers,
> 
> Karin
>
>       On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>       wrote:
> 
> No, there isn't one. And you won't be able to switch dynamically during
> a performance. You need to pick your soundcard in advance, and then
> stick with it for the duration of the performance.
> 
> On 4 January 2016 at 11:31, MarieCurie < href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0"
> target="_top" rel="nofollow" link="external" class="">[hidden email]>
> wrote:
>       Is there an Opcode to know which output device will be used?
>
>       I'm just starting with Csound. I'm working on multichannel
>       output (5.1). The
>       preferences in CsoundQt for output are set to dac2, which
>       ist the
>       multichannel sound card if connected. In case that it is not
>       connected and I
>       run some code in CsoundQt it sends a warning message to the
>       control window,
>       that the default will be used and I can hear the sound of
>       the first two
>       channels (L,R). The sound of the other channels gets lost.
>
>       In such a case I want to do the mapping of the 6 channels to
>       two channels:
>       L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>       because this is
>       redundant - there is no high pass filter applied to the
>       other channels) and
>       to switch from using outch to outs (or giving only 2 outputs
>       to outch). Is
>       there an Opcode to detect if dac1 or dac2 is used (or which
>       dac is
>       connected), such that I can switch accordingly?
> 
> 
>
>       -----
>       cheers,
>
>       Karin
>       --
>       View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>       -devices-are-connected-CsoundQt-tp5745914.html
>       Sent from the Csound - General mailing list archive at
>       Nabble.com.
>
>       Csound mailing list
>              href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1"
>       target="_top" rel="nofollow" link="external"
>       class="">[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  href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2"
> target="_top" rel="nofollow" link="external" class="">[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
> 
> ______________________________________________________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
> -devices-are-connected-CsoundQt-tp5745914p5745917.html
> To unsubscribe from Opcode to get information on which output devices
> are connected? (CsoundQt), click here.
> NAML
> 
> 
> cheers, Karin
> 
> ______________________________________________________________________________
> View this message in context: Re: [Csnd] Opcode to get information on which
> output devices are connected? (CsoundQt) Sent from the Csound - General
> mailing list archive at Nabble.com. 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

Date2016-01-04 12:49
FromVictor Lazzarini
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
similar ways to get this.

We could store it in OPARM maybe?
========================
Dr 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 4 Jan 2016, at 12:37, jpff  wrote:
> 
> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
> 
> 
> On Mon, 4 Jan 2016, MarieCurie wrote:
> 
>> I try always to be lazy. I did not want to switch dynamically during the
>> performance. I simply wanted the signals from the other channels to the first
>> two channels if only stereo is available. Since I get the warning message I
>> thought this could be also accessible on the opcode level such that the piece
>> of code could look like this
>> if gistereo then ; gistereo would be such a global variable which would be set
>> once at the beginning
>> aoutL = aoutL+aoutSL+aoutC*0.707
>> aoutR = aoutR+aoutSR+aoutC*0.707
>> outch 1, aoutL, 2 aoutR
>> else
>>   outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>> endif 
>> internally this info exists, otherwise I would not expect the warning to be
>> printed.
>> It???s a pity that this is not available on the opcode level
>> Any manual intervention is a potential source of problems. I may simply forget
>> what I did before and spend my time looking for bugs until I realise that
>> I???ve changed something.  
>> cheers,
>> Karin
>> 
>>      On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>      wrote:
>> No, there isn't one. And you won't be able to switch dynamically during
>> a performance. You need to pick your soundcard in advance, and then
>> stick with it for the duration of the performance.
>> On 4 January 2016 at 11:31, MarieCurie <> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0"
>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>> wrote:
>>      Is there an Opcode to know which output device will be used?
>> 
>>      I'm just starting with Csound. I'm working on multichannel
>>      output (5.1). The
>>      preferences in CsoundQt for output are set to dac2, which
>>      ist the
>>      multichannel sound card if connected. In case that it is not
>>      connected and I
>>      run some code in CsoundQt it sends a warning message to the
>>      control window,
>>      that the default will be used and I can hear the sound of
>>      the first two
>>      channels (L,R). The sound of the other channels gets lost.
>> 
>>      In such a case I want to do the mapping of the 6 channels to
>>      two channels:
>>      L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>      because this is
>>      redundant - there is no high pass filter applied to the
>>      other channels) and
>>      to switch from using outch to outs (or giving only 2 outputs
>>      to outch). Is
>>      there an Opcode to detect if dac1 or dac2 is used (or which
>>      dac is
>>      connected), such that I can switch accordingly?
>> 
>>      -----
>>      cheers,
>> 
>>      Karin
>>      --
>>      View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>      -devices-are-connected-CsoundQt-tp5745914.html
>>      Sent from the Csound - General mailing list archive at
>>      Nabble.com.
>> 
>>      Csound mailing list
>>      >      href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1"
>>      target="_top" rel="nofollow" link="external"
>>      class="">[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 > href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2"
>> target="_top" rel="nofollow" link="external" class="">[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
>> ______________________________________________________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>> To unsubscribe from Opcode to get information on which output devices
>> are connected? (CsoundQt), click here.
>> NAML
>> cheers, Karin
>> ______________________________________________________________________________
>> View this message in context: Re: [Csnd] Opcode to get information on which
>> output devices are connected? (CsoundQt) Sent from the Csound - General
>> mailing list archive at Nabble.com. 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

Date2016-01-04 13:01
FromOeyvind Brandtsegg
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
My usual workaround is to set the global var nchnls manually according
to the currently used soundcard,
then used this code in my audio output instrument:

if nchnls > 2 then
    outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
else
    aLeft = a1+a2+...
    aRight = ...
    outch 1, aLeft, 2, aRight
endif


2016-01-04 13:49 GMT+01:00 Victor Lazzarini :
> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
> similar ways to get this.
>
> We could store it in OPARM maybe?
> ========================
> Dr 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 4 Jan 2016, at 12:37, jpff  wrote:
>>
>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>
>>
>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>
>>> I try always to be lazy. I did not want to switch dynamically during the
>>> performance. I simply wanted the signals from the other channels to the first
>>> two channels if only stereo is available. Since I get the warning message I
>>> thought this could be also accessible on the opcode level such that the piece
>>> of code could look like this
>>> if gistereo then ; gistereo would be such a global variable which would be set
>>> once at the beginning
>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>> outch 1, aoutL, 2 aoutR
>>> else
>>>   outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>> endif
>>> internally this info exists, otherwise I would not expect the warning to be
>>> printed.
>>> It???s a pity that this is not available on the opcode level
>>> Any manual intervention is a potential source of problems. I may simply forget
>>> what I did before and spend my time looking for bugs until I realise that
>>> I???ve changed something.
>>> cheers,
>>> Karin
>>>
>>>      On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>      wrote:
>>> No, there isn't one. And you won't be able to switch dynamically during
>>> a performance. You need to pick your soundcard in advance, and then
>>> stick with it for the duration of the performance.
>>> On 4 January 2016 at 11:31, MarieCurie <>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0"
>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>> wrote:
>>>      Is there an Opcode to know which output device will be used?
>>>
>>>      I'm just starting with Csound. I'm working on multichannel
>>>      output (5.1). The
>>>      preferences in CsoundQt for output are set to dac2, which
>>>      ist the
>>>      multichannel sound card if connected. In case that it is not
>>>      connected and I
>>>      run some code in CsoundQt it sends a warning message to the
>>>      control window,
>>>      that the default will be used and I can hear the sound of
>>>      the first two
>>>      channels (L,R). The sound of the other channels gets lost.
>>>
>>>      In such a case I want to do the mapping of the 6 channels to
>>>      two channels:
>>>      L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>      because this is
>>>      redundant - there is no high pass filter applied to the
>>>      other channels) and
>>>      to switch from using outch to outs (or giving only 2 outputs
>>>      to outch). Is
>>>      there an Opcode to detect if dac1 or dac2 is used (or which
>>>      dac is
>>>      connected), such that I can switch accordingly?
>>>
>>>      -----
>>>      cheers,
>>>
>>>      Karin
>>>      --
>>>      View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>      -devices-are-connected-CsoundQt-tp5745914.html
>>>      Sent from the Csound - General mailing list archive at
>>>      Nabble.com.
>>>
>>>      Csound mailing list
>>>      >>      href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1"
>>>      target="_top" rel="nofollow" link="external"
>>>      class="">[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 >> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2"
>>> target="_top" rel="nofollow" link="external" class="">[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
>>> ______________________________________________________________________________
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>> To unsubscribe from Opcode to get information on which output devices
>>> are connected? (CsoundQt), click here.
>>> NAML
>>> cheers, Karin
>>> ______________________________________________________________________________
>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>> mailing list archive at Nabble.com. 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


Date2016-01-04 19:08
FromVictor Lazzarini
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see). 
That was pretty easy. However, is it of any use, since it does not change nchnls?

Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
Not sure if the current sequencing of init operations in the code allows for that.

========================
Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg  wrote:
> 
> My usual workaround is to set the global var nchnls manually according
> to the currently used soundcard,
> then used this code in my audio output instrument:
> 
> if nchnls > 2 then
>    outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
> else
>    aLeft = a1+a2+...
>    aRight = ...
>    outch 1, aLeft, 2, aRight
> endif
> 
> 
> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini :
>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>> similar ways to get this.
>> 
>> We could store it in OPARM maybe?
>> ========================
>> Dr 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 4 Jan 2016, at 12:37, jpff  wrote:
>>> 
>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>> 
>>> 
>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>> 
>>>> I try always to be lazy. I did not want to switch dynamically during the
>>>> performance. I simply wanted the signals from the other channels to the first
>>>> two channels if only stereo is available. Since I get the warning message I
>>>> thought this could be also accessible on the opcode level such that the piece
>>>> of code could look like this
>>>> if gistereo then ; gistereo would be such a global variable which would be set
>>>> once at the beginning
>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>>> outch 1, aoutL, 2 aoutR
>>>> else
>>>>  outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>>> endif
>>>> internally this info exists, otherwise I would not expect the warning to be
>>>> printed.
>>>> It???s a pity that this is not available on the opcode level
>>>> Any manual intervention is a potential source of problems. I may simply forget
>>>> what I did before and spend my time looking for bugs until I realise that
>>>> I???ve changed something.
>>>> cheers,
>>>> Karin
>>>> 
>>>>     On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>>     wrote:
>>>> No, there isn't one. And you won't be able to switch dynamically during
>>>> a performance. You need to pick your soundcard in advance, and then
>>>> stick with it for the duration of the performance.
>>>> On 4 January 2016 at 11:31, MarieCurie <>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0"
>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>>> wrote:
>>>>     Is there an Opcode to know which output device will be used?
>>>> 
>>>>     I'm just starting with Csound. I'm working on multichannel
>>>>     output (5.1). The
>>>>     preferences in CsoundQt for output are set to dac2, which
>>>>     ist the
>>>>     multichannel sound card if connected. In case that it is not
>>>>     connected and I
>>>>     run some code in CsoundQt it sends a warning message to the
>>>>     control window,
>>>>     that the default will be used and I can hear the sound of
>>>>     the first two
>>>>     channels (L,R). The sound of the other channels gets lost.
>>>> 
>>>>     In such a case I want to do the mapping of the 6 channels to
>>>>     two channels:
>>>>     L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>>     because this is
>>>>     redundant - there is no high pass filter applied to the
>>>>     other channels) and
>>>>     to switch from using outch to outs (or giving only 2 outputs
>>>>     to outch). Is
>>>>     there an Opcode to detect if dac1 or dac2 is used (or which
>>>>     dac is
>>>>     connected), such that I can switch accordingly?
>>>> 
>>>>     -----
>>>>     cheers,
>>>> 
>>>>     Karin
>>>>     --
>>>>     View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>     -devices-are-connected-CsoundQt-tp5745914.html
>>>>     Sent from the Csound - General mailing list archive at
>>>>     Nabble.com.
>>>> 
>>>>     Csound mailing list
>>>>     >>>     href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1"
>>>>     target="_top" rel="nofollow" link="external"
>>>>     class="">[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 >>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2"
>>>> target="_top" rel="nofollow" link="external" class="">[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
>>>> ______________________________________________________________________________
>>>> If you reply to this email, your message will be added to the discussion
>>>> below:
>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>>> To unsubscribe from Opcode to get information on which output devices
>>>> are connected? (CsoundQt), click here.
>>>> NAML
>>>> cheers, Karin
>>>> ______________________________________________________________________________
>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>>> mailing list archive at Nabble.com. 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
> 
> 
> 
> -- 
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://www.partikkelaudio.com/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
> 
> 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

Date2016-01-04 19:20
FromKarin Daum
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)

if giNumberOfCahnnels==2 then ;  where giNumberOfChannels is what you get independently from the nchnls setting

aoutL =   aoutL+aoutSL+aoutC*0.707
aoutR = aoutR+aoutSR+aoutC*0.707
outch  1, aoutL, 2 aoutR
else
   outch  1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
endif 

Cheers,

Karin

On 4 Jan 2016, at 20:08, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:

I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see).
That was pretty easy. However, is it of any use, since it does not change nchnls?

Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
Not sure if the current sequencing of init operations in the code allows for that.

========================
Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:

My usual workaround is to set the global var nchnls manually according
to the currently used soundcard,
then used this code in my audio output instrument:

if nchnls > 2 then
  outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
else
  aLeft = a1+a2+...
  aRight = ...
  outch 1, aLeft, 2, aRight
endif


2016-01-04 13:49 GMT+01:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
similar ways to get this.

We could store it in OPARM maybe?
========================
Dr 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 4 Jan 2016, at 12:37, jpff <jpff@CODEMIST.CO.UK> wrote:

You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.


On Mon, 4 Jan 2016, MarieCurie wrote:

I try always to be lazy. I did not want to switch dynamically during the
performance. I simply wanted the signals from the other channels to the first
two channels if only stereo is available. Since I get the warning message I
thought this could be also accessible on the opcode level such that the piece
of code could look like this
if gistereo then ; gistereo would be such a global variable which would be set
once at the beginning
aoutL = aoutL+aoutSL+aoutC*0.707
aoutR = aoutR+aoutSR+aoutC*0.707
outch 1, aoutL, 2 aoutR
else
outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
endif
internally this info exists, otherwise I would not expect the warning to be
printed.
It???s a pity that this is not available on the opcode level
Any manual intervention is a potential source of problems. I may simply forget
what I did before and spend my time looking for bugs until I realise that
I???ve changed something.
cheers,
Karin

   On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
   wrote:
No, there isn't one. And you won't be able to switch dynamically during
a performance. You need to pick your soundcard in advance, and then
stick with it for the duration of the performance.
On 4 January 2016 at 11:31, MarieCurie <<a
href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=0"
target="_top" rel="nofollow" link="external" class="">[hidden email]>
wrote:
   Is there an Opcode to know which output device will be used?

   I'm just starting with Csound. I'm working on multichannel
   output (5.1). The
   preferences in CsoundQt for output are set to dac2, which
   ist the
   multichannel sound card if connected. In case that it is not
   connected and I
   run some code in CsoundQt it sends a warning message to the
   control window,
   that the default will be used and I can hear the sound of
   the first two
   channels (L,R). The sound of the other channels gets lost.

   In such a case I want to do the mapping of the 6 channels to
   two channels:
   L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
   because this is
   redundant - there is no high pass filter applied to the
   other channels) and
   to switch from using outch to outs (or giving only 2 outputs
   to outch). Is
   there an Opcode to detect if dac1 or dac2 is used (or which
   dac is
   connected), such that I can switch accordingly?

   -----
   cheers,

   Karin
   --
   View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
   -devices-are-connected-CsoundQt-tp5745914.html
   Sent from the Csound - General mailing list archive at
   Nabble.com.

   Csound mailing list
   <a
   href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=1"
   target="_top" rel="nofollow" link="external"
   class="">[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 <a
href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=2"
target="_top" rel="nofollow" link="external" class="">[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
______________________________________________________________________________
If you reply to this email, your message will be added to the discussion
below:
http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
-devices-are-connected-CsoundQt-tp5745914p5745917.html
To unsubscribe from Opcode to get information on which output devices
are connected? (CsoundQt), click here.
NAML
cheers, Karin
______________________________________________________________________________
View this message in context: Re: [Csnd] Opcode to get information on which
output devices are connected? (CsoundQt) Sent from the Csound - General
mailing list archive at Nabble.com. 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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


Date2016-01-04 19:28
FromVictor Lazzarini
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
Ok, the opcode does this

idac,iadc  hw_channels

idac - the number of hw channels for output
iadc - the number of hw channels for input

I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
but I only tested on portaudio.

========================
Dr 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 4 Jan 2016, at 19:20, Karin Daum  wrote:
> 
> there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)
> 
> if giNumberOfCahnnels==2 then	;  where giNumberOfChannels is what you get independently from the nchnls setting
> 
> aoutL	=	 	aoutL+aoutSL+aoutC*0.707
> aoutR	=		aoutR+aoutSR+aoutC*0.707
> 		outch 	1, aoutL, 2 aoutR
> else
>   		outch 	1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
> endif 
> 
> Cheers,
> 
> Karin
> 
>> On 4 Jan 2016, at 20:08, Victor Lazzarini  wrote:
>> 
>> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see). 
>> That was pretty easy. However, is it of any use, since it does not change nchnls?
>> 
>> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
>> Not sure if the current sequencing of init operations in the code allows for that.
>> 
>> ========================
>> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg  wrote:
>>> 
>>> My usual workaround is to set the global var nchnls manually according
>>> to the currently used soundcard,
>>> then used this code in my audio output instrument:
>>> 
>>> if nchnls > 2 then
>>>   outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
>>> else
>>>   aLeft = a1+a2+...
>>>   aRight = ...
>>>   outch 1, aLeft, 2, aRight
>>> endif
>>> 
>>> 
>>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini :
>>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>>>> similar ways to get this.
>>>> 
>>>> We could store it in OPARM maybe?
>>>> ========================
>>>> Dr 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 4 Jan 2016, at 12:37, jpff  wrote:
>>>>> 
>>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>>>> 
>>>>> 
>>>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>>>> 
>>>>>> I try always to be lazy. I did not want to switch dynamically during the
>>>>>> performance. I simply wanted the signals from the other channels to the first
>>>>>> two channels if only stereo is available. Since I get the warning message I
>>>>>> thought this could be also accessible on the opcode level such that the piece
>>>>>> of code could look like this
>>>>>> if gistereo then ; gistereo would be such a global variable which would be set
>>>>>> once at the beginning
>>>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>>>>> outch 1, aoutL, 2 aoutR
>>>>>> else
>>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>>>>> endif
>>>>>> internally this info exists, otherwise I would not expect the warning to be
>>>>>> printed.
>>>>>> It???s a pity that this is not available on the opcode level
>>>>>> Any manual intervention is a potential source of problems. I may simply forget
>>>>>> what I did before and spend my time looking for bugs until I realise that
>>>>>> I???ve changed something.
>>>>>> cheers,
>>>>>> Karin
>>>>>> 
>>>>>>    On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>>>>    wrote:
>>>>>> No, there isn't one. And you won't be able to switch dynamically during
>>>>>> a performance. You need to pick your soundcard in advance, and then
>>>>>> stick with it for the duration of the performance.
>>>>>> On 4 January 2016 at 11:31, MarieCurie <>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0"
>>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>>>>> wrote:
>>>>>>    Is there an Opcode to know which output device will be used?
>>>>>> 
>>>>>>    I'm just starting with Csound. I'm working on multichannel
>>>>>>    output (5.1). The
>>>>>>    preferences in CsoundQt for output are set to dac2, which
>>>>>>    ist the
>>>>>>    multichannel sound card if connected. In case that it is not
>>>>>>    connected and I
>>>>>>    run some code in CsoundQt it sends a warning message to the
>>>>>>    control window,
>>>>>>    that the default will be used and I can hear the sound of
>>>>>>    the first two
>>>>>>    channels (L,R). The sound of the other channels gets lost.
>>>>>> 
>>>>>>    In such a case I want to do the mapping of the 6 channels to
>>>>>>    two channels:
>>>>>>    L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>>>>    because this is
>>>>>>    redundant - there is no high pass filter applied to the
>>>>>>    other channels) and
>>>>>>    to switch from using outch to outs (or giving only 2 outputs
>>>>>>    to outch). Is
>>>>>>    there an Opcode to detect if dac1 or dac2 is used (or which
>>>>>>    dac is
>>>>>>    connected), such that I can switch accordingly?
>>>>>> 
>>>>>>    -----
>>>>>>    cheers,
>>>>>> 
>>>>>>    Karin
>>>>>>    --
>>>>>>    View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>    -devices-are-connected-CsoundQt-tp5745914.html
>>>>>>    Sent from the Csound - General mailing list archive at
>>>>>>    Nabble.com.
>>>>>> 
>>>>>>    Csound mailing list
>>>>>>    >>>>>    href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1"
>>>>>>    target="_top" rel="nofollow" link="external"
>>>>>>    class="">[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 >>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2"
>>>>>> target="_top" rel="nofollow" link="external" class="">[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
>>>>>> ______________________________________________________________________________
>>>>>> If you reply to this email, your message will be added to the discussion
>>>>>> below:
>>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>>>>> To unsubscribe from Opcode to get information on which output devices
>>>>>> are connected? (CsoundQt), click here.
>>>>>> NAML
>>>>>> cheers, Karin
>>>>>> ______________________________________________________________________________
>>>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>>>>> mailing list archive at Nabble.com. 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
>>> 
>>> 
>>> 
>>> -- 
>>> 
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>> 
>>> http://www.partikkelaudio.com/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>> 
>>> 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

Date2016-01-04 20:05
FromMichael Gogins
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
Very useful!

Thanks,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Jan 4, 2016 at 2:28 PM, Victor Lazzarini
 wrote:
> Ok, the opcode does this
>
> idac,iadc  hw_channels
>
> idac - the number of hw channels for output
> iadc - the number of hw channels for input
>
> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
> but I only tested on portaudio.
>
> ========================
> Dr 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 4 Jan 2016, at 19:20, Karin Daum  wrote:
>>
>> there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)
>>
>> if giNumberOfCahnnels==2 then ;  where giNumberOfChannels is what you get independently from the nchnls setting
>>
>> aoutL =               aoutL+aoutSL+aoutC*0.707
>> aoutR =               aoutR+aoutSR+aoutC*0.707
>>               outch   1, aoutL, 2 aoutR
>> else
>>               outch   1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>> endif
>>
>> Cheers,
>>
>> Karin
>>
>>> On 4 Jan 2016, at 20:08, Victor Lazzarini  wrote:
>>>
>>> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see).
>>> That was pretty easy. However, is it of any use, since it does not change nchnls?
>>>
>>> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
>>> Not sure if the current sequencing of init operations in the code allows for that.
>>>
>>> ========================
>>> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg  wrote:
>>>>
>>>> My usual workaround is to set the global var nchnls manually according
>>>> to the currently used soundcard,
>>>> then used this code in my audio output instrument:
>>>>
>>>> if nchnls > 2 then
>>>>   outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
>>>> else
>>>>   aLeft = a1+a2+...
>>>>   aRight = ...
>>>>   outch 1, aLeft, 2, aRight
>>>> endif
>>>>
>>>>
>>>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini :
>>>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>>>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>>>>> similar ways to get this.
>>>>>
>>>>> We could store it in OPARM maybe?
>>>>> ========================
>>>>> Dr 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 4 Jan 2016, at 12:37, jpff  wrote:
>>>>>>
>>>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>>>>>
>>>>>>
>>>>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>>>>>
>>>>>>> I try always to be lazy. I did not want to switch dynamically during the
>>>>>>> performance. I simply wanted the signals from the other channels to the first
>>>>>>> two channels if only stereo is available. Since I get the warning message I
>>>>>>> thought this could be also accessible on the opcode level such that the piece
>>>>>>> of code could look like this
>>>>>>> if gistereo then ; gistereo would be such a global variable which would be set
>>>>>>> once at the beginning
>>>>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>>>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>>>>>> outch 1, aoutL, 2 aoutR
>>>>>>> else
>>>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>>>>>> endif
>>>>>>> internally this info exists, otherwise I would not expect the warning to be
>>>>>>> printed.
>>>>>>> It???s a pity that this is not available on the opcode level
>>>>>>> Any manual intervention is a potential source of problems. I may simply forget
>>>>>>> what I did before and spend my time looking for bugs until I realise that
>>>>>>> I???ve changed something.
>>>>>>> cheers,
>>>>>>> Karin
>>>>>>>
>>>>>>>    On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>>>>>    wrote:
>>>>>>> No, there isn't one. And you won't be able to switch dynamically during
>>>>>>> a performance. You need to pick your soundcard in advance, and then
>>>>>>> stick with it for the duration of the performance.
>>>>>>> On 4 January 2016 at 11:31, MarieCurie <>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0"
>>>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>>>>>> wrote:
>>>>>>>    Is there an Opcode to know which output device will be used?
>>>>>>>
>>>>>>>    I'm just starting with Csound. I'm working on multichannel
>>>>>>>    output (5.1). The
>>>>>>>    preferences in CsoundQt for output are set to dac2, which
>>>>>>>    ist the
>>>>>>>    multichannel sound card if connected. In case that it is not
>>>>>>>    connected and I
>>>>>>>    run some code in CsoundQt it sends a warning message to the
>>>>>>>    control window,
>>>>>>>    that the default will be used and I can hear the sound of
>>>>>>>    the first two
>>>>>>>    channels (L,R). The sound of the other channels gets lost.
>>>>>>>
>>>>>>>    In such a case I want to do the mapping of the 6 channels to
>>>>>>>    two channels:
>>>>>>>    L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>>>>>    because this is
>>>>>>>    redundant - there is no high pass filter applied to the
>>>>>>>    other channels) and
>>>>>>>    to switch from using outch to outs (or giving only 2 outputs
>>>>>>>    to outch). Is
>>>>>>>    there an Opcode to detect if dac1 or dac2 is used (or which
>>>>>>>    dac is
>>>>>>>    connected), such that I can switch accordingly?
>>>>>>>
>>>>>>>    -----
>>>>>>>    cheers,
>>>>>>>
>>>>>>>    Karin
>>>>>>>    --
>>>>>>>    View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>>    -devices-are-connected-CsoundQt-tp5745914.html
>>>>>>>    Sent from the Csound - General mailing list archive at
>>>>>>>    Nabble.com.
>>>>>>>
>>>>>>>    Csound mailing list
>>>>>>>    >>>>>>    href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1"
>>>>>>>    target="_top" rel="nofollow" link="external"
>>>>>>>    class="">[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 >>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2"
>>>>>>> target="_top" rel="nofollow" link="external" class="">[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
>>>>>>> ______________________________________________________________________________
>>>>>>> If you reply to this email, your message will be added to the discussion
>>>>>>> below:
>>>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>>>>>> To unsubscribe from Opcode to get information on which output devices
>>>>>>> are connected? (CsoundQt), click here.
>>>>>>> NAML
>>>>>>> cheers, Karin
>>>>>>> ______________________________________________________________________________
>>>>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>>>>>> mailing list archive at Nabble.com. 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
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Oeyvind Brandtsegg
>>>> Professor of Music Technology
>>>> NTNU
>>>> 7491 Trondheim
>>>> Norway
>>>> Cell: +47 92 203 205
>>>>
>>>> http://www.partikkelaudio.com/
>>>> http://soundcloud.com/brandtsegg
>>>> http://flyndresang.no/
>>>> http://soundcloud.com/t-emp
>>>>
>>>> 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

Date2016-01-04 20:13
Fromjpff
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
On Mon, 4 Jan 2016, Michael Gogins wrote:

> Very useful!
>

when documented.......

> Thanks,
> Mike
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Mon, Jan 4, 2016 at 2:28 PM, Victor Lazzarini
>  wrote:
>> Ok, the opcode does this
>>
>> idac,iadc  hw_channels
>>
>> idac - the number of hw channels for output
>> iadc - the number of hw channels for input
>>
>> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
>> but I only tested on portaudio.

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

Date2016-01-04 20:20
FromAnders Genell
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
Great!!
Wouldn't it be possible to check the number of system input and output channels for Jack? Internally there could of course be any number of channels but maybe knowing available hardware numbers would still be useful in this context?

Regards,
Anders

> 4 jan. 2016 kl. 20:28 skrev Victor Lazzarini :
> 
> Ok, the opcode does this
> 
> idac,iadc  hw_channels
> 
> idac - the number of hw channels for output
> iadc - the number of hw channels for input
> 
> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
> but I only tested on portaudio.
> 
> ========================
> Dr 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 4 Jan 2016, at 19:20, Karin Daum  wrote:
>> 
>> there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)
>> 
>> if giNumberOfCahnnels==2 then    ;  where giNumberOfChannels is what you get independently from the nchnls setting
>> 
>> aoutL    =        aoutL+aoutSL+aoutC*0.707
>> aoutR    =        aoutR+aoutSR+aoutC*0.707
>>        outch    1, aoutL, 2 aoutR
>> else
>>          outch    1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>> endif 
>> 
>> Cheers,
>> 
>> Karin
>> 
>>> On 4 Jan 2016, at 20:08, Victor Lazzarini  wrote:
>>> 
>>> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see). 
>>> That was pretty easy. However, is it of any use, since it does not change nchnls?
>>> 
>>> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
>>> Not sure if the current sequencing of init operations in the code allows for that.
>>> 
>>> ========================
>>> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg  wrote:
>>>> 
>>>> My usual workaround is to set the global var nchnls manually according
>>>> to the currently used soundcard,
>>>> then used this code in my audio output instrument:
>>>> 
>>>> if nchnls > 2 then
>>>>  outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
>>>> else
>>>>  aLeft = a1+a2+...
>>>>  aRight = ...
>>>>  outch 1, aLeft, 2, aRight
>>>> endif
>>>> 
>>>> 
>>>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini :
>>>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>>>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>>>>> similar ways to get this.
>>>>> 
>>>>> We could store it in OPARM maybe?
>>>>> ========================
>>>>> Dr 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 4 Jan 2016, at 12:37, jpff  wrote:
>>>>>> 
>>>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>>>>> 
>>>>>> 
>>>>>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>>>>>> 
>>>>>>> I try always to be lazy. I did not want to switch dynamically during the
>>>>>>> performance. I simply wanted the signals from the other channels to the first
>>>>>>> two channels if only stereo is available. Since I get the warning message I
>>>>>>> thought this could be also accessible on the opcode level such that the piece
>>>>>>> of code could look like this
>>>>>>> if gistereo then ; gistereo would be such a global variable which would be set
>>>>>>> once at the beginning
>>>>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>>>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>>>>>> outch 1, aoutL, 2 aoutR
>>>>>>> else
>>>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>>>>>> endif
>>>>>>> internally this info exists, otherwise I would not expect the warning to be
>>>>>>> printed.
>>>>>>> It???s a pity that this is not available on the opcode level
>>>>>>> Any manual intervention is a potential source of problems. I may simply forget
>>>>>>> what I did before and spend my time looking for bugs until I realise that
>>>>>>> I???ve changed something.
>>>>>>> cheers,
>>>>>>> Karin
>>>>>>> 
>>>>>>>   On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>>>>>   wrote:
>>>>>>> No, there isn't one. And you won't be able to switch dynamically during
>>>>>>> a performance. You need to pick your soundcard in advance, and then
>>>>>>> stick with it for the duration of the performance.
>>>>>>> On 4 January 2016 at 11:31, MarieCurie <>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0"
>>>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>>>>>> wrote:
>>>>>>>   Is there an Opcode to know which output device will be used?
>>>>>>> 
>>>>>>>   I'm just starting with Csound. I'm working on multichannel
>>>>>>>   output (5.1). The
>>>>>>>   preferences in CsoundQt for output are set to dac2, which
>>>>>>>   ist the
>>>>>>>   multichannel sound card if connected. In case that it is not
>>>>>>>   connected and I
>>>>>>>   run some code in CsoundQt it sends a warning message to the
>>>>>>>   control window,
>>>>>>>   that the default will be used and I can hear the sound of
>>>>>>>   the first two
>>>>>>>   channels (L,R). The sound of the other channels gets lost.
>>>>>>> 
>>>>>>>   In such a case I want to do the mapping of the 6 channels to
>>>>>>>   two channels:
>>>>>>>   L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>>>>>   because this is
>>>>>>>   redundant - there is no high pass filter applied to the
>>>>>>>   other channels) and
>>>>>>>   to switch from using outch to outs (or giving only 2 outputs
>>>>>>>   to outch). Is
>>>>>>>   there an Opcode to detect if dac1 or dac2 is used (or which
>>>>>>>   dac is
>>>>>>>   connected), such that I can switch accordingly?
>>>>>>> 
>>>>>>>   -----
>>>>>>>   cheers,
>>>>>>> 
>>>>>>>   Karin
>>>>>>>   --
>>>>>>>   View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>>   -devices-are-connected-CsoundQt-tp5745914.html
>>>>>>>   Sent from the Csound - General mailing list archive at
>>>>>>>   Nabble.com.
>>>>>>> 
>>>>>>>   Csound mailing list
>>>>>>>   >>>>>>   href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1"
>>>>>>>   target="_top" rel="nofollow" link="external"
>>>>>>>   class="">[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 >>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2"
>>>>>>> target="_top" rel="nofollow" link="external" class="">[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
>>>>>>> ______________________________________________________________________________
>>>>>>> If you reply to this email, your message will be added to the discussion
>>>>>>> below:
>>>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>>>>>> To unsubscribe from Opcode to get information on which output devices
>>>>>>> are connected? (CsoundQt), click here.
>>>>>>> NAML
>>>>>>> cheers, Karin
>>>>>>> ______________________________________________________________________________
>>>>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>>>>>> mailing list archive at Nabble.com. 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
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> 
>>>> Oeyvind Brandtsegg
>>>> Professor of Music Technology
>>>> NTNU
>>>> 7491 Trondheim
>>>> Norway
>>>> Cell: +47 92 203 205
>>>> 
>>>> http://www.partikkelaudio.com/
>>>> http://soundcloud.com/brandtsegg
>>>> http://flyndresang.no/
>>>> http://soundcloud.com/t-emp
>>>> 
>>>> 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

Date2016-01-04 20:30
FromVictor Lazzarini
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
That’s probably a different matter, needing a different approach. You would need to name
a client port and then check for how many channels it has. Still it might be possible, but through
a different method.

========================
Dr 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 4 Jan 2016, at 20:20, Anders Genell  wrote:
> 
> Great!!
> Wouldn't it be possible to check the number of system input and output channels for Jack? Internally there could of course be any number of channels but maybe knowing available hardware numbers would still be useful in this context?
> 
> Regards,
> Anders
> 
>> 4 jan. 2016 kl. 20:28 skrev Victor Lazzarini :
>> 
>> Ok, the opcode does this
>> 
>> idac,iadc  hw_channels
>> 
>> idac - the number of hw channels for output
>> iadc - the number of hw channels for input
>> 
>> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
>> but I only tested on portaudio.
>> 
>> ========================
>> Dr 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 4 Jan 2016, at 19:20, Karin Daum  wrote:
>>> 
>>> there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)
>>> 
>>> if giNumberOfCahnnels==2 then    ;  where giNumberOfChannels is what you get independently from the nchnls setting
>>> 
>>> aoutL    =        aoutL+aoutSL+aoutC*0.707
>>> aoutR    =        aoutR+aoutSR+aoutC*0.707
>>>       outch    1, aoutL, 2 aoutR
>>> else
>>>         outch    1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>> endif 
>>> 
>>> Cheers,
>>> 
>>> Karin
>>> 
>>>> On 4 Jan 2016, at 20:08, Victor Lazzarini  wrote:
>>>> 
>>>> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see). 
>>>> That was pretty easy. However, is it of any use, since it does not change nchnls?
>>>> 
>>>> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
>>>> Not sure if the current sequencing of init operations in the code allows for that.
>>>> 
>>>> ========================
>>>> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg  wrote:
>>>>> 
>>>>> My usual workaround is to set the global var nchnls manually according
>>>>> to the currently used soundcard,
>>>>> then used this code in my audio output instrument:
>>>>> 
>>>>> if nchnls > 2 then
>>>>> outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
>>>>> else
>>>>> aLeft = a1+a2+...
>>>>> aRight = ...
>>>>> outch 1, aLeft, 2, aRight
>>>>> endif
>>>>> 
>>>>> 
>>>>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini :
>>>>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>>>>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>>>>>> similar ways to get this.
>>>>>> 
>>>>>> We could store it in OPARM maybe?
>>>>>> ========================
>>>>>> Dr 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 4 Jan 2016, at 12:37, jpff  wrote:
>>>>>>> 
>>>>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>>>>>> 
>>>>>>> 
>>>>>>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>>>>>>> 
>>>>>>>> I try always to be lazy. I did not want to switch dynamically during the
>>>>>>>> performance. I simply wanted the signals from the other channels to the first
>>>>>>>> two channels if only stereo is available. Since I get the warning message I
>>>>>>>> thought this could be also accessible on the opcode level such that the piece
>>>>>>>> of code could look like this
>>>>>>>> if gistereo then ; gistereo would be such a global variable which would be set
>>>>>>>> once at the beginning
>>>>>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>>>>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>>>>>>> outch 1, aoutL, 2 aoutR
>>>>>>>> else
>>>>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>>>>>>> endif
>>>>>>>> internally this info exists, otherwise I would not expect the warning to be
>>>>>>>> printed.
>>>>>>>> It???s a pity that this is not available on the opcode level
>>>>>>>> Any manual intervention is a potential source of problems. I may simply forget
>>>>>>>> what I did before and spend my time looking for bugs until I realise that
>>>>>>>> I???ve changed something.
>>>>>>>> cheers,
>>>>>>>> Karin
>>>>>>>> 
>>>>>>>>  On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>>>>>>  wrote:
>>>>>>>> No, there isn't one. And you won't be able to switch dynamically during
>>>>>>>> a performance. You need to pick your soundcard in advance, and then
>>>>>>>> stick with it for the duration of the performance.
>>>>>>>> On 4 January 2016 at 11:31, MarieCurie <>>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0"
>>>>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>>>>>>> wrote:
>>>>>>>>  Is there an Opcode to know which output device will be used?
>>>>>>>> 
>>>>>>>>  I'm just starting with Csound. I'm working on multichannel
>>>>>>>>  output (5.1). The
>>>>>>>>  preferences in CsoundQt for output are set to dac2, which
>>>>>>>>  ist the
>>>>>>>>  multichannel sound card if connected. In case that it is not
>>>>>>>>  connected and I
>>>>>>>>  run some code in CsoundQt it sends a warning message to the
>>>>>>>>  control window,
>>>>>>>>  that the default will be used and I can hear the sound of
>>>>>>>>  the first two
>>>>>>>>  channels (L,R). The sound of the other channels gets lost.
>>>>>>>> 
>>>>>>>>  In such a case I want to do the mapping of the 6 channels to
>>>>>>>>  two channels:
>>>>>>>>  L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>>>>>>  because this is
>>>>>>>>  redundant - there is no high pass filter applied to the
>>>>>>>>  other channels) and
>>>>>>>>  to switch from using outch to outs (or giving only 2 outputs
>>>>>>>>  to outch). Is
>>>>>>>>  there an Opcode to detect if dac1 or dac2 is used (or which
>>>>>>>>  dac is
>>>>>>>>  connected), such that I can switch accordingly?
>>>>>>>> 
>>>>>>>>  -----
>>>>>>>>  cheers,
>>>>>>>> 
>>>>>>>>  Karin
>>>>>>>>  --
>>>>>>>>  View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>>>  -devices-are-connected-CsoundQt-tp5745914.html
>>>>>>>>  Sent from the Csound - General mailing list archive at
>>>>>>>>  Nabble.com.
>>>>>>>> 
>>>>>>>>  Csound mailing list
>>>>>>>>  >>>>>>>  href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1"
>>>>>>>>  target="_top" rel="nofollow" link="external"
>>>>>>>>  class="">[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 >>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2"
>>>>>>>> target="_top" rel="nofollow" link="external" class="">[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
>>>>>>>> ______________________________________________________________________________
>>>>>>>> If you reply to this email, your message will be added to the discussion
>>>>>>>> below:
>>>>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>>>>>>> To unsubscribe from Opcode to get information on which output devices
>>>>>>>> are connected? (CsoundQt), click here.
>>>>>>>> NAML
>>>>>>>> cheers, Karin
>>>>>>>> ______________________________________________________________________________
>>>>>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>>>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>>>>>>> mailing list archive at Nabble.com. 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
>>>>> 
>>>>> 
>>>>> 
>>>>> -- 
>>>>> 
>>>>> Oeyvind Brandtsegg
>>>>> Professor of Music Technology
>>>>> NTNU
>>>>> 7491 Trondheim
>>>>> Norway
>>>>> Cell: +47 92 203 205
>>>>> 
>>>>> http://www.partikkelaudio.com/
>>>>> http://soundcloud.com/brandtsegg
>>>>> http://flyndresang.no/
>>>>> http://soundcloud.com/t-emp
>>>>> 
>>>>> 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

Date2016-01-04 21:29
FromAndres Cabrera
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
Also you could hardcode your device in the CsOptions section of the csd file to override the CsoundQt settings.

Cheers,
Andrés

On Mon, Jan 4, 2016 at 12:30 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
That’s probably a different matter, needing a different approach. You would need to name
a client port and then check for how many channels it has. Still it might be possible, but through
a different method.

========================
Dr 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 4 Jan 2016, at 20:20, Anders Genell <anders.genell@gmail.com> wrote:
>
> Great!!
> Wouldn't it be possible to check the number of system input and output channels for Jack? Internally there could of course be any number of channels but maybe knowing available hardware numbers would still be useful in this context?
>
> Regards,
> Anders
>
>> 4 jan. 2016 kl. 20:28 skrev Victor Lazzarini <Victor.Lazzarini@NUIM.IE>:
>>
>> Ok, the opcode does this
>>
>> idac,iadc  hw_channels
>>
>> idac - the number of hw channels for output
>> iadc - the number of hw channels for input
>>
>> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
>> but I only tested on portaudio.
>>
>> ========================
>> Dr 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 4 Jan 2016, at 19:20, Karin Daum <karin.daum@desy.de> wrote:
>>>
>>> there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)
>>>
>>> if giNumberOfCahnnels==2 then    ;  where giNumberOfChannels is what you get independently from the nchnls setting
>>>
>>> aoutL    =        aoutL+aoutSL+aoutC*0.707
>>> aoutR    =        aoutR+aoutSR+aoutC*0.707
>>>       outch    1, aoutL, 2 aoutR
>>> else
>>>         outch    1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>> endif
>>>
>>> Cheers,
>>>
>>> Karin
>>>
>>>> On 4 Jan 2016, at 20:08, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>>>>
>>>> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see).
>>>> That was pretty easy. However, is it of any use, since it does not change nchnls?
>>>>
>>>> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
>>>> Not sure if the current sequencing of init operations in the code allows for that.
>>>>
>>>> ========================
>>>> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
>>>>>
>>>>> My usual workaround is to set the global var nchnls manually according
>>>>> to the currently used soundcard,
>>>>> then used this code in my audio output instrument:
>>>>>
>>>>> if nchnls > 2 then
>>>>> outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
>>>>> else
>>>>> aLeft = a1+a2+...
>>>>> aRight = ...
>>>>> outch 1, aLeft, 2, aRight
>>>>> endif
>>>>>
>>>>>
>>>>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>>>>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>>>>>> similar ways to get this.
>>>>>>
>>>>>> We could store it in OPARM maybe?
>>>>>> ========================
>>>>>> Dr 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 4 Jan 2016, at 12:37, jpff <jpff@CODEMIST.CO.UK> wrote:
>>>>>>>
>>>>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>>>>>>
>>>>>>>
>>>>>>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>>>>>>>
>>>>>>>> I try always to be lazy. I did not want to switch dynamically during the
>>>>>>>> performance. I simply wanted the signals from the other channels to the first
>>>>>>>> two channels if only stereo is available. Since I get the warning message I
>>>>>>>> thought this could be also accessible on the opcode level such that the piece
>>>>>>>> of code could look like this
>>>>>>>> if gistereo then ; gistereo would be such a global variable which would be set
>>>>>>>> once at the beginning
>>>>>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>>>>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>>>>>>> outch 1, aoutL, 2 aoutR
>>>>>>>> else
>>>>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>>>>>>> endif
>>>>>>>> internally this info exists, otherwise I would not expect the warning to be
>>>>>>>> printed.
>>>>>>>> It???s a pity that this is not available on the opcode level
>>>>>>>> Any manual intervention is a potential source of problems. I may simply forget
>>>>>>>> what I did before and spend my time looking for bugs until I realise that
>>>>>>>> I???ve changed something.
>>>>>>>> cheers,
>>>>>>>> Karin
>>>>>>>>
>>>>>>>>  On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>>>>>>  wrote:
>>>>>>>> No, there isn't one. And you won't be able to switch dynamically during
>>>>>>>> a performance. You need to pick your soundcard in advance, and then
>>>>>>>> stick with it for the duration of the performance.
>>>>>>>> On 4 January 2016 at 11:31, MarieCurie <<a
>>>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=0"
>>>>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>>>>>>> wrote:
>>>>>>>>  Is there an Opcode to know which output device will be used?
>>>>>>>>
>>>>>>>>  I'm just starting with Csound. I'm working on multichannel
>>>>>>>>  output (5.1). The
>>>>>>>>  preferences in CsoundQt for output are set to dac2, which
>>>>>>>>  ist the
>>>>>>>>  multichannel sound card if connected. In case that it is not
>>>>>>>>  connected and I
>>>>>>>>  run some code in CsoundQt it sends a warning message to the
>>>>>>>>  control window,
>>>>>>>>  that the default will be used and I can hear the sound of
>>>>>>>>  the first two
>>>>>>>>  channels (L,R). The sound of the other channels gets lost.
>>>>>>>>
>>>>>>>>  In such a case I want to do the mapping of the 6 channels to
>>>>>>>>  two channels:
>>>>>>>>  L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>>>>>>  because this is
>>>>>>>>  redundant - there is no high pass filter applied to the
>>>>>>>>  other channels) and
>>>>>>>>  to switch from using outch to outs (or giving only 2 outputs
>>>>>>>>  to outch). Is
>>>>>>>>  there an Opcode to detect if dac1 or dac2 is used (or which
>>>>>>>>  dac is
>>>>>>>>  connected), such that I can switch accordingly?
>>>>>>>>
>>>>>>>>  -----
>>>>>>>>  cheers,
>>>>>>>>
>>>>>>>>  Karin
>>>>>>>>  --
>>>>>>>>  View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>>>  -devices-are-connected-CsoundQt-tp5745914.html
>>>>>>>>  Sent from the Csound - General mailing list archive at
>>>>>>>>  Nabble.com.
>>>>>>>>
>>>>>>>>  Csound mailing list
>>>>>>>>  <a
>>>>>>>>  href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=1"
>>>>>>>>  target="_top" rel="nofollow" link="external"
>>>>>>>>  class="">[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 <a
>>>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=2"
>>>>>>>> target="_top" rel="nofollow" link="external" class="">[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
>>>>>>>> ______________________________________________________________________________
>>>>>>>> If you reply to this email, your message will be added to the discussion
>>>>>>>> below:
>>>>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>>>>>>> To unsubscribe from Opcode to get information on which output devices
>>>>>>>> are connected? (CsoundQt), click here.
>>>>>>>> NAML
>>>>>>>> cheers, Karin
>>>>>>>> ______________________________________________________________________________
>>>>>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>>>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>>>>>>> mailing list archive at Nabble.com. 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
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Oeyvind Brandtsegg
>>>>> Professor of Music Technology
>>>>> NTNU
>>>>> 7491 Trondheim
>>>>> Norway
>>>>> Cell: +47 92 203 205
>>>>>
>>>>> http://www.partikkelaudio.com/
>>>>> http://soundcloud.com/brandtsegg
>>>>> http://flyndresang.no/
>>>>> http://soundcloud.com/t-emp
>>>>>
>>>>> 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

Date2016-01-04 21:48
FromAnders Genell
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
That's true of course. I was just thinking it would be nice to have the new opcode report how many channels the sound card has to which the Jack server was connected at start-up. I was kind of hoping there would be some simple Jack-API call to find out that could be included in Victors new code. 

Regards,
Anders

4 jan. 2016 kl. 22:29 skrev Andres Cabrera <mantaraya36@GMAIL.COM>:

Also you could hardcode your device in the CsOptions section of the csd file to override the CsoundQt settings.

Cheers,
Andrés

On Mon, Jan 4, 2016 at 12:30 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
That’s probably a different matter, needing a different approach. You would need to name
a client port and then check for how many channels it has. Still it might be possible, but through
a different method.

========================
Dr 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 4 Jan 2016, at 20:20, Anders Genell <anders.genell@gmail.com> wrote:
>
> Great!!
> Wouldn't it be possible to check the number of system input and output channels for Jack? Internally there could of course be any number of channels but maybe knowing available hardware numbers would still be useful in this context?
>
> Regards,
> Anders
>
>> 4 jan. 2016 kl. 20:28 skrev Victor Lazzarini <Victor.Lazzarini@NUIM.IE>:
>>
>> Ok, the opcode does this
>>
>> idac,iadc  hw_channels
>>
>> idac - the number of hw channels for output
>> iadc - the number of hw channels for input
>>
>> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
>> but I only tested on portaudio.
>>
>> ========================
>> Dr 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 4 Jan 2016, at 19:20, Karin Daum <karin.daum@desy.de> wrote:
>>>
>>> there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)
>>>
>>> if giNumberOfCahnnels==2 then    ;  where giNumberOfChannels is what you get independently from the nchnls setting
>>>
>>> aoutL    =        aoutL+aoutSL+aoutC*0.707
>>> aoutR    =        aoutR+aoutSR+aoutC*0.707
>>>       outch    1, aoutL, 2 aoutR
>>> else
>>>         outch    1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>> endif
>>>
>>> Cheers,
>>>
>>> Karin
>>>
>>>> On 4 Jan 2016, at 20:08, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>>>>
>>>> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see).
>>>> That was pretty easy. However, is it of any use, since it does not change nchnls?
>>>>
>>>> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
>>>> Not sure if the current sequencing of init operations in the code allows for that.
>>>>
>>>> ========================
>>>> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
>>>>>
>>>>> My usual workaround is to set the global var nchnls manually according
>>>>> to the currently used soundcard,
>>>>> then used this code in my audio output instrument:
>>>>>
>>>>> if nchnls > 2 then
>>>>> outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
>>>>> else
>>>>> aLeft = a1+a2+...
>>>>> aRight = ...
>>>>> outch 1, aLeft, 2, aRight
>>>>> endif
>>>>>
>>>>>
>>>>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini <Victor.Lazzarini@nuim.ie>:
>>>>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>>>>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>>>>>> similar ways to get this.
>>>>>>
>>>>>> We could store it in OPARM maybe?
>>>>>> ========================
>>>>>> Dr 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 4 Jan 2016, at 12:37, jpff <jpff@CODEMIST.CO.UK> wrote:
>>>>>>>
>>>>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>>>>>>
>>>>>>>
>>>>>>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>>>>>>>
>>>>>>>> I try always to be lazy. I did not want to switch dynamically during the
>>>>>>>> performance. I simply wanted the signals from the other channels to the first
>>>>>>>> two channels if only stereo is available. Since I get the warning message I
>>>>>>>> thought this could be also accessible on the opcode level such that the piece
>>>>>>>> of code could look like this
>>>>>>>> if gistereo then ; gistereo would be such a global variable which would be set
>>>>>>>> once at the beginning
>>>>>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>>>>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>>>>>>> outch 1, aoutL, 2 aoutR
>>>>>>>> else
>>>>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>>>>>>> endif
>>>>>>>> internally this info exists, otherwise I would not expect the warning to be
>>>>>>>> printed.
>>>>>>>> It???s a pity that this is not available on the opcode level
>>>>>>>> Any manual intervention is a potential source of problems. I may simply forget
>>>>>>>> what I did before and spend my time looking for bugs until I realise that
>>>>>>>> I???ve changed something.
>>>>>>>> cheers,
>>>>>>>> Karin
>>>>>>>>
>>>>>>>>  On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>>>>>>  wrote:
>>>>>>>> No, there isn't one. And you won't be able to switch dynamically during
>>>>>>>> a performance. You need to pick your soundcard in advance, and then
>>>>>>>> stick with it for the duration of the performance.
>>>>>>>> On 4 January 2016 at 11:31, MarieCurie <<a
>>>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=0"
>>>>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>>>>>>> wrote:
>>>>>>>>  Is there an Opcode to know which output device will be used?
>>>>>>>>
>>>>>>>>  I'm just starting with Csound. I'm working on multichannel
>>>>>>>>  output (5.1). The
>>>>>>>>  preferences in CsoundQt for output are set to dac2, which
>>>>>>>>  ist the
>>>>>>>>  multichannel sound card if connected. In case that it is not
>>>>>>>>  connected and I
>>>>>>>>  run some code in CsoundQt it sends a warning message to the
>>>>>>>>  control window,
>>>>>>>>  that the default will be used and I can hear the sound of
>>>>>>>>  the first two
>>>>>>>>  channels (L,R). The sound of the other channels gets lost.
>>>>>>>>
>>>>>>>>  In such a case I want to do the mapping of the 6 channels to
>>>>>>>>  two channels:
>>>>>>>>  L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>>>>>>  because this is
>>>>>>>>  redundant - there is no high pass filter applied to the
>>>>>>>>  other channels) and
>>>>>>>>  to switch from using outch to outs (or giving only 2 outputs
>>>>>>>>  to outch). Is
>>>>>>>>  there an Opcode to detect if dac1 or dac2 is used (or which
>>>>>>>>  dac is
>>>>>>>>  connected), such that I can switch accordingly?
>>>>>>>>
>>>>>>>>  -----
>>>>>>>>  cheers,
>>>>>>>>
>>>>>>>>  Karin
>>>>>>>>  --
>>>>>>>>  View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>>>  -devices-are-connected-CsoundQt-tp5745914.html
>>>>>>>>  Sent from the Csound - General mailing list archive at
>>>>>>>>  Nabble.com.
>>>>>>>>
>>>>>>>>  Csound mailing list
>>>>>>>>  <a
>>>>>>>>  href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=1"
>>>>>>>>  target="_top" rel="nofollow" link="external"
>>>>>>>>  class="">[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 <a
>>>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=2"
>>>>>>>> target="_top" rel="nofollow" link="external" class="">[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
>>>>>>>> ______________________________________________________________________________
>>>>>>>> If you reply to this email, your message will be added to the discussion
>>>>>>>> below:
>>>>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>>>>>>> To unsubscribe from Opcode to get information on which output devices
>>>>>>>> are connected? (CsoundQt), click here.
>>>>>>>> NAML
>>>>>>>> cheers, Karin
>>>>>>>> ______________________________________________________________________________
>>>>>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>>>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>>>>>>> mailing list archive at Nabble.com. 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
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Oeyvind Brandtsegg
>>>>> Professor of Music Technology
>>>>> NTNU
>>>>> 7491 Trondheim
>>>>> Norway
>>>>> Cell: +47 92 203 205
>>>>>
>>>>> http://www.partikkelaudio.com/
>>>>> http://soundcloud.com/brandtsegg
>>>>> http://flyndresang.no/
>>>>> http://soundcloud.com/t-emp
>>>>>
>>>>> 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

Date2016-01-05 07:38
FromMarieCurie
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)

thanks, that’s great!  Karin

On 4 Jan 2016, at 20:29, Victor Lazzarini [via Csound] <[hidden email]> wrote:

Ok, the opcode does this

idac,iadc  hw_channels

idac - the number of hw channels for output
iadc - the number of hw channels for input

I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
but I only tested on portaudio.

========================
Dr 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 4 Jan 2016, at 19:20, Karin Daum <<a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
>
> there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)
>
> if giNumberOfCahnnels==2 then ;  where giNumberOfChannels is what you get independently from the nchnls setting
>
> aoutL = aoutL+aoutSL+aoutC*0.707
> aoutR = aoutR+aoutSR+aoutC*0.707
> outch 1, aoutL, 2 aoutR
> else
>   outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
> endif
>
> Cheers,
>
> Karin
>
>> On 4 Jan 2016, at 20:08, Victor Lazzarini <<a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
>>
>> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see).
>> That was pretty easy. However, is it of any use, since it does not change nchnls?
>>
>> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
>> Not sure if the current sequencing of init operations in the code allows for that.
>>
>> ========================
>> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg <<a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=2" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
>>>
>>> My usual workaround is to set the global var nchnls manually according
>>> to the currently used soundcard,
>>> then used this code in my audio output instrument:
>>>
>>> if nchnls > 2 then
>>>   outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
>>> else
>>>   aLeft = a1+a2+...
>>>   aRight = ...
>>>   outch 1, aLeft, 2, aRight
>>> endif
>>>
>>>
>>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini <<a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=3" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
>>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>>>> similar ways to get this.
>>>>
>>>> We could store it in OPARM maybe?
>>>> ========================
>>>> Dr 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 4 Jan 2016, at 12:37, jpff <<a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=4" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
>>>>>
>>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>>>>
>>>>>
>>>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>>>>
>>>>>> I try always to be lazy. I did not want to switch dynamically during the
>>>>>> performance. I simply wanted the signals from the other channels to the first
>>>>>> two channels if only stereo is available. Since I get the warning message I
>>>>>> thought this could be also accessible on the opcode level such that the piece
>>>>>> of code could look like this
>>>>>> if gistereo then ; gistereo would be such a global variable which would be set
>>>>>> once at the beginning
>>>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>>>>> outch 1, aoutL, 2 aoutR
>>>>>> else
>>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>>>>> endif
>>>>>> internally this info exists, otherwise I would not expect the warning to be
>>>>>> printed.
>>>>>> It???s a pity that this is not available on the opcode level
>>>>>> Any manual intervention is a potential source of problems. I may simply forget
>>>>>> what I did before and spend my time looking for bugs until I realise that
>>>>>> I???ve changed something.
>>>>>> cheers,
>>>>>> Karin
>>>>>>
>>>>>>    On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>>>>    wrote:
>>>>>> No, there isn't one. And you won't be able to switch dynamically during
>>>>>> a performance. You need to pick your soundcard in advance, and then
>>>>>> stick with it for the duration of the performance.
>>>>>> On 4 January 2016 at 11:31, MarieCurie <<a
>>>>>> href="<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;amp;node=5745917&amp;amp;i=0" class="">x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=0"
>>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>>>>> wrote:
>>>>>>    Is there an Opcode to know which output device will be used?
>>>>>>
>>>>>>    I'm just starting with Csound. I'm working on multichannel
>>>>>>    output (5.1). The
>>>>>>    preferences in CsoundQt for output are set to dac2, which
>>>>>>    ist the
>>>>>>    multichannel sound card if connected. In case that it is not
>>>>>>    connected and I
>>>>>>    run some code in CsoundQt it sends a warning message to the
>>>>>>    control window,
>>>>>>    that the default will be used and I can hear the sound of
>>>>>>    the first two
>>>>>>    channels (L,R). The sound of the other channels gets lost.
>>>>>>
>>>>>>    In such a case I want to do the mapping of the 6 channels to
>>>>>>    two channels:
>>>>>>    L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>>>>    because this is
>>>>>>    redundant - there is no high pass filter applied to the
>>>>>>    other channels) and
>>>>>>    to switch from using outch to outs (or giving only 2 outputs
>>>>>>    to outch). Is
>>>>>>    there an Opcode to detect if dac1 or dac2 is used (or which
>>>>>>    dac is
>>>>>>    connected), such that I can switch accordingly?
>>>>>>
>>>>>>    -----
>>>>>>    cheers,
>>>>>>
>>>>>>    Karin
>>>>>>    --
>>>>>>    View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>    -devices-are-connected-CsoundQt-tp5745914.html
>>>>>>    Sent from the Csound - General mailing list archive at
>>>>>>    Nabble.com.
>>>>>>
>>>>>>    Csound mailing list
>>>>>>    <a
>>>>>>    href="<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;amp;node=5745917&amp;amp;i=1" class="">x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=1"
>>>>>>    target="_top" rel="nofollow" link="external"
>>>>>>    class="">[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 <a
>>>>>> href="<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;amp;node=5745917&amp;amp;i=2" class="">x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=2"
>>>>>> target="_top" rel="nofollow" link="external" class="">[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
>>>>>> ______________________________________________________________________________
>>>>>> If you reply to this email, your message will be added to the discussion
>>>>>> below:
>>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>>>>> To unsubscribe from Opcode to get information on which output devices
>>>>>> are connected? (CsoundQt), click here.
>>>>>> NAML
>>>>>> cheers, Karin
>>>>>> ______________________________________________________________________________
>>>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>>>>> mailing list archive at Nabble.com. Csound mailing list
>>>>>> <a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=5" target="_top" rel="nofollow" link="external" class="">[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
>>>>> <a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=6" target="_top" rel="nofollow" link="external" class="">[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
>>>> <a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=7" target="_top" rel="nofollow" link="external" class="">[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
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> Csound mailing list
>>> <a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=8" target="_top" rel="nofollow" link="external" class="">[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
>> <a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=9" target="_top" rel="nofollow" link="external" class="">[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 <a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=10" target="_top" rel="nofollow" link="external" class="">[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
<a href="x-msg://86/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=11" target="_top" rel="nofollow" link="external" class="">[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



To unsubscribe from Opcode to get information on which output devices are connected? (CsoundQt), click here.
NAML

cheers,

Karin


View this message in context: Re: [Csnd] Opcode to get information on which output devices are connected? (CsoundQt)
Sent from the Csound - General mailing list archive at Nabble.com.
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

Date2016-01-05 08:22
FromVictor Lazzarini
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
I’ve implemented in coreaudio too now.
========================
Dr 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 5 Jan 2016, at 07:38, MarieCurie  wrote:
> 
> thanks, that’s great!  Karin
>> On 4 Jan 2016, at 20:29, Victor Lazzarini [via Csound] <[hidden email]> wrote:
>> 
>> Ok, the opcode does this 
>> 
>> idac,iadc  hw_channels 
>> 
>> idac - the number of hw channels for output 
>> iadc - the number of hw channels for input 
>> 
>> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too), 
>> but I only tested on portaudio. 
>> 
>> ======================== 
>> Dr 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 4 Jan 2016, at 19:20, Karin Daum <[hidden email]> wrote: 
>> > 
>> > there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case) 
>> > 
>> > if giNumberOfCahnnels==2 then	;  where giNumberOfChannels is what you get independently from the nchnls setting 
>> > 
>> > aoutL	=	aoutL+aoutSL+aoutC*0.707 
>> > aoutR	=	aoutR+aoutSR+aoutC*0.707 
>> > outch 1, aoutL, 2 aoutR 
>> > else 
>> >   outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR 
>> > endif 
>> > 
>> > Cheers, 
>> > 
>> > Karin 
>> > 
>> >> On 4 Jan 2016, at 20:08, Victor Lazzarini <[hidden email]> wrote: 
>> >> 
>> >> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see). 
>> >> That was pretty easy. However, is it of any use, since it does not change nchnls? 
>> >> 
>> >> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac). 
>> >> Not sure if the current sequencing of init operations in the code allows for that. 
>> >> 
>> >> ======================== 
>> >> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg <[hidden email]> wrote: 
>> >>> 
>> >>> My usual workaround is to set the global var nchnls manually according 
>> >>> to the currently used soundcard, 
>> >>> then used this code in my audio output instrument: 
>> >>> 
>> >>> if nchnls > 2 then 
>> >>>   outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ... 
>> >>> else 
>> >>>   aLeft = a1+a2+... 
>> >>>   aRight = ... 
>> >>>   outch 1, aLeft, 2, aRight 
>> >>> endif 
>> >>> 
>> >>> 
>> >>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini <[hidden email]>: 
>> >>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that 
>> >>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have 
>> >>>> similar ways to get this. 
>> >>>> 
>> >>>> We could store it in OPARM maybe? 
>> >>>> ======================== 
>> >>>> Dr 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 4 Jan 2016, at 12:37, jpff <[hidden email]> wrote: 
>> >>>>> 
>> >>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used. 
>> >>>>> 
>> >>>>> 
>> >>>>> On Mon, 4 Jan 2016, MarieCurie wrote: 
>> >>>>> 
>> >>>>>> I try always to be lazy. I did not want to switch dynamically during the 
>> >>>>>> performance. I simply wanted the signals from the other channels to the first 
>> >>>>>> two channels if only stereo is available. Since I get the warning message I 
>> >>>>>> thought this could be also accessible on the opcode level such that the piece 
>> >>>>>> of code could look like this 
>> >>>>>> if gistereo then ; gistereo would be such a global variable which would be set 
>> >>>>>> once at the beginning 
>> >>>>>> aoutL = aoutL+aoutSL+aoutC*0.707 
>> >>>>>> aoutR = aoutR+aoutSR+aoutC*0.707 
>> >>>>>> outch 1, aoutL, 2 aoutR 
>> >>>>>> else 
>> >>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR 
>> >>>>>> endif 
>> >>>>>> internally this info exists, otherwise I would not expect the warning to be 
>> >>>>>> printed. 
>> >>>>>> It???s a pity that this is not available on the opcode level 
>> >>>>>> Any manual intervention is a potential source of problems. I may simply forget 
>> >>>>>> what I did before and spend my time looking for bugs until I realise that 
>> >>>>>> I???ve changed something. 
>> >>>>>> cheers, 
>> >>>>>> Karin 
>> >>>>>> 
>> >>>>>>    On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]> 
>> >>>>>>    wrote: 
>> >>>>>> No, there isn't one. And you won't be able to switch dynamically during 
>> >>>>>> a performance. You need to pick your soundcard in advance, and then 
>> >>>>>> stick with it for the duration of the performance. 
>> >>>>>> On 4 January 2016 at 11:31, MarieCurie <> >>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0" 
>> >>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]> 
>> >>>>>> wrote: 
>> >>>>>>    Is there an Opcode to know which output device will be used? 
>> >>>>>> 
>> >>>>>>    I'm just starting with Csound. I'm working on multichannel 
>> >>>>>>    output (5.1). The 
>> >>>>>>    preferences in CsoundQt for output are set to dac2, which 
>> >>>>>>    ist the 
>> >>>>>>    multichannel sound card if connected. In case that it is not 
>> >>>>>>    connected and I 
>> >>>>>>    run some code in CsoundQt it sends a warning message to the 
>> >>>>>>    control window, 
>> >>>>>>    that the default will be used and I can hear the sound of 
>> >>>>>>    the first two 
>> >>>>>>    channels (L,R). The sound of the other channels gets lost. 
>> >>>>>> 
>> >>>>>>    In such a case I want to do the mapping of the 6 channels to 
>> >>>>>>    two channels: 
>> >>>>>>    L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need 
>> >>>>>>    because this is 
>> >>>>>>    redundant - there is no high pass filter applied to the 
>> >>>>>>    other channels) and 
>> >>>>>>    to switch from using outch to outs (or giving only 2 outputs 
>> >>>>>>    to outch). Is 
>> >>>>>>    there an Opcode to detect if dac1 or dac2 is used (or which 
>> >>>>>>    dac is 
>> >>>>>>    connected), such that I can switch accordingly? 
>> >>>>>> 
>> >>>>>>    ----- 
>> >>>>>>    cheers, 
>> >>>>>> 
>> >>>>>>    Karin 
>> >>>>>>    -- 
>> >>>>>>    View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>> >>>>>>    -devices-are-connected-CsoundQt-tp5745914.html 
>> >>>>>>    Sent from the Csound - General mailing list archive at 
>> >>>>>>    Nabble.com. 
>> >>>>>> 
>> >>>>>>    Csound mailing list 
>> >>>>>>    > >>>>>>    href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1" 
>> >>>>>>    target="_top" rel="nofollow" link="external" 
>> >>>>>>    class="">[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 > >>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2" 
>> >>>>>> target="_top" rel="nofollow" link="external" class="">[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 
>> >>>>>> ______________________________________________________________________________ 
>> >>>>>> If you reply to this email, your message will be added to the discussion 
>> >>>>>> below: 
>> >>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>> >>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html 
>> >>>>>> To unsubscribe from Opcode to get information on which output devices 
>> >>>>>> are connected? (CsoundQt), click here. 
>> >>>>>> NAML 
>> >>>>>> cheers, Karin 
>> >>>>>> ______________________________________________________________________________ 
>> >>>>>> View this message in context: Re: [Csnd] Opcode to get information on which 
>> >>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General 
>> >>>>>> mailing list archive at Nabble.com. Csound mailing list 
>> >>>>>> [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send 
>> >>>>>> bugs reports to https://github.com/csound/csound/issues Discussions of bugs 
>> >>>>>> and features can be posted here 
>> >>>>>> 
>> >>>>> 
>> >>>>> Csound mailing list 
>> >>>>> [hidden email] 
>> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>>> Send bugs reports to 
>> >>>>>     https://github.com/csound/csound/issues
>> >>>>> Discussions of bugs and features can be posted here 
>> >>>> 
>> >>>> Csound mailing list 
>> >>>> [hidden email] 
>> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>> Send bugs reports to 
>> >>>>       https://github.com/csound/csound/issues
>> >>>> Discussions of bugs and features can be posted here 
>> >>> 
>> >>> 
>> >>> 
>> >>> -- 
>> >>> 
>> >>> Oeyvind Brandtsegg 
>> >>> Professor of Music Technology 
>> >>> NTNU 
>> >>> 7491 Trondheim 
>> >>> Norway 
>> >>> Cell: +47 92 203 205 
>> >>> 
>> >>> http://www.partikkelaudio.com/
>> >>> http://soundcloud.com/brandtsegg
>> >>> http://flyndresang.no/
>> >>> http://soundcloud.com/t-emp
>> >>> 
>> >>> 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 
>> 
>> 
>> If you reply to this email, your message will be added to the discussion below:
>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output-devices-are-connected-CsoundQt-tp5745914p5745955.html
>> To unsubscribe from Opcode to get information on which output devices are connected? (CsoundQt), click here.
>> NAML
> 
> cheers, 
> 
> Karin
> 
> View this message in context: Re: [Csnd] Opcode to get information on which output devices are connected? (CsoundQt)
> Sent from the Csound - General mailing list archive at Nabble.com.
> 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

Date2016-01-05 08:22
FromVictor Lazzarini
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
It might be possible. Let me thing about it.
========================
Dr 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 4 Jan 2016, at 21:48, Anders Genell  wrote:
> 
> That's true of course. I was just thinking it would be nice to have the new opcode report how many channels the sound card has to which the Jack server was connected at start-up. I was kind of hoping there would be some simple Jack-API call to find out that could be included in Victors new code. 
> 
> Regards,
> Anders
> 
> 4 jan. 2016 kl. 22:29 skrev Andres Cabrera :
> 
>> Also you could hardcode your device in the CsOptions section of the csd file to override the CsoundQt settings.
>> 
>> Cheers,
>> Andrés
>> 
>> On Mon, Jan 4, 2016 at 12:30 PM, Victor Lazzarini  wrote:
>> That’s probably a different matter, needing a different approach. You would need to name
>> a client port and then check for how many channels it has. Still it might be possible, but through
>> a different method.
>> 
>> ========================
>> Dr 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 4 Jan 2016, at 20:20, Anders Genell  wrote:
>> >
>> > Great!!
>> > Wouldn't it be possible to check the number of system input and output channels for Jack? Internally there could of course be any number of channels but maybe knowing available hardware numbers would still be useful in this context?
>> >
>> > Regards,
>> > Anders
>> >
>> >> 4 jan. 2016 kl. 20:28 skrev Victor Lazzarini :
>> >>
>> >> Ok, the opcode does this
>> >>
>> >> idac,iadc  hw_channels
>> >>
>> >> idac - the number of hw channels for output
>> >> iadc - the number of hw channels for input
>> >>
>> >> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
>> >> but I only tested on portaudio.
>> >>
>> >> ========================
>> >> Dr 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 4 Jan 2016, at 19:20, Karin Daum  wrote:
>> >>>
>> >>> there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)
>> >>>
>> >>> if giNumberOfCahnnels==2 then    ;  where giNumberOfChannels is what you get independently from the nchnls setting
>> >>>
>> >>> aoutL    =        aoutL+aoutSL+aoutC*0.707
>> >>> aoutR    =        aoutR+aoutSR+aoutC*0.707
>> >>>       outch    1, aoutL, 2 aoutR
>> >>> else
>> >>>         outch    1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>> >>> endif
>> >>>
>> >>> Cheers,
>> >>>
>> >>> Karin
>> >>>
>> >>>> On 4 Jan 2016, at 20:08, Victor Lazzarini  wrote:
>> >>>>
>> >>>> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see).
>> >>>> That was pretty easy. However, is it of any use, since it does not change nchnls?
>> >>>>
>> >>>> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
>> >>>> Not sure if the current sequencing of init operations in the code allows for that.
>> >>>>
>> >>>> ========================
>> >>>> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg  wrote:
>> >>>>>
>> >>>>> My usual workaround is to set the global var nchnls manually according
>> >>>>> to the currently used soundcard,
>> >>>>> then used this code in my audio output instrument:
>> >>>>>
>> >>>>> if nchnls > 2 then
>> >>>>> outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
>> >>>>> else
>> >>>>> aLeft = a1+a2+...
>> >>>>> aRight = ...
>> >>>>> outch 1, aLeft, 2, aRight
>> >>>>> endif
>> >>>>>
>> >>>>>
>> >>>>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini :
>> >>>>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>> >>>>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>> >>>>>> similar ways to get this.
>> >>>>>>
>> >>>>>> We could store it in OPARM maybe?
>> >>>>>> ========================
>> >>>>>> Dr 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 4 Jan 2016, at 12:37, jpff  wrote:
>> >>>>>>>
>> >>>>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>> >>>>>>>>
>> >>>>>>>> I try always to be lazy. I did not want to switch dynamically during the
>> >>>>>>>> performance. I simply wanted the signals from the other channels to the first
>> >>>>>>>> two channels if only stereo is available. Since I get the warning message I
>> >>>>>>>> thought this could be also accessible on the opcode level such that the piece
>> >>>>>>>> of code could look like this
>> >>>>>>>> if gistereo then ; gistereo would be such a global variable which would be set
>> >>>>>>>> once at the beginning
>> >>>>>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>> >>>>>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>> >>>>>>>> outch 1, aoutL, 2 aoutR
>> >>>>>>>> else
>> >>>>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>> >>>>>>>> endif
>> >>>>>>>> internally this info exists, otherwise I would not expect the warning to be
>> >>>>>>>> printed.
>> >>>>>>>> It???s a pity that this is not available on the opcode level
>> >>>>>>>> Any manual intervention is a potential source of problems. I may simply forget
>> >>>>>>>> what I did before and spend my time looking for bugs until I realise that
>> >>>>>>>> I???ve changed something.
>> >>>>>>>> cheers,
>> >>>>>>>> Karin
>> >>>>>>>>
>> >>>>>>>>  On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>> >>>>>>>>  wrote:
>> >>>>>>>> No, there isn't one. And you won't be able to switch dynamically during
>> >>>>>>>> a performance. You need to pick your soundcard in advance, and then
>> >>>>>>>> stick with it for the duration of the performance.
>> >>>>>>>> On 4 January 2016 at 11:31, MarieCurie <> >>>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0"
>> >>>>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>> >>>>>>>> wrote:
>> >>>>>>>>  Is there an Opcode to know which output device will be used?
>> >>>>>>>>
>> >>>>>>>>  I'm just starting with Csound. I'm working on multichannel
>> >>>>>>>>  output (5.1). The
>> >>>>>>>>  preferences in CsoundQt for output are set to dac2, which
>> >>>>>>>>  ist the
>> >>>>>>>>  multichannel sound card if connected. In case that it is not
>> >>>>>>>>  connected and I
>> >>>>>>>>  run some code in CsoundQt it sends a warning message to the
>> >>>>>>>>  control window,
>> >>>>>>>>  that the default will be used and I can hear the sound of
>> >>>>>>>>  the first two
>> >>>>>>>>  channels (L,R). The sound of the other channels gets lost.
>> >>>>>>>>
>> >>>>>>>>  In such a case I want to do the mapping of the 6 channels to
>> >>>>>>>>  two channels:
>> >>>>>>>>  L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>> >>>>>>>>  because this is
>> >>>>>>>>  redundant - there is no high pass filter applied to the
>> >>>>>>>>  other channels) and
>> >>>>>>>>  to switch from using outch to outs (or giving only 2 outputs
>> >>>>>>>>  to outch). Is
>> >>>>>>>>  there an Opcode to detect if dac1 or dac2 is used (or which
>> >>>>>>>>  dac is
>> >>>>>>>>  connected), such that I can switch accordingly?
>> >>>>>>>>
>> >>>>>>>>  -----
>> >>>>>>>>  cheers,
>> >>>>>>>>
>> >>>>>>>>  Karin
>> >>>>>>>>  --
>> >>>>>>>>  View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>> >>>>>>>>  -devices-are-connected-CsoundQt-tp5745914.html
>> >>>>>>>>  Sent from the Csound - General mailing list archive at
>> >>>>>>>>  Nabble.com.
>> >>>>>>>>
>> >>>>>>>>  Csound mailing list
>> >>>>>>>>  > >>>>>>>>  href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1"
>> >>>>>>>>  target="_top" rel="nofollow" link="external"
>> >>>>>>>>  class="">[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 > >>>>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2"
>> >>>>>>>> target="_top" rel="nofollow" link="external" class="">[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
>> >>>>>>>> ______________________________________________________________________________
>> >>>>>>>> If you reply to this email, your message will be added to the discussion
>> >>>>>>>> below:
>> >>>>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>> >>>>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>> >>>>>>>> To unsubscribe from Opcode to get information on which output devices
>> >>>>>>>> are connected? (CsoundQt), click here.
>> >>>>>>>> NAML
>> >>>>>>>> cheers, Karin
>> >>>>>>>> ______________________________________________________________________________
>> >>>>>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>> >>>>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>> >>>>>>>> mailing list archive at Nabble.com. 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
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>>
>> >>>>> Oeyvind Brandtsegg
>> >>>>> Professor of Music Technology
>> >>>>> NTNU
>> >>>>> 7491 Trondheim
>> >>>>> Norway
>> >>>>> Cell: +47 92 203 205
>> >>>>>
>> >>>>> http://www.partikkelaudio.com/
>> >>>>> http://soundcloud.com/brandtsegg
>> >>>>> http://flyndresang.no/
>> >>>>> http://soundcloud.com/t-emp
>> >>>>>
>> >>>>> 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

Date2016-01-05 08:23
FromMarieCurie
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)

wouldn’t it be nice to have it also for coreaudio for Mac users? This is what I’m using. Or does both work for Macs?

 
On 4 Jan 2016, at 20:29, Victor Lazzarini [via Csound] <[hidden email]> wrote:

Ok, the opcode does this

idac,iadc  hw_channels

idac - the number of hw channels for output
iadc - the number of hw channels for input

I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
but I only tested on portaudio.

========================
Dr 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 4 Jan 2016, at 19:20, Karin Daum <<a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
>
> there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case)
>
> if giNumberOfCahnnels==2 then ;  where giNumberOfChannels is what you get independently from the nchnls setting
>
> aoutL = aoutL+aoutSL+aoutC*0.707
> aoutR = aoutR+aoutSR+aoutC*0.707
> outch 1, aoutL, 2 aoutR
> else
>   outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
> endif
>
> Cheers,
>
> Karin
>
>> On 4 Jan 2016, at 20:08, Victor Lazzarini <<a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
>>
>> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see).
>> That was pretty easy. However, is it of any use, since it does not change nchnls?
>>
>> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac).
>> Not sure if the current sequencing of init operations in the code allows for that.
>>
>> ========================
>> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg <<a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=2" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
>>>
>>> My usual workaround is to set the global var nchnls manually according
>>> to the currently used soundcard,
>>> then used this code in my audio output instrument:
>>>
>>> if nchnls > 2 then
>>>   outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ...
>>> else
>>>   aLeft = a1+a2+...
>>>   aRight = ...
>>>   outch 1, aLeft, 2, aRight
>>> endif
>>>
>>>
>>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini <<a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=3" target="_top" rel="nofollow" link="external" class="">[hidden email]>:
>>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that
>>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have
>>>> similar ways to get this.
>>>>
>>>> We could store it in OPARM maybe?
>>>> ========================
>>>> Dr 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 4 Jan 2016, at 12:37, jpff <<a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=4" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
>>>>>
>>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used.
>>>>>
>>>>>
>>>>> On Mon, 4 Jan 2016, MarieCurie wrote:
>>>>>
>>>>>> I try always to be lazy. I did not want to switch dynamically during the
>>>>>> performance. I simply wanted the signals from the other channels to the first
>>>>>> two channels if only stereo is available. Since I get the warning message I
>>>>>> thought this could be also accessible on the opcode level such that the piece
>>>>>> of code could look like this
>>>>>> if gistereo then ; gistereo would be such a global variable which would be set
>>>>>> once at the beginning
>>>>>> aoutL = aoutL+aoutSL+aoutC*0.707
>>>>>> aoutR = aoutR+aoutSR+aoutC*0.707
>>>>>> outch 1, aoutL, 2 aoutR
>>>>>> else
>>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR
>>>>>> endif
>>>>>> internally this info exists, otherwise I would not expect the warning to be
>>>>>> printed.
>>>>>> It???s a pity that this is not available on the opcode level
>>>>>> Any manual intervention is a potential source of problems. I may simply forget
>>>>>> what I did before and spend my time looking for bugs until I realise that
>>>>>> I???ve changed something.
>>>>>> cheers,
>>>>>> Karin
>>>>>>
>>>>>>    On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]>
>>>>>>    wrote:
>>>>>> No, there isn't one. And you won't be able to switch dynamically during
>>>>>> a performance. You need to pick your soundcard in advance, and then
>>>>>> stick with it for the duration of the performance.
>>>>>> On 4 January 2016 at 11:31, MarieCurie <<a
>>>>>> href="<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;amp;node=5745917&amp;amp;i=0" class="">x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=0"
>>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]>
>>>>>> wrote:
>>>>>>    Is there an Opcode to know which output device will be used?
>>>>>>
>>>>>>    I'm just starting with Csound. I'm working on multichannel
>>>>>>    output (5.1). The
>>>>>>    preferences in CsoundQt for output are set to dac2, which
>>>>>>    ist the
>>>>>>    multichannel sound card if connected. In case that it is not
>>>>>>    connected and I
>>>>>>    run some code in CsoundQt it sends a warning message to the
>>>>>>    control window,
>>>>>>    that the default will be used and I can hear the sound of
>>>>>>    the first two
>>>>>>    channels (L,R). The sound of the other channels gets lost.
>>>>>>
>>>>>>    In such a case I want to do the mapping of the 6 channels to
>>>>>>    two channels:
>>>>>>    L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need
>>>>>>    because this is
>>>>>>    redundant - there is no high pass filter applied to the
>>>>>>    other channels) and
>>>>>>    to switch from using outch to outs (or giving only 2 outputs
>>>>>>    to outch). Is
>>>>>>    there an Opcode to detect if dac1 or dac2 is used (or which
>>>>>>    dac is
>>>>>>    connected), such that I can switch accordingly?
>>>>>>
>>>>>>    -----
>>>>>>    cheers,
>>>>>>
>>>>>>    Karin
>>>>>>    --
>>>>>>    View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>>    -devices-are-connected-CsoundQt-tp5745914.html
>>>>>>    Sent from the Csound - General mailing list archive at
>>>>>>    Nabble.com.
>>>>>>
>>>>>>    Csound mailing list
>>>>>>    <a
>>>>>>    href="<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;amp;node=5745917&amp;amp;i=1" class="">x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=1"
>>>>>>    target="_top" rel="nofollow" link="external"
>>>>>>    class="">[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 <a
>>>>>> href="<a href="x-msg://76/user/SendEmail.jtp?type=node&amp;amp;node=5745917&amp;amp;i=2" class="">x-msg://76/user/SendEmail.jtp?type=node&amp;node=5745917&amp;i=2"
>>>>>> target="_top" rel="nofollow" link="external" class="">[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
>>>>>> ______________________________________________________________________________
>>>>>> If you reply to this email, your message will be added to the discussion
>>>>>> below:
>>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html
>>>>>> To unsubscribe from Opcode to get information on which output devices
>>>>>> are connected? (CsoundQt), click here.
>>>>>> NAML
>>>>>> cheers, Karin
>>>>>> ______________________________________________________________________________
>>>>>> View this message in context: Re: [Csnd] Opcode to get information on which
>>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General
>>>>>> mailing list archive at Nabble.com. Csound mailing list
>>>>>> <a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=5" target="_top" rel="nofollow" link="external" class="">[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
>>>>> <a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=6" target="_top" rel="nofollow" link="external" class="">[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
>>>> <a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=7" target="_top" rel="nofollow" link="external" class="">[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
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> Csound mailing list
>>> <a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=8" target="_top" rel="nofollow" link="external" class="">[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
>> <a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=9" target="_top" rel="nofollow" link="external" class="">[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 <a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=10" target="_top" rel="nofollow" link="external" class="">[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
<a href="x-msg://88/user/SendEmail.jtp?type=node&amp;node=5745955&amp;i=11" target="_top" rel="nofollow" link="external" class="">[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



To unsubscribe from Opcode to get information on which output devices are connected? (CsoundQt), click here.
NAML

cheers,

Karin


View this message in context: Re: [Csnd] Opcode to get information on which output devices are connected? (CsoundQt)
Sent from the Csound - General mailing list archive at Nabble.com.
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

Date2016-01-05 08:48
FromVictor Lazzarini
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
On Macs, it will work both with portaudio and coreaudio (auhal)
========================
Dr 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 5 Jan 2016, at 08:23, MarieCurie  wrote:
> 
> wouldn’t it be nice to have it also for coreaudio for Mac users? This is what I’m using. Or does both work for Macs?
>  
>> On 4 Jan 2016, at 20:29, Victor Lazzarini [via Csound] <[hidden email]> wrote:
>> 
>> Ok, the opcode does this 
>> 
>> idac,iadc  hw_channels 
>> 
>> idac - the number of hw channels for output 
>> iadc - the number of hw channels for input 
>> 
>> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too), 
>> but I only tested on portaudio. 
>> 
>> ======================== 
>> Dr 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 4 Jan 2016, at 19:20, Karin Daum <[hidden email]> wrote: 
>> > 
>> > there is no need to change nchnls. It is sufficient to get this information and use the to control the flow of this kind (in my case) 
>> > 
>> > if giNumberOfCahnnels==2 then	;  where giNumberOfChannels is what you get independently from the nchnls setting 
>> > 
>> > aoutL	=	aoutL+aoutSL+aoutC*0.707 
>> > aoutR	=	aoutR+aoutSR+aoutC*0.707 
>> > outch 1, aoutL, 2 aoutR 
>> > else 
>> >   outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR 
>> > endif 
>> > 
>> > Cheers, 
>> > 
>> > Karin 
>> > 
>> >> On 4 Jan 2016, at 20:08, Victor Lazzarini <[hidden email]> wrote: 
>> >> 
>> >> I wrote code to get the HW max number of channels in an opcode (implemented with portaudio and alsa, jack is unlimited as far as I can see). 
>> >> That was pretty easy. However, is it of any use, since it does not change nchnls? 
>> >> 
>> >> Maybe the useful thing would be to have a means of setting nchnls according to the hardware, like a new flag (--nchnls-from-dac). 
>> >> Not sure if the current sequencing of init operations in the code allows for that. 
>> >> 
>> >> ======================== 
>> >> Dr 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 4 Jan 2016, at 13:01, Oeyvind Brandtsegg <[hidden email]> wrote: 
>> >>> 
>> >>> My usual workaround is to set the global var nchnls manually according 
>> >>> to the currently used soundcard, 
>> >>> then used this code in my audio output instrument: 
>> >>> 
>> >>> if nchnls > 2 then 
>> >>>   outch 1, a1, 2, a2, 3, a3, 4, a4, 5, a5, 6, a6, ... 
>> >>> else 
>> >>>   aLeft = a1+a2+... 
>> >>>   aRight = ... 
>> >>>   outch 1, aLeft, 2, aRight 
>> >>> endif 
>> >>> 
>> >>> 
>> >>> 2016-01-04 13:49 GMT+01:00 Victor Lazzarini <[hidden email]>: 
>> >>>> I wonder if we could keep this information somewhere and then pass it to users via an opcode. I know that 
>> >>>> portaudio has maxOutputChannels and maxInputChannels device information. Other backends might have 
>> >>>> similar ways to get this. 
>> >>>> 
>> >>>> We could store it in OPARM maybe? 
>> >>>> ======================== 
>> >>>> Dr 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 4 Jan 2016, at 12:37, jpff <[hidden email]> wrote: 
>> >>>>> 
>> >>>>> You might be able to harness the nchnls variable to select the right outch but  cannot think of an easy way to set nchnls based on dac used. 
>> >>>>> 
>> >>>>> 
>> >>>>> On Mon, 4 Jan 2016, MarieCurie wrote: 
>> >>>>> 
>> >>>>>> I try always to be lazy. I did not want to switch dynamically during the 
>> >>>>>> performance. I simply wanted the signals from the other channels to the first 
>> >>>>>> two channels if only stereo is available. Since I get the warning message I 
>> >>>>>> thought this could be also accessible on the opcode level such that the piece 
>> >>>>>> of code could look like this 
>> >>>>>> if gistereo then ; gistereo would be such a global variable which would be set 
>> >>>>>> once at the beginning 
>> >>>>>> aoutL = aoutL+aoutSL+aoutC*0.707 
>> >>>>>> aoutR = aoutR+aoutSR+aoutC*0.707 
>> >>>>>> outch 1, aoutL, 2 aoutR 
>> >>>>>> else 
>> >>>>>> outch 1, aoutL, 2, aoutR, 3, aoutC, 4, aoutLFE, 5, aoutSL, 6, aoutSR 
>> >>>>>> endif 
>> >>>>>> internally this info exists, otherwise I would not expect the warning to be 
>> >>>>>> printed. 
>> >>>>>> It???s a pity that this is not available on the opcode level 
>> >>>>>> Any manual intervention is a potential source of problems. I may simply forget 
>> >>>>>> what I did before and spend my time looking for bugs until I realise that 
>> >>>>>> I???ve changed something. 
>> >>>>>> cheers, 
>> >>>>>> Karin 
>> >>>>>> 
>> >>>>>>    On 4 Jan 2016, at 12:56, rory walsh [via Csound] <[hidden email]> 
>> >>>>>>    wrote: 
>> >>>>>> No, there isn't one. And you won't be able to switch dynamically during 
>> >>>>>> a performance. You need to pick your soundcard in advance, and then 
>> >>>>>> stick with it for the duration of the performance. 
>> >>>>>> On 4 January 2016 at 11:31, MarieCurie <> >>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=0" 
>> >>>>>> target="_top" rel="nofollow" link="external" class="">[hidden email]> 
>> >>>>>> wrote: 
>> >>>>>>    Is there an Opcode to know which output device will be used? 
>> >>>>>> 
>> >>>>>>    I'm just starting with Csound. I'm working on multichannel 
>> >>>>>>    output (5.1). The 
>> >>>>>>    preferences in CsoundQt for output are set to dac2, which 
>> >>>>>>    ist the 
>> >>>>>>    multichannel sound card if connected. In case that it is not 
>> >>>>>>    connected and I 
>> >>>>>>    run some code in CsoundQt it sends a warning message to the 
>> >>>>>>    control window, 
>> >>>>>>    that the default will be used and I can hear the sound of 
>> >>>>>>    the first two 
>> >>>>>>    channels (L,R). The sound of the other channels gets lost. 
>> >>>>>> 
>> >>>>>>    In such a case I want to do the mapping of the 6 channels to 
>> >>>>>>    two channels: 
>> >>>>>>    L=L+SL+C*sqrt(2)  and R=R+SR+C*sqrt(2) (LFE I don't need 
>> >>>>>>    because this is 
>> >>>>>>    redundant - there is no high pass filter applied to the 
>> >>>>>>    other channels) and 
>> >>>>>>    to switch from using outch to outs (or giving only 2 outputs 
>> >>>>>>    to outch). Is 
>> >>>>>>    there an Opcode to detect if dac1 or dac2 is used (or which 
>> >>>>>>    dac is 
>> >>>>>>    connected), such that I can switch accordingly? 
>> >>>>>> 
>> >>>>>>    ----- 
>> >>>>>>    cheers, 
>> >>>>>> 
>> >>>>>>    Karin 
>> >>>>>>    -- 
>> >>>>>>    View this message in context:http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>> >>>>>>    -devices-are-connected-CsoundQt-tp5745914.html 
>> >>>>>>    Sent from the Csound - General mailing list archive at 
>> >>>>>>    Nabble.com. 
>> >>>>>> 
>> >>>>>>    Csound mailing list 
>> >>>>>>    > >>>>>>    href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=1" 
>> >>>>>>    target="_top" rel="nofollow" link="external" 
>> >>>>>>    class="">[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 > >>>>>> href="x-msg://76/user/SendEmail.jtp?type=node&node=5745917&i=2" 
>> >>>>>> target="_top" rel="nofollow" link="external" class="">[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 
>> >>>>>> ______________________________________________________________________________ 
>> >>>>>> If you reply to this email, your message will be added to the discussion 
>> >>>>>> below: 
>> >>>>>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output
>> >>>>>> -devices-are-connected-CsoundQt-tp5745914p5745917.html 
>> >>>>>> To unsubscribe from Opcode to get information on which output devices 
>> >>>>>> are connected? (CsoundQt), click here. 
>> >>>>>> NAML 
>> >>>>>> cheers, Karin 
>> >>>>>> ______________________________________________________________________________ 
>> >>>>>> View this message in context: Re: [Csnd] Opcode to get information on which 
>> >>>>>> output devices are connected? (CsoundQt) Sent from the Csound - General 
>> >>>>>> mailing list archive at Nabble.com. Csound mailing list 
>> >>>>>> [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send 
>> >>>>>> bugs reports to https://github.com/csound/csound/issues Discussions of bugs 
>> >>>>>> and features can be posted here 
>> >>>>>> 
>> >>>>> 
>> >>>>> Csound mailing list 
>> >>>>> [hidden email] 
>> >>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>>> Send bugs reports to 
>> >>>>>     https://github.com/csound/csound/issues
>> >>>>> Discussions of bugs and features can be posted here 
>> >>>> 
>> >>>> Csound mailing list 
>> >>>> [hidden email] 
>> >>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> >>>> Send bugs reports to 
>> >>>>       https://github.com/csound/csound/issues
>> >>>> Discussions of bugs and features can be posted here 
>> >>> 
>> >>> 
>> >>> 
>> >>> -- 
>> >>> 
>> >>> Oeyvind Brandtsegg 
>> >>> Professor of Music Technology 
>> >>> NTNU 
>> >>> 7491 Trondheim 
>> >>> Norway 
>> >>> Cell: +47 92 203 205 
>> >>> 
>> >>> http://www.partikkelaudio.com/
>> >>> http://soundcloud.com/brandtsegg
>> >>> http://flyndresang.no/
>> >>> http://soundcloud.com/t-emp
>> >>> 
>> >>> 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 
>> 
>> 
>> If you reply to this email, your message will be added to the discussion below:
>> http://csound.1045644.n5.nabble.com/Opcode-to-get-information-on-which-output-devices-are-connected-CsoundQt-tp5745914p5745955.html
>> To unsubscribe from Opcode to get information on which output devices are connected? (CsoundQt), click here.
>> NAML
> 
> cheers, 
> 
> Karin
> 
> View this message in context: Re: [Csnd] Opcode to get information on which output devices are connected? (CsoundQt)
> Sent from the Csound - General mailing list archive at Nabble.com.
> 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

Date2016-01-05 09:06
FromVictor Lazzarini
SubjectRe: Opcode to get information on which output devices are connected? (CsoundQt)
documented now.
========================
Dr 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 4 Jan 2016, at 20:13, jpff  wrote:
> 
> On Mon, 4 Jan 2016, Michael Gogins wrote:
> 
>> Very useful!
>> 
> 
> when documented.......
> 
>> Thanks,
>> Mike
>> 
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>> 
>> 
>> On Mon, Jan 4, 2016 at 2:28 PM, Victor Lazzarini
>>  wrote:
>>> Ok, the opcode does this
>>> 
>>> idac,iadc  hw_channels
>>> 
>>> idac - the number of hw channels for output
>>> iadc - the number of hw channels for input
>>> 
>>> I will commit this and document it later. It only works with portaudio and alsa, currently (I can implement it on coreaudio too),
>>> but I only tested on portaudio.
> 
> 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