Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Re: 24bit->16bit conversion in Csound

Date2008-12-10 18:23
Frommark jamerson
Subject[Csnd] Re: Re: Re: 24bit->16bit conversion in Csound
   I need to fix what i just said,  I actually used soundin,  but the iformat issue was in my fout line.  

  fout    "1ksine-16bit-from 24.wav", 2, a1    

         gives the good version


  fout    "1ksine-16bit-from 24.wav", 12, a1


         gives the bad version


                         Mark 


----- Original Message ----
From: mark jamerson 
To: csound@lists.bath.ac.uk
Sent: Wednesday, December 10, 2008 12:20:32 PM
Subject: [Csnd] Re: Re: 24bit->16bit conversion in Csound


    I figured out the problem, and I think it might be a bug.  I retried using diskin, with iformat set to 2, and I got a clean sine with the expected amount of noise.  However, during my previous attempts I was using iformat=12, to indicate a WAV format, 16bit w/ header file.  iformat=12 gave me the bad version.  Maybe there is a bug caused by this somehow.  


                 Mark 


----- Original Message ----
From: victor 
To: csound@lists.bath.ac.uk
Sent: Wednesday, December 10, 2008 11:31:37 AM
Subject: [Csnd] Re: 24bit->16bit conversion in Csound

I don't follow you. If you open a soundfile with diskin or diskin2, whatever
encoding it is, and then run csound as normal, you will get a perfect
16bit file

Victor

----- Original Message ----- From: "mark jamerson" 
To: "Csound" 
Sent: Wednesday, December 10, 2008 4:56 PM
Subject: [Csnd] 24bit->16bit conversion in Csound


> 
> Hello,
> 
>     During an effort to look into the effects of dither, I was trying to convert 24bit files into 16bit files.  The file used was a mono 1k sine tone generated in Csound, using GEN10, with table size 65536, and an oscil amplitude of 10000.  This file sounded and looked perfect.  Then I tried converting the file to a 16bit file in Csound.  I tried loscil and fout to write a 16bit file.  The result was unacceptable, with what sounded like FM sideband modulation. The spectrum analysis also looked extremely messy, with a bunch of extra noise all over the place.  Next I tried using diskin followed by soundin, figuring it might be a problem with my loscil setup. The same results, exactly.  I know that converting a 24bit file to a 16bit file without using dither will lead to a degradation in sound quality, but this seemed excessive.  In an attempt to verify my concerns, I tried the same sort of experiment in a consumer DAW software, by rendering the same 24bit
> file as a 16bit file, with no dither, and got a much cleaner result.  The new file sounded indiscernable form the 24bit source, but the spectrum analysis confirmed a difference, with extra noise across the spectrum, but not anywhere near the levels of the Csound version.
>    So here's my question:  Does anyone do this sort of conversion in Csound, and get acceptable results, if so what methods do you use?  Also, something I just thought of is that I am using the Float version of Csound, is this possibly the cause of these results (would the double version eliminate this sort of thing)?
> 
> 
> Mark
> 
> 
> 
> 
> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" 



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



      


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"