Csound Csound-dev Csound-tekno Search About

Negative p3 polyphonic legato example

Date1999-08-14 14:10
Fromrasmus ekman
SubjectNegative p3 polyphonic legato example
I've wondered about this topic for quite a while, but never
managed to figure it out properly. It is documented, sort of, 
but the bits are scattered over entries on i-statements, tival 
tigoto and other entries on the score language.
The example by Kirsch nudged me into trying again. 
However, his comment

> The instrument definition has to take this into account,

may need a little clarification to some users (me at least until
doing some proper testing). 
So below is a fuller example of polyphonic legato. This is so much
better than feeding instr parameters through endless linsegs, though 
it does require some care about which opcodes are inited or not
- and note that many opcodes like filters and delays are prepared 
for optional initialisation - just feed them the tival flag.


;

;

sr = 44100
kr = 882
ksmps = 50
nchnls = 1

instr 10
	; Get target pitch from score event
	icps init cpspch(p4)

	; Legato (port) time dep on note length
	iportime init abs(p3)/2
	
	; Set default amps
	iamp0 init p5
	iamp1 init p5
	iamp2 init p5
	
	; Check if this note is tied, if not fade in
	itie tival
	if itie == 1 igoto nofadein
	iamp0 init 0
nofadein:

	; Check if this note is held, if not fade out 
	if p3 < 0 igoto nofadeout
	iamp2 init 0	
nofadeout:

;	print p2, p3, itie, iamp0, iamp2

	; Now do amp from the set values
	kamp linseg iamp0, .03, iamp1, abs(p3)-.03, iamp2
	
	; Skip everything else on tied note:
	; - table reading opcodes must not be reinited,
	;   as they maintain the table phase internally.
	; - Also port is inited to icps on untied notes only
	tigoto tieskip
	
	; Init pitch for the first note
	kcps init icps
	
	; Drift towards target pitch 
	kcps port icps, iportime, icps

	; Just a simple triangle-saw oscil
	kpw oscil .4, rnd(1), 1 rnd(.7)
	ar	vco	kamp, kcps, 3, kpw+.5, 1, 1/icps
	
; (Used in testing - set ipch to cpspch(p4+2) and view output spectrum)
;	ar oscil kamp, kcps, 1

		out ar

tieskip:    ; Skip some initialization on tied note

endin




f1 0 8192 10 1                    ; Sine

i10.1    0    -.3    8.00    15000
i10.1    +    -1     7.11    .
i10.1    .    -1     8.05    .
i10.1    .     4     8.047   .

i10.2    0    -.3    8.04    12000
i10.2    +    -1     8.03    .
i10.2    .    -1     9.00    .
i10.2    .    -3.7   8.117   .
i10.2    .     .5    8.113   .

i10.3    0    -.3    8.07    18000
i10.3    +    -1     8.05    .
i10.3    .    -1     8.08    .
i10.3    .    -2     8.077   .
i10.3    .    -.2    8.03    .    ; A quick down bend
i10.3    .    -.2    8.077   .
i10.3    .     1.7   8.077   .

e






Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa00241;
          14 Aug 99 14:08 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 11FdXh-0002Og-00
	for jpff@maths.bath.ac.uk; Sat, 14 Aug 1999 14:08:13 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (OAA12510); Sat, 14 Aug 1999 14:05:12 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Sat, 14 Aug 1999 14:04:59 +0100
Received: from eos.arc.nasa.gov [128.102.118.20] by hermes via ESMTP (OAA18240); Sat, 14 Aug 1999 14:04:57 +0100 (BST)
Received: (from jims@localhost)
          by eos.arc.nasa.gov (8.8.4/8.8.4)
	  id GAA21434; Sat, 14 Aug 1999 06:04:57 -0700
Date: Sat, 14 Aug 1999 06:04:57 -0700
From: Jim Stevenson 
Message-Id: <199908141304.GAA21434@eos.arc.nasa.gov>
To: ingalls@mills.edu, mar095k1@ud.nettuno.it
Subject: Re: CSound for the BeOs - Help needed
Cc: csound@maths.ex.ac.uk
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

I was told that BE would run linux code.

Is this true?

If you quote me, please put your comments first.
I have already listened to mine.

Thanks.



Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa00665;
          14 Aug 99 18:12 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by wallace.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 11FgK1-0007eI-00
	for jpff@maths.bath.ac.uk; Sat, 14 Aug 1999 17:06:17 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (SAA14428); Sat, 14 Aug 1999 18:01:35 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Sat, 14 Aug 1999 18:01:28 +0100
Received: from root@lix.intercom.es [194.179.21.2] by hermes via ESMTP (SAA15318); Sat, 14 Aug 1999 18:01:27 +0100 (BST)
Received: from intercom.es (iv2-14.intercom.es [195.76.206.14]) by lix.intercom.es (8.7.3/8.6.12) with ESMTP id TAA10293; Sat, 14 Aug 1999 19:08:29 +0100
Message-ID: <37B543E6.78975F7C@intercom.es>
Date: Sat, 14 Aug 1999 12:24:38 +0200
From: Josep M Comajuncosas 
X-Mailer: Mozilla 4.5 [es] (Win95; I)
X-Accept-Language: es
MIME-Version: 1.0
To: Hans Mikelson 
CC: Csound 
Subject: Re: Manual Waveguide Pluck Orc/Sco (again)
References: <000b01bee53d$743be280$249a170c@default>
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 SAA15318
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Hi this is and old code which implements manually a KarplusStrong pluck w=
ith a
"passive nonlinear filter" in series with a tanh compression to avoid ove=
rflow.
If can generate nice inharmonicities even with a sine input.

sr =3D 44100
kr =3D 44100
ksmps =3D 1
zakinit 2,2

instr 1
idur =3D 1/150
timout 0,idur,noise
turnoff
noise:
kamp linen 1,idur/5,idur,idur/5
;anoise rand kamp
anoise oscili kamp,150,1; see how a PNF corrupts
; an innocent sine wave ;-)

zaw anoise,0
endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
instr 2; Passive nonlinear filter + soft compression
;after J.Pierce & Scott V. Duyne / US Patent 5,703,313
;coded by Josep M Comajuncosas /Nov=B498
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
iatt1   =3D .998;  attenuation
ifco1   =3D -.058; freq dependent decay

aback init 0
afdbk init 0

anoise zar 0
ainput1 =3D anoise + aback
aout1 delay ainput1,1/150
alpf filter2 aout1*iatt1, 1, 1, 1+ifco1, ifco1

;Passive nonlinear filter : a variable allpass filter
;requires sr =3D kr to run the conditional

;compute some parameters
au =3D alpf - afdbk
;au =3D adcrem - afdbk;??????sona millor!!!
ku downsamp au
if ku < 0 goto or
kstiff =3D p4
goto next
or:
kstiff =3D p5
next:
afdbk delay1 kstiff*au
;the filter itself
alpf2 biquad alpf,kstiff,1,0,1,kstiff,0

ainput2 =3D alpf2
aback delay tanh(ainput2),1/150

out aout1*10000
zacl 0,2
endin

f1 0 8193 10 1

i1 0 1
i2 0 5.5 -.3 -.2
s
i1 0 1
i2 0 5.5 -.75 .32
s
i1 0 1
i2 0 5.5 -.85 -.55
s
i1 0 1
i2 0 5.5 -.75 -.62
s
i1 0 1
i2 0 5.5 -.9 -.65
s
i1 0 1
i2 0 5.5 -.95 -.45
s
e
--
Josep M Comajuncosas
C/ Circumval.lacio 75  08790 Gelida - Penedes
Catalunya - SPAIN tel. 93 7792243
e-mail:          gelida@intercom.es
ET Informatica de Sistemes
e-mail: jcomajuncosas@campus.uoc.es
  http://members.tripod.com/csound/





Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa00771;
          14 Aug 99 19:55 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 11Fiy0-0002R3-00
	for jpff@maths.bath.ac.uk; Sat, 14 Aug 1999 19:55:44 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (TAA05997); Sat, 14 Aug 1999 19:52:45 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Sat, 14 Aug 1999 19:52:35 +0100
Received: from bologna.nettuno.it [193.43.2.1] by hermes via ESMTP (TAA05271); Sat, 14 Aug 1999 19:52:34 +0100 (BST)
Received: from mar095k1 (ppp24-nas0.marano.nettuno.it [193.207.118.218])
	by bologna.nettuno.it (8.9.3/8.9.3/NETTuno 3.3) with SMTP id UAA03861;
	Sat, 14 Aug 1999 20:52:29 +0200 (MDT)
Message-ID: <000c01bee685$c7731740$da76cfc1@mar095k1>
From: Alessandro Fogar 
To: Jim Stevenson 
Cc: Csound List 
Subject: R: CSound for the BeOs - Help needed
Date: Sat, 14 Aug 1999 20:49:44 +0200
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.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

No, it's not true.

Sure you can port Linux projects to Beos but some work is needed...

Bye

Alessandro Fogar


>I was told that BE would run linux code.
>
>Is this true?




Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa01872;
          15 Aug 99 11:14 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by wallace.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 11FwGe-0007v0-00
	for jpff@maths.bath.ac.uk; Sun, 15 Aug 1999 10:07:52 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (LAA03125); Sun, 15 Aug 1999 11:11:03 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Sun, 15 Aug 1999 11:10:53 +0100
Received: from f188.hotmail.com [207.82.251.77] by hermes via SMTP (LAA12423); Sun, 15 Aug 1999 11:10:51 +0100 (BST)
Received: (qmail 91274 invoked by uid 0); 15 Aug 1999 10:10:20 -0000
Message-ID: <19990815101020.91273.qmail@hotmail.com>
Received: from 195.144.64.133 by www.hotmail.com with HTTP;
	Sun, 15 Aug 1999 03:10:19 PDT
X-Originating-IP: [195.144.64.133]
From: david ds 
To: csound@maths.ex.ac.uk
Subject: Spectral Morphing Drones & Human Respons???
Date: Sun, 15 Aug 1999 03:10:19 PDT
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Hi, I was a long time absent in the Csound list, more of a
silent reader....Now is time to throw in a dynamically filtered questio ;-)

I am looking for Csounders who are fascinated by the modelling & shaping of 
drones. I spend most of my time modelling spectral interesting drones to 
trigger special moods.
what I did was starting with a 20 second loop of full, flat white
noise and applying filters, delays and convolutions on it. Everytime
I ended up with a drone tightly "molten" into a specific spectral profile 
and each variant drone triggered a variant mood or "meta emotion" according 
to the drone's spectral content. It is amazing how accurate the human mind 
responds to subtle variations of a spectral configuration. I quickly became 
fascinated by this phenomena and I tend to expand my amateur research to the 
field of the visual. This way i want to end up with a very clear "sound and 
vision" responsive triggering of the human gestalt.


Is anyone also infected by this or a closely related phenomena ?
If you answer, please keep in mind that i am NOT a pro, i did NOT study the 
science of DSP or psychology or anything like that...I only gained knowledge 
of this by 100% experimentation.


David.


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com