Csound Csound-dev Csound-tekno Search About

[Csnd] tab/table anomoly

Date2012-07-20 02:51
From"Art Hunkins"
Subject[Csnd] tab/table anomoly
I don't understand the action of tab, or its substitute, table, in the .csd 
below.

The example uses a MIDI volume control (typically controller 7) to vary the 
amplitude of a sine wave.

With *tab*, controller response is normal until it reaches max (1), where it 
drops precipitously to zero; once below max, it resumes normal behavior.

With *table* (replacing tab) and controller 7 preset to 0, the example 
initializes at full volume. When the controller is raised, output reverts to 
what is expected, and continues normally.

I presume the problem has to do with converting or interpolating different 
kinds of numbers - or having to do with the way 0 and 1 are handled by tab 
and table. I'm running Csound 5.06 on Windows XP (if this is a factor).

Explanations?

Art Hunkins





; for Windows, Mac
-odac -M0 -b128 -B2048
; for Linux
;-odac -+rtaudio=alsa -+rtmidi=alsa -M hw:1,0 -b128 -B2048




sr = 44100
ksmps = 100
nchnls  =       2

        instr 1

k1 ctrl7    1, 7, 0, 1
k2      tab      k1, 1, 1
k2      port     k2, .01
a1      oscil    5000 * k2, 440, 2
        outs     a1, a1

        endin




f1 0 16384 16 0 16384 6 1
f2 0 16384 10 1
i1 0 60


 


Date2012-07-20 03:12
FromJustin Smith
SubjectRe: [Csnd] tab/table anomoly
try not letting the index reach 1 - the highest index you should use
iirc is 1-(1/table_size), or at least this used to be the case

also, on a totally unrelated note, for ease of varying parameters, in
the CsOptions section you can have as little as one flag per line if
you wish, ie:

-odac
-b128
-B2048
; for windows/mac
-M0
; for Linux
; -+rtaudio=alsa -+rtmidi=alsa -M hw:1,0


On Thu, Jul 19, 2012 at 6:51 PM, Art Hunkins  wrote:
> I don't understand the action of tab, or its substitute, table, in the .csd
> below.
>
> The example uses a MIDI volume control (typically controller 7) to vary the
> amplitude of a sine wave.
>
> With *tab*, controller response is normal until it reaches max (1), where it
> drops precipitously to zero; once below max, it resumes normal behavior.
>
> With *table* (replacing tab) and controller 7 preset to 0, the example
> initializes at full volume. When the controller is raised, output reverts to
> what is expected, and continues normally.
>
> I presume the problem has to do with converting or interpolating different
> kinds of numbers - or having to do with the way 0 and 1 are handled by tab
> and table. I'm running Csound 5.06 on Windows XP (if this is a factor).
>
> Explanations?
>
> Art Hunkins
>
>
> 
> 
>
> ; for Windows, Mac
> -odac -M0 -b128 -B2048
> ; for Linux
> ;-odac -+rtaudio=alsa -+rtmidi=alsa -M hw:1,0 -b128 -B2048
>
> 
> 
>
> sr = 44100
> ksmps = 100
> nchnls  =       2
>
>        instr 1
>
> k1 ctrl7    1, 7, 0, 1
> k2      tab      k1, 1, 1
> k2      port     k2, .01
> a1      oscil    5000 * k2, 440, 2
>        outs     a1, a1
>
>        endin
>
> 
> 
>
> f1 0 16384 16 0 16384 6 1
> f2 0 16384 10 1
> i1 0 60
>
> 
> 
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>

Date2012-07-20 04:27
FromJim Aikin
Subject[Csnd] Re: tab/table anomoly
> With *table* (replacing tab) and controller 7 preset to 0, the example
> initializes at full volume. When the controller is raised, output reverts
> to
> what is expected, and continues normally. 

I seem to recall some other MIDI input issue in Csound that was very like
this. The MIDI input value was not being initialized to 0 before the receipt
of the first MIDI message, but to 1. If I'm recalling it correctly, it's a
Csound bug. You could maybe work around it by having the instrument send a
MIDI message to itself during initialization....

--JA

--
View this message in context: http://csound.1045644.n5.nabble.com/tab-table-anomoly-tp5714290p5714292.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-07-20 09:56
FromTito Latini
SubjectRe: [Csnd] tab/table anomoly
AttachmentsNone