Csound Csound-dev Csound-tekno Search About

Re: A bug ?

Date1997-08-24 19:27
From"Matt J. Ingalls"
SubjectRe: A bug ?
> Consider the following simple Csound program. If I use sr=kr=44100, then the
> results are just fine (a karplus-strong algorithm). However, if I use 
> sr=44100 and kr=441, then the results are strange and not musical...
> 
> Please note that none of the ORC lines are supposed to depand on the kr 
> setting. (?)
> (I want to decrease kr to accelerate real-time performance)

	even though you may not use any 'k' variables in a csound orc, the
'kr' is still used.  What happens is that csound uses the kr as its main
cycle - calculating an output buffer of 'ksmps' # of samples for each 'a'
opcode.  Since you are using everything at an 'a' rate, then i would guess
thats what's throwing things off (havent looked at your instrument long
enough to think about it)

	BUT: since you aren't doing anything at a 'k' rate, changing 'kr'
will not speed up your real-time performance anyway -> so just keep sr=kr
or write your own opcode in C...

-matt


Date1997-08-24 23:17
FromErez Webman
SubjectA bug ?
Consider the following simple Csound program. If I use sr=kr=44100, then the
results are just fine (a karplus-strong algorithm). However, if I use 
sr=44100 and kr=441, then the results are strange and not musical...

Please note that none of the ORC lines are supposed to depand on the kr 
setting. (?)


sr        = 44100
kr        = 44100
ksmps     = 1
nchnls    = 1

          
instr 1

;--- Init -------------------------------------------------------
ipostamp  =         20000
ifb       =         0.999

ain       linseg    0,0.001,1,0.002,-1,0.001,0,600,0

adel      init      0
asigprev  init      0
;---------------------------------------------------------------

;--- Init: MIDI NoteOn parameters  -----------------------------
ipitch    =         400
idelay    =         1/ipitch
;---------------------------------------------------------------

;--- Main KS processing  ---------------------------------------
asig      =         ain + adel
amod      =         ifb*(0.5*asig + 0.5*asigprev)  ; Simple LPF
adel      delay     amod, idelay
asigprev  =         asig
;---------------------------------------------------------------

          out       amod*ipostamp
          
endin
;===============================================================


(I want to decrease kr to accelerate real-time performance)

Thanks,

Erez Webman



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa10696;
          24 Aug 97 15:26 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa06101;
          24 Aug 97 15:26 BST
Received: (qmail 15808 invoked from network); 24 Aug 1997 14:26:11 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 24 Aug 1997 14:26:11 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (PAA01700); Sun, 24 Aug 1997 15:17:42 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Sun, 24 Aug 97 15:17:26 +0100
Received: from root@gateway.senet.com.au [203.11.90.1] by hermes via ESMTP (PAA01664); Sun, 24 Aug 1997 15:17:22 +0100
Received: from c2-p54.senet.com.au (c2-p54.senet.com.au [203.56.237.119])
	by gateway.senet.com.au (8.8.5/8.8.5) with SMTP id XAA05789
	for ; Sun, 24 Aug 1997 23:48:16 +0930
Date: 24 Aug 97 23:48:07 +0930
Subject: Code Warrior
From: Nathan Day 
Cc: csound@maths.ex.ac.uk
X-Mailer: Cyberdog/2.0
Mime-Version: 1.0
Message-Id: 
X-Fontfamily: Palatino
X-Fontsize: 12
Content-Type: text/enriched; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Has anbody on this list made the transition from Symantec C++
for Power Mac to Code Warrior, due to
Symantec's lack of any annoucements of supporting Mac OS 8 and even
more importantly Raspody and with Apple and Metrowerks working
together, I'm thinking of changing over to Code
Warrior does anbody have any opinions on this.


Nathan Day

nathand@senet.com.au



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa10707;
          24 Aug 97 15:32 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa06231;
          24 Aug 97 15:31 BST
Received: (qmail 15874 invoked from network); 24 Aug 1997 14:31:43 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 24 Aug 1997 14:31:43 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (PAA02798); Sun, 24 Aug 1997 15:18:20 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Sun, 24 Aug 97 15:18:02 +0100
Received: from root@gateway.senet.com.au [203.11.90.1] by hermes via ESMTP (PAA02492); Sun, 24 Aug 1997 15:17:59 +0100
Received: from c2-p54.senet.com.au (c2-p54.senet.com.au [203.56.237.119])
	by gateway.senet.com.au (8.8.5/8.8.5) with SMTP id XAA05830
	for ; Sun, 24 Aug 1997 23:48:53 +0930
Date: 24 Aug 97 23:41:16 +0930
Subject: Re: Hetro/adsyn (Was:Re: Transposition (was: Re: Emacs mode for 
        orchestra))
From: Nathan Day 
Cc: csound@maths.ex.ac.uk
X-Mailer: Cyberdog/2.0
Mime-Version: 1.0
Message-Id: 
X-Fontfamily: Geneva
X-Fontsize: 10
Content-Type: text/enriched; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Csound orc:

;****************

sr=3D44100

kr=3D8820

ksmps=3D5

nchnls=3D1


instr 1

   a1 adsyn  1, 1, 1, "Agenten.het"      

      out a1

endin

;****************


Csound sco:

;****************

i1 0 2.4         ; Sound file was 2.4 secs long

                 ; any other will timestrech/compress

;****************


12PalatinoThank for your help, as supplied your adsyn example works fine, but
if the score has multiple instrument lines like the one supplied, on
the last instrument line of this example and every one following if I
add more12Palatino it complains 12Palatinoin the
compiling listing,


'INIT ERROR in instr 1: memfiles:
MAXFILES exceeded

a1 adsyn  1, 1, 1, "Agenten.het"   

'INIT ERROR in instr 1: ADSYN cannot load
Agenten.het

a1 adsyn  1, 1, 1, "Agenten.het"'12Palatino


I notice that before every instrument line in the compiling listing it
says


'files Macintosh
HD:Documents:CSound:Analysis

files:Agenten.het (31584 bytes)
loaded into memory'12<=
PARAM>Palatino


Is this supposed to happen every time, surely once in memory it should
use that copy not load it into memoery over and over again.

I'm using the csound.ppc, is there possibly a bug with this, it seems
odd that nobody else has complained if it is.


;****************



Csound sco:


;****************


i1 0 2.4         ; Sound file was 2.4 secs long

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +

i1 +


;****************




Nathan Day

nathand@senet.com.au



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa11064;
          24 Aug 97 19:35 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa12757;
          24 Aug 97 19:34 BST
Received: (qmail 20050 invoked from network); 24 Aug 1997 18:34:48 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 24 Aug 1997 18:34:48 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (TAA01683); Sun, 24 Aug 1997 19:26:31 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Sun, 24 Aug 97 19:26:22 +0100
Received: from ella.mills.edu [144.91.3.20] by hermes via SMTP (TAA06740); Sun, 24 Aug 1997 19:26:21 +0100
Received: (qmail 3440 invoked by uid 1964); 24 Aug 1997 18:27:01 -0000
Date: Sun, 24 Aug 1997 11:27:01 -0700 (PDT)
From: "Matt J. Ingalls" 
To: Erez Webman 
Cc: Csound list 
Subject: Re: A bug ?
In-Reply-To: 
Message-Id: 
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk


> Consider the following simple Csound program. If I use sr=kr=44100, then the
> results are just fine (a karplus-strong algorithm). However, if I use 
> sr=44100 and kr=441, then the results are strange and not musical...
> 
> Please note that none of the ORC lines are supposed to depand on the kr 
> setting. (?)
> (I want to decrease kr to accelerate real-time performance)

	even though you may not use any 'k' variables in a csound orc, the
'kr' is still used.  What happens is that csound uses the kr as its main
cycle - calculating an output buffer of 'ksmps' # of samples for each 'a'
opcode.  Since you are using everything at an 'a' rate, then i would guess
thats what's throwing things off (havent looked at your instrument long
enough to think about it)

	BUT: since you aren't doing anything at a 'k' rate, changing 'kr'
will not speed up your real-time performance anyway -> so just keep sr=kr
or write your own opcode in C...

-matt





Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa11184;
          24 Aug 97 20:29 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa14033;
          24 Aug 97 20:28 BST
Received: (qmail 20877 invoked from network); 24 Aug 1997 19:28:25 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 24 Aug 1997 19:28:25 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (UAA01089); Sun, 24 Aug 1997 20:20:08 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Sun, 24 Aug 97 20:19:59 +0100
Received: from piano.technion.ac.il [132.68.57.183] by hermes via ESMTP (UAA00980); Sun, 24 Aug 1997 20:19:58 +0100
Received: by piano.technion.ac.il (950413.SGI.8.6.12/930416.SGI)
	 id WAA12414; Sun, 24 Aug 1997 22:20:00 -0700
Date: Sun, 24 Aug 1997 22:19:59 -0700 (PDT)
From: Erez Webman 
To: "Matt J. Ingalls" 
Cc: Csound list 
Subject: Re: A bug ?
In-Reply-To: 
Message-Id: 
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk



On Sun, 24 Aug 1997, Matt J. Ingalls wrote:

> 	BUT: since you aren't doing anything at a 'k' rate, changing 'kr'
> will not speed up your real-time performance anyway -> so just keep sr=kr
> or write your own opcode in C...
> 

This was just a simplified example. I DO use 'k' rate stuff, such as MIDI 
processing.

Erez 



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa11651;
          25 Aug 97 3:13 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa26548;
          25 Aug 97 3:12 BST
Received: (qmail 26443 invoked from network); 25 Aug 1997 02:12:38 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 25 Aug 1997 02:12:38 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (DAA14150); Mon, 25 Aug 1997 03:05:24 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Mon, 25 Aug 97 03:05:16 +0100
Received: from denmark-c.it.earthlink.net [204.119.177.22] by hermes via ESMTP (DAA11951); Mon, 25 Aug 1997 03:05:14 +0100
Received: from [153.34.54.147] (1Cust19.max12.washington.dc.ms.uu.net [153.34.54.147])
	by denmark.it.earthlink.net (8.8.7/8.8.5) with SMTP id TAA10670
	for ; Sun, 24 Aug 1997 19:05:50 -0700 (PDT)
Message-Id: 
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sun, 24 Aug 1997 22:05:06 -0400
To: csound@maths.ex.ac.uk
From: Robert Tichacek 
Subject: Dumb Question #2
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

A situation - I have a long sustained note, and want to add an occasional
pitch bend to it at various times (think electric guitar being whammied
from time to time). Now I know that I can accomplish this using a suitably
long  or the like, but is there any way that I can accomplish this
in the score rather than the orc. file?
Also, while on the subject of sustained notes, exactly how does one create
a tied note in the standard score, and what purpose does this serve? With
the absence of bar lines and standard note lengths one of the major reasons
for having tied notes in written notation would seem to be lacking.

Or perhaps this is all a case of RTFM
Robert T.





Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa11747;
          25 Aug 97 4:53 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa28933;
          25 Aug 97 4:52 BST
Received: (qmail 27656 invoked from network); 25 Aug 1997 03:52:27 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 25 Aug 1997 03:52:27 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (EAA13047); Mon, 25 Aug 1997 04:43:22 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Mon, 25 Aug 97 04:43:14 +0100
Received: from root@discover-net.net [208.134.196.20] by hermes via ESMTP (EAA15652); Mon, 25 Aug 1997 04:43:13 +0100
Received: from PC_hljmm.discover-net.net (max-ec1-210.discover-net.net [208.134.205.210]) by discover.discover-net.net (8.8.6/8.7.3) with SMTP id WAA09158; Sun, 24 Aug 1997 22:41:42 -0500 (CDT)
Message-Id: 
In-Reply-To: 
References: Conversation  with last message 
Priority: Normal
To: Erez Webman , 
    Csound list 
Mime-Version: 1.0
From: Hans Mikelson 
Subject: Re: A bug ?
Date: Fri, 08 Aug 97 04:32:30 PDT
Content-Type: text/plain; charset=US-ASCII; X-MAPIextension=".TXT"
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Greetings,

Erez Webman wrote,

> ;--- Main KS processing  ---------------------------------------
> asig      =         ain + adel
> amod      =         ifb*(0.5*asig + 0.5*asigprev)  ; Simple LPF
> adel      delay     amod, idelay
> asigprev  =         asig
> ;---------------------------------------------------------------

Someone may correct me if I screw this up too much but...the way it seems to 
work is that asigprev only gets updated every ksmps samples so the cut off 
freqency of your low pass filter ends up a lot higher than expected.  
As far as I can tell this is not a bug but the way Csound is 
supposed to work.  Fortunately this was anticipated and there are a couple 
of solutions.

1. Use delay1 to delay the signal one sample.
2. Set sr=kr
3. Use tone or butterlp, these have some advantages anyway.

That's about all I can think of now.

Cheers,

|    |    |  \   |     /      Hans P. Mikelson
|  __     |  __/ |  \    |    hljmm@discover-net.net
|__  |__  |__    |__ \_  |__  http://discover-net.net/~hljmm/




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa11756;
          25 Aug 97 4:59 BST
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa29054;
          25 Aug 97 4:59 BST
Received: (qmail 27721 invoked from network); 25 Aug 1997 03:59:07 -0000
Received: from hermes.ex.ac.uk (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 25 Aug 1997 03:59:07 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (EAA08692); Mon, 25 Aug 1997 04:51:51 +0100
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Mon, 25 Aug 97 04:51:43 +0100
Received: from root@discover-net.net [208.134.196.20] by hermes via ESMTP (EAA15225); Mon, 25 Aug 1997 04:51:42 +0100
Received: from PC_hljmm.discover-net.net (max-ec1-210.discover-net.net [208.134.205.210]) by discover.discover-net.net (8.8.6/8.7.3) with SMTP id WAA09488 for ; Sun, 24 Aug 1997 22:50:53 -0500 (CDT)
Message-Id: 
In-Reply-To: 
References: Conversation  with last message 
Priority: Normal
To: Csound Mailing List 
Mime-Version: 1.0
From: Hans Mikelson 
Subject: Re: Dumb Question #2
Date: Fri, 08 Aug 97 04:41:42 PDT
Content-Type: text/plain; charset=US-ASCII; X-MAPIextension=".TXT"
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Greetings,

Robert Tichacek wrote:

> A situation - I have a long sustained note, and want to add an occasional
> pitch bend to it at various times (think electric guitar being whammied
> from time to time). Now I know that I can accomplish this using a suitably
> long  or the like, but is there any way that I can accomplish this
> in the score rather than the orc. file?

I think the following will do what you want:  Use a second instrument to 
trigger the bends and a global variable to communicate between the two 
instruments.  Add this frequency to the base frequency of your instrument.  
Something like:

aout   oscil  iamp, ifqc+gkfqc, 1

I think you may want to make the pitch-bending instrument lower numbered than 
the "guitar" instrument so that everything gets updated on time.

Cheers,

|    |    |  \   |     /      Hans P. Mikelson
|  __     |  __/ |  \    |    hljmm@discover-net.net
|__  |__  |__    |__ \_  |__  http://discover-net.net/~hljmm/


Date1997-08-25 06:19
FromErez Webman
SubjectRe: A bug ?

On Sun, 24 Aug 1997, Matt J. Ingalls wrote:

> 	BUT: since you aren't doing anything at a 'k' rate, changing 'kr'
> will not speed up your real-time performance anyway -> so just keep sr=kr
> or write your own opcode in C...
> 

This was just a simplified example. I DO use 'k' rate stuff, such as MIDI 
processing.

Erez