I have trouble calling siosc

I’m trying to learn Nyquist, and I’m having trouble figuring out how the tables argument of siosc is supposed to look.
The reference manual has this to say:
The tables specify a list of waveforms as follows: (table0 time1 table2 … timeN tableN), where each table is a sound representing one period.
Here is my attempt:

(setf mytable (maketable (osc 2)))
(setf mytable2 (maketable (osc 1)))
(siosc 60 (s-rest 1) '(mytable 1 mytable2))

siosc-breakpoints throws an error when I run this:
siosc-breakpoints : BREAKPOINTS = (MYTABLE 1 MYTABLE2)
error: SIOSC expecting SOUND in table list

from reading nyquist.lsp, it seems that (soundp (car '(mytable 1 mytable2))) returns false. Why is that?

Try this:

(siosc 60 (pwlv 0 1 800) (list (hzosc 4) 1 (hzosc 1)))

I’ve not used SIOSC before. It’s cool :sunglasses:

(stretch-abs 2
    (mult (pwlv 0 0.01 1 0.1 1 0.2 0.2 1 0)
          (siosc 72
              (mult (pwlv -10 0.5 10 1 -10)(sum 10 (hzosc 4)))
              (list (mult (pwlv 0 0.2 1 1 0)(hzosc 1))
                    0.4
                    (mult (pwlv 0 0.8 1 1 0)(osc-tri 0.8) )
                    0.6
                    (mult (pwlv 0 0.2 1 1 0)(hzosc 2))))))

Somewhat tricky to use this. Best way for me to understand what’s going on:

(abs-env (siosc (hz-to-step 10) (const 0) (list (hzosc 1 *sine-table* -90) 1 (osc-tri 1))))

This will make a morph from a sine to a triangle in 10 steps. If you omit the abs-env, the frequency will alas depend on what’s selected, e.g. a 10s selection will give a roughly 100Hz signal with the above, but a 30s selection will give a 300Hz signal. So that can be pretty confusing.

The phase shift in the sine table is needed here because it’s aligned differently than the tri table. You can see this done in other places e.g. in tremolo.ny.

Nice demo :nerd:

An alternative to using abs-env is to define the code as a “generate” type effect.
You can also use s-rest rather than (const 0).
Example of a 2 second demo:

;type generate
(siosc (hz-to-step 10)
       (s-rest 2)
       (list (hzosc 1 *sine-table* 270) 2 (osc-tri 1)))