Csound Csound-dev Csound-tekno Search About

[Csnd] Re altime Audio Output Gargling

Date2009-07-31 18:25
FromJim Aikin
Subject[Csnd] Re altime Audio Output Gargling
Now that I know my MIDI device number, I've been able to write a very simple
.csd that responds to MIDI by producing audio. Unfortunately, the audio is a
horrible gargling noise. I know the gargling is coming from the .csd,
because I can hear the release segment in the linsegr amplitude envelope.
But I should be hearing a nice sine wave....

I've tried setting -b and -B to various values in .csoundrc. None of the
settings I've tried changes the nature of the output in the slightest.

Needless to say, all of my other audio apps sound just fine.

What I think may be interesting is that the setting for -odac doesn't
actually matter. Whether I select -odac1 or -odac6, the sound always arrives
via the default audio device specified in the Windows control panel.
According to the Csound console messages window (I'm back in the GUI now --
tried it in the DOS prompt, it sounds just the same there), PortAudio device
6 is the M-Audio FW410's SPDIF output. So I think we have to assume that the
-odac setting in  is being ignored.

Now, it's possible that the GUI is inserting command-line arguments, which
are overriding . Except ... when I run the .csd from the DOS
prompt, an argument of -odac 6 is _still_ being ignored. And the manual
would lead one to believe that only the command line itself can override the
settings in .

So what I have is garbage audio that is entirely unaffected by the settings
for -b, -B, and -odac. Can anyone suggest why this might be happening?

--Jim Aikin

-- 
View this message in context: http://www.nabble.com/Realtime-Audio-Output-Gargling-tp24760065p24760065.html
Sent from the Csound - General mailing list archive at Nabble.com.


Date2009-07-31 18:27
FromMichael Gogins
Subject[Csnd] Re: Re altime Audio Output Gargling
Could you please attach your .csd so I can try it?

Regards,
Mike

On 7/31/09, Jim Aikin  wrote:
>
> Now that I know my MIDI device number, I've been able to write a very simple
> .csd that responds to MIDI by producing audio. Unfortunately, the audio is a
> horrible gargling noise. I know the gargling is coming from the .csd,
> because I can hear the release segment in the linsegr amplitude envelope.
> But I should be hearing a nice sine wave....
>
> I've tried setting -b and -B to various values in .csoundrc. None of the
> settings I've tried changes the nature of the output in the slightest.
>
> Needless to say, all of my other audio apps sound just fine.
>
> What I think may be interesting is that the setting for -odac doesn't
> actually matter. Whether I select -odac1 or -odac6, the sound always arrives
> via the default audio device specified in the Windows control panel.
> According to the Csound console messages window (I'm back in the GUI now --
> tried it in the DOS prompt, it sounds just the same there), PortAudio device
> 6 is the M-Audio FW410's SPDIF output. So I think we have to assume that the
> -odac setting in  is being ignored.
>
> Now, it's possible that the GUI is inserting command-line arguments, which
> are overriding . Except ... when I run the .csd from the DOS
> prompt, an argument of -odac 6 is _still_ being ignored. And the manual
> would lead one to believe that only the command line itself can override the
> settings in .
>
> So what I have is garbage audio that is entirely unaffected by the settings
> for -b, -B, and -odac. Can anyone suggest why this might be happening?
>
> --Jim Aikin
>
> --
> View this message in context:
> http://www.nabble.com/Realtime-Audio-Output-Gargling-tp24760065p24760065.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>


-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

Date2009-07-31 18:37
FromIain McCurdy
Subject[Csnd] RE: Re altime Audio Output Gargling
If you are using CsoundGUI make sure you don't have 'Skip CsOptions' ticked under the 'General' tab of the 'Configure' settings.
Iain

----------------------------------------
> Date: Fri, 31 Jul 2009 10:25:11 -0700
> From: midiguru23@sbcglobal.net
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] Re altime Audio Output Gargling
>
>
> Now that I know my MIDI device number, I've been able to write a very simple
> .csd that responds to MIDI by producing audio. Unfortunately, the audio is a
> horrible gargling noise. I know the gargling is coming from the .csd,
> because I can hear the release segment in the linsegr amplitude envelope.
> But I should be hearing a nice sine wave....
>
> I've tried setting -b and -B to various values in .csoundrc. None of the
> settings I've tried changes the nature of the output in the slightest.
>
> Needless to say, all of my other audio apps sound just fine.
>
> What I think may be interesting is that the setting for -odac doesn't
> actually matter. Whether I select -odac1 or -odac6, the sound always arrives
> via the default audio device specified in the Windows control panel.
> According to the Csound console messages window (I'm back in the GUI now --
> tried it in the DOS prompt, it sounds just the same there), PortAudio device
> 6 is the M-Audio FW410's SPDIF output. So I think we have to assume that the
> -odac setting in  is being ignored.
>
> Now, it's possible that the GUI is inserting command-line arguments, which
> are overriding . Except ... when I run the .csd from the DOS
> prompt, an argument of -odac 6 is _still_ being ignored. And the manual
> would lead one to believe that only the command line itself can override the
> settings in .
>
> So what I have is garbage audio that is entirely unaffected by the settings
> for -b, -B, and -odac. Can anyone suggest why this might be happening?
>
> --Jim Aikin
>
> --
> View this message in context: http://www.nabble.com/Realtime-Audio-Output-Gargling-tp24760065p24760065.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

_________________________________________________________________
Windows Liveā„¢ HotmailĀ®: Celebrate the moment with your favorite sports pics. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

Date2009-07-31 18:51
FromJim Aikin
Subject[Csnd] Re: Re altime Audio Output Gargling

Michael Gogins-2 wrote:
> 
> Could you please attach your .csd so I can try it?
> 
Happy to oblige. See below. I wrote as simple a test file as I possibly
could -- no sensing the note number or velocity, nothing.

The problem, however, is consistent across ALL .csd files, including
non-realtime files that are just supposed to be rendering a pre-written
score to the dac. So running this file won't tell you anything.

--JA



-d -odac 1



sr = 44100
kr = 100
ksmps = 441
nchnls = 2
0dbfs = 1.0

git1    ftgen 1, 0, 8192, 10, 1

instr 1
kdeclick    linsegr 0, 0.003, 1, 1, 1, 0.2, 0
asig        oscili  kdeclick, 220, 1
        outs    asig, asig
endin



f0 120



-- 
View this message in context: http://www.nabble.com/Realtime-Audio-Output-Gargling-tp24760065p24760405.html
Sent from the Csound - General mailing list archive at Nabble.com.


Date2009-07-31 19:38
FromDave Phillips
Subject[Csnd] Re: Re: Re altime Audio Output Gargling
Jim Aikin wrote:
>   
>  I wrote as simple a test file as I possibly
> could -- no sensing the note number or velocity, nothing.
>
> The problem, however, is consistent across ALL .csd files, including
> non-realtime files that are just supposed to be rendering a pre-written
> score to the dac. So running this file won't tell you anything.
>
>
>   
But it does. :)


> 
> 
> -d -odac 1
>   
I replaced your options with these for Linux with JACK :


    csound -+rtaudio=jack -d -m0 -g -f -odac:system:playback_ -b128 
--expression-opt gargling.csd

I added a specifier for the realtime output system (rtaudio) and I set 
the -b buffer option to match the JACK period size. I don't know what 
you'll do in Windows to get the same results, Michael or Art will have 
to chime in.

Btw, the complex -o definition provides autoconnection in JACK. -odac 
alone will bring Csound into JACK but won't connect it to anything.

> 
> 
>
> sr = 44100
> kr = 100
> ksmps = 441
>   
I commented out the kr line and changed ksmps to 64, again to match JACK 
settings. If you're running an ASIO system you might have some similar 
controls.

> nchnls = 2
> 0dbfs = 1.0
>
> git1    ftgen 1, 0, 8192, 10, 1
>
> instr 1
> kdeclick    linsegr 0, 0.003, 1, 1, 1, 0.2, 0
> asig        oscili  kdeclick, 220, 1
>         outs    asig, asig
> endin
>
> 
>   
All good up to here.


> 
> f0 120
> 
> 
>
>   

I added an instrument instance:

i1 0 10

because there was no MIDI input option in your original CsOptions. If I 
want MIDI input control I add these options :

    -+rtmidi=alsa -Mhw:2,0

The arcane syntax for the -M option represents the third device on my 
system. Sorry, it's ALSA-speak. Again, I'm not sure what the similar 
invocation will be for Windows Csound.

I tested it with a virtual MIDI keyboard, it worked fine. It also works 
fine with just the i1 statement (i.e. without the f0 line).

I know that the Linux way may not help you directly, but my tests showed 
that your instrument works fine. I think your CsOptions needs some 
further attention. hopefully a Windows user can help out from  here.

Best,

dp


Date2009-07-31 21:23
FromJim Aikin
Subject[Csnd] Re: Re: Re altime Audio Output Gargling

Dave Phillips wrote:
> 
> 
> I added an instrument instance:
> 
> i1 0 10
> 
> because there was no MIDI input option in your original CsOptions. If I 
> want MIDI input control I add these options :
> 
>     -+rtmidi=alsa -Mhw:2,0
> 
> I know that the Linux way may not help you directly, but my tests showed 
> that your instrument works fine. I think your CsOptions needs some 
> further attention. hopefully a Windows user can help out from  here.
> 

Yeah, it's the options that are killing me, I'm pretty sure of that. After
reading your message I tried changing ksmps a couple of different ways. That
didn't help. Currently I have

-b 128    -B 512

in .csoundrc and ksmps = 64 (or 128). Changing these settings has no
apparent effect on the audio output. And no, the checkbox in the GUI for
Skip CsOptions is not ticked.

There's no MIDI input in CSoptions because it apparently has to be placed in
.csoundrc. If I put exactly the same flag (-M1) in CSoptions, it totally
doesn't work. MIDI notes are not received. But in .csoundrc, it works.
That's why you didn't see it in CSoptions, and that's why I don't think I
need an i statement in the score. instr 1 does indeed respond to MIDI input
notes by playing. It plays audio garbage, but it does play.

Thanks for the suggestions, though.

--JA

-- 
View this message in context: http://www.nabble.com/Realtime-Audio-Output-Gargling-tp24760065p24762567.html
Sent from the Csound - General mailing list archive at Nabble.com.