Csound Csound-dev Csound-tekno Search About

[Csnd] Csound API - csoundGetAudioDevList

Date2020-03-28 20:12
Fromsjakops
Subject[Csnd] Csound API - csoundGetAudioDevList
Hi all,
I am having some trouble getting a 'correct' response from
csoundGetAudioDevList(). I don't suppose anyone here is using PureBasic, but
perhaps still someone might have an idea why it's not working for me? (I
have already asked the PureBasic community, others were not able to get it
working)

Structure CS_AUDIODEVICE 
  device_name.c[64]
  device_id.c[64]
  rt_module.c[64]
  max_nchnls.i
  isOutput.i
EndStructure

OpenLibrary(0, "csound64.dll")

PrototypeC.l ftype1()
PrototypeC.i ftype2(*p1, *p2, p3.i)

Global csoundGetVersion.ftype1      = GetFunction(0, "csoundGetVersion")
Global csoundCreate.ftype1          = GetFunction(0, "csoundCreate")
Global csoundGetAudioDevList.ftype2 = GetFunction(0,
"csoundGetAudioDevList")

Debug csoundGetVersion()                    ; works fine

csound = csoundCreate()                     ; works fine

Debug csoundGetAudioDevList(csound, 0, 1)   ; fails - always returns 0

Dim devlist.CS_AUDIODEVICE(20)

csoundGetAudioDevList(csound, @devlist, 1)

Debug devlist(0)\device_name                ; fails - always returns 0



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2020-03-29 09:42
FromTarmo Johannes
SubjectRe: [Csnd] Csound API - csoundGetAudioDevList
Hi, Eduardo!

I reviewed quickly the commits -  great work once again! To get CsoundQt I needed to fix a small bug in highlighter.cpp:554:

while (index >= 0 && index < commentIndex) {
int wordStart = index;
int wordEnd = wordStart + length;

if (index>0) {
auto prev = text.at(index - 1);
if (prev == '$' || prev == '#') {

previously prev was taken also when index was 0 and that led to crash.

On first quick try I really like the dark theme but as in influences only the editor window (at least on Linux), I am not sure if I would use it myself.

I will do Mac and Windows builds today (hopefully) and put up for testing.
I think it is best to do announce a release candidate first and ask people try it.

Thank you, Eduardo! It has been a massive work!

tarmo

Kontakt sjakops (<sorenkj@gmail.com>) kirjutas kuupäeval L, 28. märts 2020 kell 22:12:
Hi all,
I am having some trouble getting a 'correct' response from
csoundGetAudioDevList(). I don't suppose anyone here is using PureBasic, but
perhaps still someone might have an idea why it's not working for me? (I
have already asked the PureBasic community, others were not able to get it
working)

Structure CS_AUDIODEVICE
  device_name.c[64]
  device_id.c[64]
  rt_module.c[64]
  max_nchnls.i
  isOutput.i
EndStructure

OpenLibrary(0, "csound64.dll")

PrototypeC.l ftype1()
PrototypeC.i ftype2(*p1, *p2, p3.i)

Global csoundGetVersion.ftype1      = GetFunction(0, "csoundGetVersion")
Global csoundCreate.ftype1          = GetFunction(0, "csoundCreate")
Global csoundGetAudioDevList.ftype2 = GetFunction(0,
"csoundGetAudioDevList")

Debug csoundGetVersion()                    ; works fine

csound = csoundCreate()                     ; works fine

Debug csoundGetAudioDevList(csound, 0, 1)   ; fails - always returns 0

Dim devlist.CS_AUDIODEVICE(20)

csoundGetAudioDevList(csound, @devlist, 1)

Debug devlist(0)\device_name                ; fails - always returns 0



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2020-03-29 09:42
FromRory Walsh
SubjectRe: [Csnd] Csound API - csoundGetAudioDevList
I am not at a PC now to test this, but if I was, I would try to build a simple CLI app in C just to see if there are any issues with the underlying library functions. I can test them tomorrow if you don't get a chance to before then.  

On Sat 28 Mar 2020, 20:12 sjakops, <sorenkj@gmail.com> wrote:
Hi all,
I am having some trouble getting a 'correct' response from
csoundGetAudioDevList(). I don't suppose anyone here is using PureBasic, but
perhaps still someone might have an idea why it's not working for me? (I
have already asked the PureBasic community, others were not able to get it
working)

Structure CS_AUDIODEVICE
  device_name.c[64]
  device_id.c[64]
  rt_module.c[64]
  max_nchnls.i
  isOutput.i
EndStructure

OpenLibrary(0, "csound64.dll")

PrototypeC.l ftype1()
PrototypeC.i ftype2(*p1, *p2, p3.i)

Global csoundGetVersion.ftype1      = GetFunction(0, "csoundGetVersion")
Global csoundCreate.ftype1          = GetFunction(0, "csoundCreate")
Global csoundGetAudioDevList.ftype2 = GetFunction(0,
"csoundGetAudioDevList")

Debug csoundGetVersion()                    ; works fine

csound = csoundCreate()                     ; works fine

Debug csoundGetAudioDevList(csound, 0, 1)   ; fails - always returns 0

Dim devlist.CS_AUDIODEVICE(20)

csoundGetAudioDevList(csound, @devlist, 1)

Debug devlist(0)\device_name                ; fails - always returns 0



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2020-03-29 09:49
Fromjoachim heintz
SubjectRe: [Csnd] Csound API - csoundGetAudioDevList
hi tarmo -

probably you meant this to be sent to the csoundqt list, or to eduardo 
personally?

ciao -
	joachim


On 29/03/2020 10:42, Tarmo Johannes wrote:
> Hi, Eduardo!
> 
> I reviewed quickly the commits -  great work once again! To get CsoundQt 
> I needed to fix a small bug in highlighter.cpp:554:
> 
> while (index >= 0 && index < commentIndex) {
> int wordStart = index;
> int wordEnd = wordStart + length;
> 
> if (index>0) {
> auto prev = text.at (index - 1);
> if (prev == '$' || prev == '#') {
> 
> previously prev was taken also when index was 0 and that led to crash.
> 
> On first quick try I really like the dark theme but as in influences 
> only the editor window (at least on Linux), I am not sure if I would use 
> it myself.
> 
> I will do Mac and Windows builds today (hopefully) and put up for testing.
> I think it is best to do announce a release candidate first and ask 
> people try it.
> 
> Thank you, Eduardo! It has been a massive work!
> 
> tarmo
> 
> Kontakt sjakops (>) 
> kirjutas kuupäeval L, 28. märts 2020 kell 22:12:
> 
>     Hi all,
>     I am having some trouble getting a 'correct' response from
>     csoundGetAudioDevList(). I don't suppose anyone here is using
>     PureBasic, but
>     perhaps still someone might have an idea why it's not working for me? (I
>     have already asked the PureBasic community, others were not able to
>     get it
>     working)
> 
>     Structure CS_AUDIODEVICE
>        device_name.c[64]
>        device_id.c[64]
>        rt_module.c[64]
>        max_nchnls.i
>        isOutput.i
>     EndStructure
> 
>     OpenLibrary(0, "csound64.dll")
> 
>     PrototypeC.l ftype1()
>     PrototypeC.i ftype2(*p1, *p2, p3.i)
> 
>     Global csoundGetVersion.ftype1      = GetFunction(0, "csoundGetVersion")
>     Global csoundCreate.ftype1          = GetFunction(0, "csoundCreate")
>     Global csoundGetAudioDevList.ftype2 = GetFunction(0,
>     "csoundGetAudioDevList")
> 
>     Debug csoundGetVersion()                    ; works fine
> 
>     csound = csoundCreate()                     ; works fine
> 
>     Debug csoundGetAudioDevList(csound, 0, 1)   ; fails - always returns 0
> 
>     Dim devlist.CS_AUDIODEVICE(20)
> 
>     csoundGetAudioDevList(csound, @devlist, 1)
> 
>     Debug devlist(0)\device_name                ; fails - always returns 0
> 
> 
> 
>     --
>     Sent from:
>     http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
>     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

Date2020-03-29 12:14
Fromsjakops
SubjectRe: [Csnd] Csound API - csoundGetAudioDevList
Apparently csoundSetRTAudioModule() needs to be called before the call to
csoundGetAudioDevList() (maybe this info should be added to the
documentation for csoundGetAudioDevList()).
Best regards,
Søren



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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