Need some help with audio output

Hi all, I'm very new to Csound and still going over the tutorials.

I'm not having issues getting the code to compile (using Qutecsound) but am experiencing distortion and peaks in the audio output when using the amplitude settings in the tutorial.

for example:

sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

instr1
a1 oscil 10000, 440, 1
out a1
endin

will produce the appropriate sine wave but the amplitude is set way too high and the signal gets distorted. In the bottom panel it says in red "samples out of range:xxx" and gives an integer.

Now if I lower the amplitude to 1 or below, it gives a nice clear tone, no clipping, distortion or artifacts...

instr1

a1 oscil .7, 440, 1
out a1

endin

So my question is whether this is an issue where I need to adjust sample rate in my soundcard or something I need to configure in Csound.

Thanks!! hopefully this is enough info to solve the issue, if not let me know and I'll post more specific system info.

Shouldn't happen...

Well, I just grabbed the code from your post and ran it (with a simple score file -- oscil.sco from the examples) and I get exactly what I'd expect: an output amplitude of 10000.

The only simple thing I can think of that might cause that is an odd sine table in the score. For example if the table was non-normalized (like 'f 1 0 16384 -10 10' for instance). What's the score you're using?

I don't use QuteCsound, so I don't know, but it may be using odd defaults somewhere, such as setting the output dB level. Not sure how it would do that, though, as I see no command option for it.

There is a '0dbfs' opcode that sets the scaling of audio, but you don't seem to be using that anywhere.

One thing I'm fairly sure it's not (!) is a sound card problem. The out-of-range values are being generated by Csound, which doesn't know anything about the stuff downstream that gets the data it provides. It's almost certainly something real simple! (:-))

Hi Pete, Thanks for getting

Hi Pete,

Thanks for getting back to me...

The score is just this

f1 0 4096 10 1
i1 0 3

e

I got that straight from the Dr. B TOOTorial. The QuteCsound header in the bundled example files read like this though...

sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1

Also I noticed that all the instruments in the QuteCsound examples use decimal values in the amplitude variable as well.

for example:
instr1
kFreq line 100, 5, 1000
aOut oscili .2, kFreq, 1
outs aOut, aOut
endin

score then reads
f1 0 1024 10 1
i1 0 5
e

So I think you're right about it being something in QuteCsound, some default setting that I should probably change.

Thanks!!

Ahah!

"0dbfs = 1"

Yup -- that'd do it! 0dbfs represents maximum amplitude -- anything over that is out-of-range. I believe that setting is now becoming the recommended plan, though I haven't caught on yet myself!

There may be some QuteCsound setting for that, or you could just go with the flow and adjust the orchestra scaling to '1'.

Thanks!

Sweet!! That pretty much solved the problem. It turns out I had the 0dbfs = 1 line in the header while I was working on the TOOT examples without even realizing it was there and what it actually did.

I deleted the 0dbfs line, reran an example with the amp values changed to larger integers and experienced no clipping and no out of range samples.

However, I ran a more sophisticated instrument after that and still experienced a few samples out of range, though very small (like 100 as opposed to 16000) which was just barely audible. With some minor amplitude adjustment it went away...

I'm going to post that full instrument/score in a bit along with what the console is outputting for you to look at if thats okay... maybe I'm still doing something wrong and don't understand what I need to do to correct it. I feel like I'm not pushing the amps too hard, so I don't know why there are still samples out of range.

I appreciate your help!! Thanks!!

z pack kamagra uk Canadian pharmacy viagra buy zithromax z-pack staxyn viagra uk buy viagra uk cheap generic viagra viagra online z-pak cialis online generic viagra Canadian pharmacy cialis uk ed pills generic cialis ed drugs pharmacy uk avanafil z pak zpak zpack