Csound Csound-dev Csound-tekno Search About

cpspch() problem

Date2007-10-26 03:09
From"Toby Chappell"
Subjectcpspch() problem
AttachmentsNone  

Date2007-10-26 03:39
FromAndres Cabrera
SubjectRe: cpspch() problem
Hi,

It seems, from aquick scan, that the problem might be in ibw, which
takes p4*ibf for both instruments.

Cheers,
Andrés

El jue, 25-10-2007 a las 22:09 -0400, Toby Chappell escribió:
> I'm adapting sounds I like in the Csound Catalog CD as part of
> learning the language (and learning how to create interesting sounds).
> 
> I'm having trouble understanding why a modification I made to the
> Anthologies->Lyon->Glnoi instrument does not result in the same sound
> as the original. Specifically, the original instrument seems to pass
> the note to play in Hertz, and I modified the instrument to accept the
> octave/pitch notation and convert to Hertz with cpspch().  I don't
> understand why the otherwise identical instruments are creating
> obviously different sounds (I don't mean just the notes, but the
> amplitude and other characteristics of the sound as well).
> 
> Here is the orchestra; instr 2 is the original, and instr 3 is my
> modified version.
> 
> sr        =         44100
> kr        =         4410
> ksmps     =         10
> nchnls    =         1
> 
> 
>           instr 2
> ires1     =         p4
> ibf       = .05
> iamp      = p5*32767 * 2.5
> iseed     = p6
> ibw       = p4*ibf
> kenv      linseg    0,p3/2,iamp,p3/2,0
> anoise    randi     1.0, 13000, iseed
> ares1     reson     anoise,ires1,ibw,1
> ares2     reson     ares1,ires1,ibw,1
>           out       ares2*kenv
>           endin
> 
>           instr 3
> ires1     =         cpspch(p4)
> ibf       = .05
> iamp      = p5*32767 * 2.5
> iseed     = p6
> ibw       = p4*ibf
> kenv      linseg    0,p3/2,iamp,p3/2,0
> anoise    randi     1.0, 13000, iseed
> ares1     reson     anoise,ires1,ibw,1
> ares2     reson     ares1,ires1,ibw,1
>           out       ares2*kenv
>           endin
> 
> Here is the score, playing what I thought should be equivalent notes:
> 
> i2 0.0 1.7770 660.0000 0.4123 0.7022
> i2 2.0 1.7770 440.0000 0.4123 0.7022
> i2 4.0 1.7770 880.0000 0.4123 0.7022
> 
> i3 6.0 1.7770 8.09 0.4123 0.7022
> i3 8.0 1.7770 9.04 0.4123 0.7022
> i3 10.0 1.7770 9.09 0.4123 0.7022
> 
> 
> What am I missing about why the second three notes don't sound like
> the first three?
> 
> 
> Thanks....
> Toby
> www.ObverseMusic.com

Date2007-10-26 04:00
From"Toby Chappell"
SubjectRe: cpspch() problem
AttachmentsNone  

Date2007-10-26 05:28
FromAnthony Kozar
SubjectRe: cpspch() problem
I will note one other small difference besides the fact that you probably
meant 9.04, 8.09, 9.09 as the pitches in the second group of notes below.
9.04 in pch will not be exactly 660.0 Hz because equal-tempered fifths do
not have exactly a 3:2 frequency ratio.  It should be slightly less than
660.0, but you may not hear this discrepancy unless you play them together.
 
Anthony Kozar
anthonykozar AT sbcglobal DOT net
http://anthonykozar.net/

>>> i2 0.0 1.7770 660.0000 0.4123 0.7022
>>> i2 2.0 1.7770 440.0000 0.4123 0.7022
>>> i2 4.0 1.7770 880.0000 0.4123 0.7022
>>> 
>>> i3 6.0 1.7770 8.09 0.4123 0.7022
>>> i3 8.0 1.7770 9.04 0.4123 0.7022
>>> i3 10.0 1.7770 9.09 0.4123 0.7022