Csound Csound-dev Csound-tekno Search About

cps2pch Opcode Unequal Temperament Fix

Date1997-12-11 13:50
FromHans Mikelson
Subjectcps2pch Opcode Unequal Temperament Fix
Hello,

I asked a question about the new (3.46) cps2pch opcode a while back and
have since figured out what needs to be done to access an unequal
temperament table.  It seems to have a rounding error if you enter your
pitch as a fraction ie: 7.00, 7.05, etc.  It apparently just uses
int(frac(ipitch)*100) to access the table but do to floating point
inaccuracy you end up with 7.049999 about half of the time which ends up as
7.04 not 7.05.  The formula should be int(frac(ipitch)*100+.5) so it rounds
up.  Anyway you can make it work by adding .005 to everything.

Basically:

f4 0 17 -2 1.000 1.067 1.121 1.196 1.273 1.344 1.422 1.496 1.600 1.703
1.798 1.903 2.000 ; Werkmeister III

;   Sta  Dur  Amp   Pitch  Wave  Env  Temperament
i2  0    .2   8000  7.00   1     3    4

itemp    =       p8
ifqc1    cps2pch p5+.005, -itemper

It also does not wrap around at 12 so if you want it to wrap around it gets
a bit more complex.  I'll post the un-equal temperament strummer on my web
site soon.

Bye,
Hans Mikelson


Date1997-12-12 17:53
FromHans Mikelson
SubjectRe: cps2pch Opcode Unequal Temperament Fix
Hello,

At 01:14 PM 12/19/97 GMT, jpff@maths.bath.ac.uk wrote:
>The rounding error in cps2pch has been fixed; from the ChangeLog

I must have the old version.

It makes it a bit of a chore to code a wrap around at least the way I did
it.  Perhaps there is an easier way?

Regards,
Hans Mikelson




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa06995;
          23 Dec 97 9:45 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa14187;
          23 Dec 97 9:45 GMT
Received: (qmail 14720 invoked from network); 23 Dec 1997 09:45:54 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 23 Dec 1997 09:45:54 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (JAA03172); Tue, 23 Dec 1997 09:37:25 GMT
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Tue, 23 Dec 97 09:36:20 GMT
Received: from sun2.nsfnet-relay.ac.uk [128.86.8.45] by hermes via SMTP (QAA05910); Mon, 22 Dec 1997 16:49:54 GMT
Received: from wallace.maths.bath.ac.uk by sun2.nsfnet-relay.ac.uk with JANET SMTP (PP); Mon, 22 Dec 1997 14:06:53 +0000
Received: from omphalos.maths.bath.ac.uk (maths.Bath.AC.UK) [138.38.99.25] (mmdf)
	by wallace.maths.bath.ac.uk with smtp (Exim 1.80 #1)
	id 0xk69b-0007l3-00; Mon, 22 Dec 1997 11:36:11 +0000
Date:     Mon, 22 Dec 97 11:37:23 GMT
From: jpff@maths.bath.ac.uk
Subject:  Re: Win95 (3.47 beta) midi and devaudio (fwd)
To: csound@maths.ex.ac.uk
Message-Id: 
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Message written at 19 Dec 1997 21:15:48 +0000
--- Copy of mail to g.maldonado@agora.stm.it ---
In-reply-to: <349A402F.3560E8C3@agora.stm.it> (message from Gabriel Maldonado
	on Fri, 19 Dec 1997 10:36:48 +0100)
References:   <349A402F.3560E8C3@agora.stm.it>

The loop has just been reported to me -- that is why I sent this out
as a Beta.  I only have 0 or 1 sound device on my PCs so I was unable
to test this.

The code now accepts devaudio# for # an integer (and actually some
other rubbish -- I am too lazy to check everything today) and in teh
integer is available uses it, or defaults to zero.

The MIDI device is controlled by the environment parameter MIDIOUTDEV
in my code; on Linux I think it is different.

==John ff



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa07054;
          23 Dec 97 10:29 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa15563;
          23 Dec 97 10:29 GMT
Received: (qmail 16768 invoked from network); 23 Dec 1997 10:29:17 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 23 Dec 1997 10:29:17 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (KAA08267); Tue, 23 Dec 1997 10:23:04 GMT
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Tue, 23 Dec 97 09:49:54 GMT
Received: from sun2.nsfnet-relay.ac.uk [128.86.8.45] by hermes via SMTP (QAA02822); Mon, 22 Dec 1997 16:26:52 GMT
Received: from fire.pagan.net by sun2.nsfnet-relay.ac.uk with Internet SMTP (PP); Mon, 22 Dec 1997 13:20:04 +0000
Received: from dimensional.com (p43.pm3c03.pm.dimcom.net [206.124.5.172])
	by fire.pagan.net (8.8.7/8.8.nospam) with ESMTP id GAA02826
	for ; Mon, 22 Dec 1997 06:19:22 -0700 (MST)
Message-Id: <349E6932.CBBD7E0F@dimensional.com>
Date: Mon, 22 Dec 1997 06:20:51 -0700
From: Stuart 
X-Mailer: Mozilla 4.04 [en] (Win95; I)
Mime-Version: 1.0
To: csound@maths.ex.ac.uk
Subject: Cecilia for Win95, anyone?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

I thought I'd seen a post about this port being done and somewhere in
testing.   Anyone know if it's available?

Thanks
Stuart
stuartf@dimensional.com




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa07064;
          23 Dec 97 10:38 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa15787;
          23 Dec 97 10:38 GMT
Received: (qmail 17221 invoked from network); 23 Dec 1997 10:38:44 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 23 Dec 1997 10:38:44 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (KAA10077); Tue, 23 Dec 1997 10:32:27 GMT
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Tue, 23 Dec 97 10:05:29 GMT
Received: from root@lix.intercom.es [194.179.21.2] by hermes via ESMTP (WAA11640); Sun, 21 Dec 1997 22:03:56 GMT
Received: from jcn100110011001 (iv1-73.intercom.es [195.76.154.73]) by lix.intercom.es (8.7.3/8.6.12) with ESMTP id XAA10432 for ; Sun, 21 Dec 1997 23:12:47 +0100
Message-Id: <349D9367.1929E878@lix.intercom.es>
Date: Sun, 21 Dec 1997 23:08:39 +0100
From: Josep M* Comajuncosas 
X-Mailer: Mozilla 4.01 [en] (WinNT; I)
Mime-Version: 1.0
To: csound@maths.ex.ac.uk
Subject: reinitialising ifn in table opcode (?)
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Is it possible to change the table number in a table-tablei opcode via a
reinit pass? Till now all my efforts have not worked at all... I usually
get a message like "invalid f table number 0..." or "table no
initialized"...
I know of some other opcodes for this, like tablekt or tableikt, but
they seem not to have been implemented yet anywere but in the help files
;-), am I wrong?
Tnx in advance!

Josep M Comajuncosas


Date1997-12-19 13:14
Fromjpff@maths.bath.ac.uk
SubjectRe: cps2pch Opcode Unequal Temperament Fix
The rounding error in cps2pch has been fixed; from the ChangeLog

1997-10-15  John Fitch  

	* aops.c (cps2pch): Corrected a rounding error in table case.
	(cpsxpch): Ditto

>> It also does not wrap around at 12; 

Indeed, nor should it.  What has 12 to do with tuning(!?)

==John ff



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa09857;
          19 Dec 97 18:38 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa26769;
          19 Dec 97 18:38 GMT
Received: (qmail 24286 invoked from network); 19 Dec 1997 18:38:15 -0000
Received: from agora.stm.it (195.62.32.1)
  by pat.bath.ac.uk with SMTP; 19 Dec 1997 18:38:15 -0000
Received: from default (ppp03-08.stm.it [195.62.37.136]) by agora.stm.it (8.8.8/8.8.5) with ESMTP id TAA12155; Fri, 19 Dec 1997 19:37:52 +0100 (ITA)
Message-ID: <349A402F.3560E8C3@agora.stm.it>
Date: Fri, 19 Dec 1997 10:36:48 +0100
From: Gabriel Maldonado 
X-Mailer: Mozilla 4.0 [en] (Win95; I)
MIME-Version: 1.0
To: jpff@maths.bath.ac.uk
CC: Csound Mailing List 
Subject: Re: Win95 (3.47 beta) midi and devaudio (fwd)
X-Priority: 3 (Normal)
References:  
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

jpff@maths.bath.ac.uk wrote:

> The message
> Select device number
> is expecting you to type a number.  It may be that there is noone
> listening to the terminal at that time I suppose.
>

In winsound 3.47 beta there is a loop that types the "Select device
number" message infinetely and the terminal is insensible to keyboard.
So it is not possible to select the WAVE device number and, at last, to
use it in realtime.

What about the activation and selection of MIDI device number?



> I dislike adding new options, so at present I am not sure what one
> shoudl do.  i used to use device zero always, but someone objected.

You adfirm to  use always the device zero, but the "Select device
number" message appears when using -odevaudio. Why?

> I could add an Environment variable or something in the .ini file
> reasonably easily.  What do you suggest?  I suppose I could even throw
>
> up a dialog box at that time -- yeak.

OK!

--
Gabriel Maldonado

mailto:g.maldonado@agora.stm.it
http://www.agora.stm.it/G.Maldonado/home2.htm
http://www.geocities.com/SiliconValley/Way/7041/home2.htm






Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa09892;
          19 Dec 97 18:42 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa26979;
          19 Dec 97 18:42 GMT
Received: (qmail 24487 invoked from network); 19 Dec 1997 18:42:45 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 19 Dec 1997 18:42:45 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (SAA00797); Fri, 19 Dec 1997 18:35:30 GMT
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Fri, 19 Dec 97 18:35:14 GMT
Received: from agora.stm.it [195.62.32.1] by hermes via ESMTP (SAA18638); Fri, 19 Dec 1997 18:35:06 GMT
Received: from default (ppp03-08.stm.it [195.62.37.136]) by agora.stm.it (8.8.8/8.8.5) with ESMTP id TAA12155; Fri, 19 Dec 1997 19:37:52 +0100 (ITA)
Message-Id: <349A402F.3560E8C3@agora.stm.it>
Date: Fri, 19 Dec 1997 10:36:48 +0100
From: Gabriel Maldonado 
X-Mailer: Mozilla 4.0 [en] (Win95; I)
Mime-Version: 1.0
To: jpff@maths.bath.ac.uk
Cc: Csound Mailing List 
Subject: Re: Win95 (3.47 beta) midi and devaudio (fwd)
X-Priority: 3 (Normal)
References:  
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

jpff@maths.bath.ac.uk wrote:

> The message
> Select device number
> is expecting you to type a number.  It may be that there is noone
> listening to the terminal at that time I suppose.
>

In winsound 3.47 beta there is a loop that types the "Select device
number" message infinetely and the terminal is insensible to keyboard.
So it is not possible to select the WAVE device number and, at last, to
use it in realtime.

What about the activation and selection of MIDI device number?



> I dislike adding new options, so at present I am not sure what one
> shoudl do.  i used to use device zero always, but someone objected.

You adfirm to  use always the device zero, but the "Select device
number" message appears when using -odevaudio. Why?

> I could add an Environment variable or something in the .ini file
> reasonably easily.  What do you suggest?  I suppose I could even throw
>
> up a dialog box at that time -- yeak.

OK!

--
Gabriel Maldonado

mailto:g.maldonado@agora.stm.it
http://www.agora.stm.it/G.Maldonado/home2.htm
http://www.geocities.com/SiliconValley/Way/7041/home2.htm







Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa10305;
          19 Dec 97 22:19 GMT
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa09750;
          19 Dec 97 22:19 GMT
Received: (qmail 13553 invoked from network); 19 Dec 1997 16:52:34 -0000
Received: from ella.mills.edu (144.91.3.20)
  by mercury.bath.ac.uk with SMTP; 19 Dec 1997 16:52:34 -0000
Received: (qmail 5409 invoked by uid 2928); 19 Dec 1997 08:51:04 -0800
Date: Fri, 19 Dec 1997 08:51:04 -0800 (PST)
From: Mike Berry 
To: jpff@maths.bath.ac.uk
cc: csound@maths.ex.ac.uk
Subject: Re: table graphics
In-Reply-To: 
Message-ID: 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

	The Mills version stores a graphic representation of all of the f
tables.  They are accessable in a single window using a scroll bar to go
up or down in the list.  The main feature is that they are all available
throughout the run, in any order.  As new tables are generated, they are
added to the list.

Mike Berry
mikeb@mills.edu