Csound Csound-dev Csound-tekno Search About

Band Limited "Analog" Synthesis

Date1997-11-19 04:12
FromHans Mikelson
SubjectBand Limited "Analog" Synthesis
Hello,

I put some band limited instruments up on my web site in the analog section:

http://www.werewolf.net/~hljmm/csound/temple.orc
http://www.werewolf.net/~hljmm/csound/temple.sco

Thanks to Josep M* Comajuncosas for getting me started and a paper by Tim
Stilson for a couple of nice papers on alias free waveform generation and
digital implementation of "analog" filters. (see his CCRMA web site)

I also have a question.  What exactly do you look for in the spectrum to
check if your signal is alias free?

Bye,
Hans Mikelson




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa01059;
          26 Nov 97 16:17 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa00315;
          26 Nov 97 16:17 GMT
Received: (qmail 26919 invoked from network); 26 Nov 1997 16:17:29 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 26 Nov 1997 16:17:29 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (PAA24690); Wed, 26 Nov 1997 15:55:28 GMT
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Wed, 26 Nov 97 15:55:00 GMT
Received: from mail2.sirius.com [205.134.253.132] by hermes via ESMTP (PAA04375); Wed, 26 Nov 1997 15:54:50 GMT
From: anechoic@sirius.com
Received: from default (ppp-asmt02--052.sirius.net [205.134.229.52])
	by mail2.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA02994
	for ; Wed, 26 Nov 1997 07:57:34 -0800 (PST)
Message-Id: <1.5.4.32.19971126155621.014cbb20@pop.sirius.com>
X-Sender: anechoic@pop.sirius.com
X-Mailer: Windows Eudora Light Version 1.5.4 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Wed, 26 Nov 1997 07:56:21 -0800
To: csound@maths.ex.ac.uk
Subject: L/R stereo spread
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

does anyone know where I can get Csound examples of various enhanced stereo
techniques (ie MS, ORTF, etc)?
thanks in advance
KIM
________________________
<> kim.cascone <>

<>sound.designer -- headspace<>

<>anechoic@sirius.com<>
<>http://www.sirius.com/~anechoic<>
_____________________________________

"the meta-designer creates context, not content"
    - Gene Youngblood





Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa01214;
          26 Nov 97 16:58 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa01935;
          26 Nov 97 16:58 GMT
Received: (qmail 2306 invoked from network); 26 Nov 1997 16:58:10 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 26 Nov 1997 16:58:10 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (QAA03557); Wed, 26 Nov 1997 16:29:04 GMT
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Wed, 26 Nov 97 16:28:47 GMT
Received: from Thuban.AC.HMC.Edu [134.173.53.8] by hermes via ESMTP (QAA18442); Wed, 26 Nov 1997 16:28:38 GMT
Received: from [134.173.38.61] (Spjut.Eng.HMC.Edu)
 by THUBAN.AC.HMC.EDU (PMDF V5.1-7 #18017)
 with ESMTP id <01IQGJHTK3SU9OLUQU@THUBAN.AC.HMC.EDU> for
 csound@maths.exeter.ac.uk; Wed, 26 Nov 1997 08:30:49 PST
Date: Wed, 26 Nov 1997 08:32:04 -0800
From: Erik Spjut 
Subject: Re: Band Limited "Analog" Synthesis
In-Reply-To: <3.0.3.16.19971119041206.0bef4fd0@werewolf.net>
X-Sender: spjut@thuban.ac.hmc.edu
To: Hans Mikelson , csound@maths.ex.ac.uk
Message-Id: 
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

At 4:12 AM -0800 11/19/97, Hans Mikelson wrote:
>I also have a question.  What exactly do you look for in the spectrum to
>check if your signal is alias free?

That depends what you mean by spectrum. If you've already generated your
signal and are looking at an FFT of the output, you're too late. IF the
signal is only supposed to contain frequencies in a harmonic series AND
you're lucky (meaning that the sampling frequency and the note fundamental
are not integrally related) then the presence of non-harmonic peaks in your
spectrum clearly indicates aliasing, otherwise there's NO sure way of
knowing. (If you're one of those strange people who has a setup where you
can set the sample rate, sr, to whatever you want, try increasing sr by
small (about 10%) but non-integral amounts and see if any of your peaks
move or change shape. That's a clear sign of aliasing (ignoring problems
with windows, frame sizes and such).)

If by spectrum you mean the frequency spectrum you've calculated
analytically beforehand, then look for anything higher in frequency than
1/2 of sr. The only real place to catch aliasing is in these calculations
beforehand. Make sure your oscil waveforms are properly bandlimited, same
with your non-linear waveshaping tables, your buzzes and gbuzzes. For
almost all modulation schemes (AM, FM, Phase, Pulse-width) there are
formulas for calculating bandwidth. Make sure your modulations indices stay
below the maximum indicated in the formulas. Filters (tone, atone, reson,
etc.) can't cause aliasing but the filter response curve can alias causing
a less sharp cutoff than expected. Never use piecewise linear or
discontinuous functions for your oscil tables because jumps and sharp
corners always lead to aliasing.

That's probably more than you wanted but I tend to ramble.

-------------------------------------------------------------------------------
Erik Spjut (rhymes with cute) - Acting Director,The Center for Design Education
and/or Associate Professor of Engineering
Harvey Mudd College, Claremont, CA 91711  USA
Erik_Spjut@hmc.edu      Ph & Voice mail (909) 607-3890      Fax (909) 621-8967





Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa02035;
          26 Nov 97 22:39 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa09640;
          26 Nov 97 22:39 GMT
Received: (qmail 1158 invoked from network); 26 Nov 1997 22:39:26 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 26 Nov 1997 22:39:26 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (WAA13066); Wed, 26 Nov 1997 22:22:27 GMT
Received: from www.videobank.it by maths.exeter.ac.uk; Wed, 26 Nov 97 22:22:03 GMT
Received: from lizard (unverified [194.243.58.18]) by www.videobank.it
 (EMWAC SMTPRS 0.83) with SMTP id ;
 Wed, 26 Nov 1997 23:23:30 +0100
Message-Id: <3.0.1.16.19971125232906.2af75f6c@videobank.it>
X-Sender: rapisarda@videobank.it
X-Mailer: Windows Eudora Light Version 3.0.1 (16)
Date: Tue, 25 Nov 1997 23:29:06
To: csound@maths.ex.ac.uk
From: "Giuseppe E. Rapisarda" 
Subject: Re: soundin does not like CoolEdit samples
In-Reply-To: <3479EAE0.6B02@cableinet.co.uk>
References: <9405.199711241657@zeno.maths.exeter.ac.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

At 21.00 24/11/97 +0000, you wrote:
>james@maths.exeter.ac.uk wrote:
>> 
>> Hello!
>> 
>> I'm attempting to use soundin with some aiff samples I've created using
>> CoolEdit. The results are not good - noise that sometimes faintly
>> resembles the original sample, sometimes a power saw.
>> 
>> The samples sound fine if played with CoolEdit or other programs.
>> 
>> Furthermore, aiff files created with other tools work fine when inserted
>> into the same soundin instrument.
>> 
>> Does CoolEdit write the correct aiff format?
>> 
>> Can I use another tool to convert the CoolEdit aiffs to a form which can
>> be used by soundin?
>> 
>> Am I missing something?
>> 
>> (I'm using csound version 3.46 on a pentium 233mhz pc)
>> 
>> Thanks,
>> Craig Beiersdorff
>> 
>
>I have tried this with both Cool95 and Cool96, generating a file, and
>both read and play 
>back correctly (using our CDP programs). Are you using Cool Pro? I only
>have a demo version
>of this, so I cannot save anything.
>
>Otherwise, this looks like a header parsing problem in soundin. The aiff
>header structure is,
>for better or worse, very flexible, and not all programs can be expected
>to generate one in
>exactly the same way - even different versions of Cool may do it
>differently!
>
>(For example, they broke the WAV parsing in Cool96 to accomodate buggy
>CD-ROM writers, so 
>Cool96 crashes when it saves a CDP WAVE file (with a long header).
>Cool95 though is fine
>in this respect.)
> 
>I will test my files with Csound and report back; it will take me a
>while as I have not got
>round to building the latest version on my machine yet! If in fct you
>ARE using Cool Pro, could you email me a short soundfile I can use for
>testing?
>
>Richard Dobson
>

As far as I know there's a way to solve this problem.
If you use Cool under Windows system you can use a file.wav and not a
file.aif (Cool can save in many formats).
This an example of orchestra and score that I think you can use.

-------------------------------------
; file.orc
; Let's imagine that we're using a file named bell.wav
; It' a mono file and it's 1 second long


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


instr   1

; 0 = skiptime.
; number 4 means that it's a 16-bit short integers file. You can also write
0 instead ; of 4, so csound will take the format from the soundfile header
asig      soundin "bell.wav",0,4

out    asig
endin
----------------------
; file.sco
i1 0 1

----------------

I hope this will be helpful. 
Giuseppe Rapisarda



----------------------------------------------------------------------------
-------
Giuseppe Emanuele Rapisarda
Composer
Piano Teacher - Educational Center - Motta S. Anastasia - Italy
email:  rapisarda@videobank.it




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa03169;
          27 Nov 97 8:53 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa24348;
          27 Nov 97 8:53 GMT
Received: (qmail 20425 invoked from network); 27 Nov 1997 08:53:47 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 27 Nov 1997 08:53:47 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (IAA16216); Thu, 27 Nov 1997 08:46:02 GMT
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Thu, 27 Nov 97 08:45:43 GMT
Received: from root@pluto.senet.com.au [203.11.90.2] by hermes via ESMTP (IAA17200); Thu, 27 Nov 1997 08:45:32 GMT
Received: from c5-p39.senet.com.au (c5-p39.senet.com.au [203.56.238.40])
	by pluto.senet.com.au (8.8.7/8.8.7) with SMTP id TAA19953
	for ; Thu, 27 Nov 1997 19:18:16 +1030
Date: 27 Nov 97 19:18:16 +0930
Subject: Re: L/R stereo spread
From: Nathan Day 
To: csound@maths.ex.ac.uk
X-Mailer: Cyberdog/2.0
Mime-Version: 1.0
Message-Id: 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

>does anyone know where I can get Csound examples of various enhanced 
>stereo techniques (ie MS, ORTF, etc)?

MS, ORTF and stereo microphone techniques, MS uses a co-incident pair
of microphones, but instead of having mics for left and right, you
have Mid(cardioid) and Side(fig) mics, when the two are added together
you get a left signal and when they are subtracted you get a right
signal this means that the stereo width can be controlled at mix down,
being co-incident all of the stereo information is percieved through
amplitude differences. ORTF utilises two identicle cardioid mics
seperated by about 17cm and angled 110=B0, the stereo perception is
created by time and amplitude differences.

These types of effects can be simulated quite easily in csound
obviously using 
level differences as well as delays, filters can also be used to make
one side of the image less bright, which simulates the effect that a
persons head has, the 'hrtfer' UGEN in csound actually does these
things in a much more sophisticated way, though where you get the
HRTFcompact file from I do not know.
Nathan Day
nathand@senet.com.au





Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa03233;
          27 Nov 97 9:12 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa24825;
          27 Nov 97 9:12 GMT
Received: (qmail 21712 invoked from network); 27 Nov 1997 09:12:29 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 27 Nov 1997 09:12:29 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (JAA03717); Thu, 27 Nov 1997 09:03:21 GMT
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Thu, 27 Nov 97 09:03:04 GMT
Received: from root@pluto.senet.com.au [203.11.90.2] by hermes via ESMTP (JAA08144); Thu, 27 Nov 1997 09:02:50 GMT
Received: from c3-p32.senet.com.au (c3-p32.senet.com.au [203.56.237.161])
	by pluto.senet.com.au (8.8.7/8.8.7) with SMTP id TAA20865
	for ; Thu, 27 Nov 1997 19:35:34 +1030
Date: 27 Nov 97 19:31:03 +0930
Subject: Re: L/R stereo spread
From: Nathan Day 
To: csound@maths.ex.ac.uk
X-Mailer: Cyberdog/2.0
Mime-Version: 1.0
Message-Id: 
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

>does anyone know where I can get Csound examples of various enhanced
>stereo techniques (ie MS, ORTF, etc)?

If what you actually want to do is to create stereo sounds as opposed to
stereo positioning sounds then the most obvious way is to use reverb that
simulates the body of an instrument, like a piano, instead of a room.

Nathan Day
nathand@senet.com.au



Date1997-11-26 16:32
FromErik Spjut
SubjectRe: Band Limited "Analog" Synthesis
At 4:12 AM -0800 11/19/97, Hans Mikelson wrote:
>I also have a question.  What exactly do you look for in the spectrum to
>check if your signal is alias free?

That depends what you mean by spectrum. If you've already generated your
signal and are looking at an FFT of the output, you're too late. IF the
signal is only supposed to contain frequencies in a harmonic series AND
you're lucky (meaning that the sampling frequency and the note fundamental
are not integrally related) then the presence of non-harmonic peaks in your
spectrum clearly indicates aliasing, otherwise there's NO sure way of
knowing. (If you're one of those strange people who has a setup where you
can set the sample rate, sr, to whatever you want, try increasing sr by
small (about 10%) but non-integral amounts and see if any of your peaks
move or change shape. That's a clear sign of aliasing (ignoring problems
with windows, frame sizes and such).)

If by spectrum you mean the frequency spectrum you've calculated
analytically beforehand, then look for anything higher in frequency than
1/2 of sr. The only real place to catch aliasing is in these calculations
beforehand. Make sure your oscil waveforms are properly bandlimited, same
with your non-linear waveshaping tables, your buzzes and gbuzzes. For
almost all modulation schemes (AM, FM, Phase, Pulse-width) there are
formulas for calculating bandwidth. Make sure your modulations indices stay
below the maximum indicated in the formulas. Filters (tone, atone, reson,
etc.) can't cause aliasing but the filter response curve can alias causing
a less sharp cutoff than expected. Never use piecewise linear or
discontinuous functions for your oscil tables because jumps and sharp
corners always lead to aliasing.

That's probably more than you wanted but I tend to ramble.

-------------------------------------------------------------------------------
Erik Spjut (rhymes with cute) - Acting Director,The Center for Design Education
and/or Associate Professor of Engineering
Harvey Mudd College, Claremont, CA 91711  USA
Erik_Spjut@hmc.edu      Ph & Voice mail (909) 607-3890      Fax (909) 621-8967