Csound Csound-dev Csound-tekno Search About

Guitar/strings realistic synthesis

Date1996-01-29 02:58
FromFabio Bizzetti
SubjectGuitar/strings realistic synthesis
Hi all,
I would like to know if anybody has anything (informations, documents,
sourcecode, theory) on the subject of acoustic and electric guitar
synthesis. Realism is extremely important, while the simulation can
take as much CPU time as it wish (i.e. it doesn't have to be realtime).
So far I made a lot of work.. yet I don't understand some things:

1) Why the overtones are slightly detuned from the integer multiple of
   the fundamental that they're supposed to be. And how to calculate
   the right detuning to apply to simulate it correctly.

2) Why there're two waves (one vertical and one horizontal.. both
   transversal) and how to simulate the second, and its amplitude
   and detuning at each harmonic.

3) What is the third wave.. the longitudinal one. What is its nature,
   how much is its amplitude and all the other relevant characteristics.

4) Does the decay depend on air damping (i.e. decay time is directly
   proportional to the harmonic number), and to the bridge and nut
   coupling? How does this last change the decay? How much? What can
   I do with the impulse response at the bridge and at the nut?

5) How does the fret number (i.e. string length) affect decay?


I'm willing to share all my experiences, ideas and knowledge to whoever
gives valuable help.


Kindest Regards,

---
Fabio Bizzetti - fabzt@tin.it




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa03753;
          31 Jul 98 18:00 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa24237;
          31 Jul 98 18:00 BST
Received: (qmail 16637 invoked from network); 31 Jul 1998 17:00:40 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 31 Jul 1998 17:00:40 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (RAA24864); Fri, 31 Jul 1998 17:56:12 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Fri, 31 Jul 1998 17:55:53 +0100
Received: from root@lix.intercom.es [194.179.21.2] by hermes via ESMTP (RAA20930); Fri, 31 Jul 1998 17:55:50 +0100 (BST)
Received: from intercom.es (iv2-248.intercom.es [195.76.206.248]) by lix.intercom.es (8.7.3/8.6.12) with ESMTP id SAA01276 for ; Fri, 31 Jul 1998 18:59:35 +0100
Message-ID: <35C1F5D3.5F658494@intercom.es>
Date: Fri, 31 Jul 1998 18:50:27 +0200
From: Josep M Comajuncosas 
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: csound@maths.ex.ac.uk
Subject: K-S orc (2/2)
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by exeter.ac.uk id RAA20930
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

;ks2.orc

sr =3D 44100
kr =3D 44100
ksmps =3D 1

instr 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Low level implementation
; of the classic Karplus-Strong algorithm
; fixed pitches : no vibratos or glissandi !
; implemented by Josep M Comajuncosas / Aug=B498
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This instrument is highly inharmonic
; due to the 9 allpass stages in the feedback loop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ipluck =3D p5; pluck position ( 0 to 1 )
ifreq =3D cpspch(p4)
idlts =3D int(kr/ifreq-.5)-4; set waveguide length (an integer number of
samples)
; substract 4 - the delay induced by the 8 cascaded allpass
idlt =3D idlts/kr; convert so seconds
kdlt init idlts; counter for string initialisation

irems =3D kr/ifreq - idlts +.5;remaining time in fractions of a sample
; set phase delay induced by the FIR lowpass filter
; and the fractional delay in the waveguide

iph =3D (1-irems)/(1+irems); allpass filter parameter
; approximation valid at low frequencies relative to sr

awgout init 0

if kdlt < 0 goto continue

initialise:

anoise atrirand 30000
; fill the buffer with random numbers

anoise butterlp anoise, p6, 1
; smooth a bit the noise burst
; harmonic richness grows with volume
; final volume determined by the filter gain

acomb delay anoise, ipluck/idlt
anoize =3D anoise - acomb
; implement pluck point as a FIR comb filter


continue:


areturn delayr idlt
ainput =3D anoize + areturn


alpf filter2 ainput, 2, 0, .5, .5
; lowpass filter to simulate energy losses
; could be variable to allow damping control

awgout filter2 alpf, 2, 1, iph, 1, iph
; allpass filter to fine tune the instrument

awgout filter2 awgout, 2, 1, .333, 1, .333
awgout filter2 awgout, 2, 1, .333, 1, .333
awgout filter2 awgout, 2, 1, .333, 1, .333
awgout filter2 awgout, 2, 1, .333, 1, .333
awgout filter2 awgout, 2, 1, .333, 1, .333
awgout filter2 awgout, 2, 1, .333, 1, .333
awgout filter2 awgout, 2, 1, .333, 1, .333
awgout filter2 awgout, 2, 1, .333, 1, .333
; bank of 8 allpass filters for extra inharmonicity
; each stage delays ~.5 samples the base period
;NOTE: It should sound more inharmonic... were=B4s the bug?

delayw awgout

out awgout

kdlt =3D kdlt - 1
anoize =3D 0; supress last impulse when waveguide is loaded
;tricky but easy...

endin




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa03759;
          31 Jul 98 18:00 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa24249;
          31 Jul 98 18:00 BST
Received: (qmail 16647 invoked from network); 31 Jul 1998 17:00:45 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 31 Jul 1998 17:00:45 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (RAA13962); Fri, 31 Jul 1998 17:56:15 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Fri, 31 Jul 1998 17:56:00 +0100
Received: from root@lix.intercom.es [194.179.21.2] by hermes via ESMTP (RAA27289); Fri, 31 Jul 1998 17:55:58 +0100 (BST)
Received: from intercom.es (iv2-248.intercom.es [195.76.206.248]) by lix.intercom.es (8.7.3/8.6.12) with ESMTP id SAA01280 for ; Fri, 31 Jul 1998 18:59:39 +0100
Message-ID: <35C1F5D9.894F6B52@intercom.es>
Date: Fri, 31 Jul 1998 18:50:33 +0200
From: Josep M Comajuncosas 
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: csound@maths.ex.ac.uk
Subject: K-S score
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by exeter.ac.uk id RAA27289
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

;ks.sco
f1 0 32769 10 1; sine wave

; an awful tune... enjoy it!
;      pch
;          pluck
;              fco & amp
;                   Josep M Comajuncosas / Aug=B498

t 0 180

i1 0 1 7.00 .1  1000
i1 + . .    <   <
i1 . . 7.02 <   <
i1 . . 7.04 <   <
i1 . . 7.00 .4  3000
i1 . . 7.04 <   <
i1 . . 7.02 .2  1000

i1 . . 6.07 .8  6000
i1 . . 7.00 .1  1500
i1 . . .    <   <
i1 . . 7.02 <   <
i1 . . 7.04 <   <
i1 . 2 7.00 .4  4000
i1 . 1 6.11 .3  3000

i1 . . 6.07 .8  6000
i1 . . 7.00 .1  2000
i1 . . .    <   <
i1 . . 7.02 <   <
i1 . . 7.04 <   <
i1 . . 7.05 .9  8000
i1 . . 7.04 .6  <
i1 . . 7.02 .4  <
i1 . . 7.00 .2  <
i1 . . 6.11 .1  7000

i1 . . 6.07 .8  17000
i1 . . 6.09 .9  17000
i1 . . 6.11 .9  17000
i1 . 2 7.00 .5  17000
i1 . 6 7.00 .9  19000
e



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa03765;
          31 Jul 98 18:01 BST
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa24331;
          31 Jul 98 18:00 BST
Received: (qmail 15594 invoked from network); 31 Jul 1998 17:00:55 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 31 Jul 1998 17:00:55 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (RAA24241); Fri, 31 Jul 1998 17:56:00 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Fri, 31 Jul 1998 17:55:47 +0100
Received: from root@lix.intercom.es [194.179.21.2] by hermes via ESMTP (RAA11402); Fri, 31 Jul 1998 17:55:45 +0100 (BST)
Received: from intercom.es (iv2-248.intercom.es [195.76.206.248]) by lix.intercom.es (8.7.3/8.6.12) with ESMTP id SAA01259 for ; Fri, 31 Jul 1998 18:59:28 +0100
Message-ID: <35C1F5C9.EF38F780@intercom.es>
Date: Fri, 31 Jul 1998 18:50:17 +0200
From: Josep M Comajuncosas 
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: csound@maths.ex.ac.uk
Subject: K-S orchestras
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by exeter.ac.uk id RAA11402
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Hi all,
after some months without Csounding, I=B4m having some free time to desig=
n
some stuff. Just to put in practice some articles about phase delay,
here you have 2 orchestras implementing the Karplus-Strong algorithm.
Any suggestion would be greatly appreciated.
I hope to post a number ao different instruments.
Tnx in advance

Josep M Comajuncosas




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa03771;
          31 Jul 98 18:01 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa24526;
          31 Jul 98 18:01 BST
Received: (qmail 16714 invoked from network); 31 Jul 1998 17:01:46 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 31 Jul 1998 17:01:46 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (RAA01277); Fri, 31 Jul 1998 17:56:09 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Fri, 31 Jul 1998 17:55:51 +0100
Received: from root@lix.intercom.es [194.179.21.2] by hermes via ESMTP (RAA18895); Fri, 31 Jul 1998 17:55:47 +0100 (BST)
Received: from intercom.es (iv2-248.intercom.es [195.76.206.248]) by lix.intercom.es (8.7.3/8.6.12) with ESMTP id SAA01263 for ; Fri, 31 Jul 1998 18:59:32 +0100
Message-ID: <35C1F5CF.B0C75A4B@intercom.es>
Date: Fri, 31 Jul 1998 18:50:23 +0200
From: Josep M Comajuncosas 
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: csound@maths.ex.ac.uk
Subject: K-S orc (1/2)
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by exeter.ac.uk id RAA18895
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

sr =3D 44100
kr =3D 44100
ksmps =3D 1

instr 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Low level implementation
; of the classic Karplus-Strong algorithm
; fixed pitches : no vibratos or glissandi !
; implemented by Josep M Comajuncosas / Aug=B498
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ipluck =3D p5; pluck position ( 0 to 1 )
ifreq =3D cpspch(p4)
idlts =3D int(kr/ifreq-.5); set waveguide length (an integer number of
samples)
idlt =3D idlts/kr; convert so seconds
kdlt init idlts; counter for string initialisation

irems =3D kr/ifreq - idlts +.5;remaining time in fractions of a sample
; set phase delay induced by the FIR lowpass filter
; and the fractional delay in the waveguide

iph =3D (1-irems)/(1+irems); allpass filter parameter
; approximation valid at low frequencies relative to sr

awgout init 0

;timout 0, idlt, initialise
;timout caused problems with delay initialisation
;so I used kdlt as a counter...

if kdlt < 0 goto continue

initialise:

anoise atrirand 32000
; fill the buffer with random numbers

anoise butterlp anoise, p6, 1
; smooth a bit the noise burst
; harmonic richness grows with volume
; final volume determined by the filter gain

acomb delay anoise, ipluck/idlt
anoize =3D anoise - acomb
; implement pluck point as a FIR comb filter


continue:


areturn delayr idlt
ainput =3D anoize + areturn


alpf filter2 ainput, 2, 0, .5, .5
; lowpass filter to simulate energy losses
; could be variable to allow damping control

awgout filter2 alpf, 2, 1, iph, 1, iph
; allpass filter to fine tune the instrument

delayw awgout

out awgout

kdlt =3D kdlt - 1
anoize =3D 0; supress last impulse when waveguide is loaded
;tricky but easy...

endin




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa05005;
          1 Aug 98 5:34 BST
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa06980;
          1 Aug 98 5:34 BST
Received: (qmail 3050 invoked from network); 1 Aug 1998 04:34:44 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 1 Aug 1998 04:34:44 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (FAA26070); Sat, 1 Aug 1998 05:31:45 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Sat, 1 Aug 1998 05:31:35 +0100
Received: from howl.werewolf.net [206.103.224.20] by hermes via ESMTP (FAA07540); Sat, 1 Aug 1998 05:31:34 +0100 (BST)
Received: from default (dial167.werewolf.net [206.103.225.177])
	by howl.werewolf.net (8.9.0/8.9.0) with SMTP id XAA22023
	for ; Fri, 31 Jul 1998 23:30:38 -0500 (CDT)
From: Hans Mikelson 
To: Csound 
Subject: MP3 Song Created with Csound
Date: Fri, 31 Jul 1998 23:32:23 -0500
Message-ID: <01bdbd05$60bc9620$0104dccc@default>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Hi there,

I thought I would try writing a techno song.  I am making it available for a
limited time at the following site (~3.3 Meg):

http://reality.sgi.com/hpm_cfdevsun/tekwrld.mp3

Essentially all of the sounds were originally created with Csound except for
a sample of my voice which was used for the vocoder part.  Many of the
sounds were then modified with Cool Edit.  Once I had accumulated a large
number of samples I put them together with a multi-track digital audio
program.  The following short story or idea goes with this song.


Teknology World
by Hans Mikelson

Of the marvels of the multi-verse Teknology World is one of the most
impressive.  It is the only known Dyson sphere.  It was constructed long ago
by a lost race.  A Dyson sphere is a sphere which has been constructed
around a star.  The energy needs of the creators eventually grew so great
that they developed a method for direct conversion of matter to energy.  The
"lyric" is taken from a tour of the energy center of the sphere.

"Below us is the energy center for much of the world.  These reactors
perform the direct conversion of matter to energy."

The world's automation is still at least partially functional although the
creators have apparently moved on.



Please let me know if you like it.  Also since I do not have a detailed
knowlege of techno sub-genres perhaps someone could tell me what techno
sub-genre my song is.

Bye,
Hans Mikelson