k y m a • t w e a k y — the kyma collective || view the current website || February 2015 Archive

/ WebHome / Sounds / Share.SawtoothDemoDiscussion


Share Section



All Sections


Login / Register 
Change password
Forgot password?

Symbolic Sound

Kyma Forum
Eighth Nerve

TWiki Links

TWiki Formatting FAQ
What is TWiki?
%SESSION_ENDIF% twiki.org
Instead of placing another non-meaningfull oscillator, I decided to make a complete demo!

The zip-file contains the following files:

Readme.txt        info
CosOct10.wav      wavfile for QuadraBdrum1
DemoSawTable.MID  standard midifile
NegCosPi.wav      limitingwaveshaper
sawNN127_24.aif   sawtooth wavetables for midinote 24 until 127
SawTable.kym      The file to run!
SinOct10.wav      wavfile for QuadraBdrum1
The files will be placed in a directory called "SawTableAll". The zip-file contains all the files needed to demo SawTable.kym. All default files included with Kyma X are excluded!

Listen first, then read:

Run SawTable.kym on the capybara. (It will run on a default capybara320, ignore the realtime error) Import DemoSawTable.MID (midifile-format 1) into a standard sequencer. (Note: the demo does not work alone on the capybara! Somehow if a midifile contains controller data for parameters in the VCS, these will not respond!?). Route the midi-output of the sequencer to the capybara and play the sequence.

It is a little song that demonstrates several things: (Open the DemoSaw.kym window)

1) Beat is just a simplebeat to keep the song flowing.

2) Bdrum is a Bassdrum generated by a simplified modulated complex vector filter. The complex vector filter is exited with a pulse so it generates sine and cosine as an quadrature oscillator will do. After the filter simple distortion is applied. Do not try to understand the structure, because it is horrible. All parameters for the basedrum are immediately controlled by !cc00 up to !cc06, as one can read in the "QuadraBdrum1" Annotation.

3) StereoPingPongDelaySaw, it uses the default StereoPingDelay Prototype for delay effect. Saw3voice2 enables 3 voices of a sawtype oscillator with a normal Kyma filter. The two delays are added to make it sound more smooth. The root of this sound is a "sample" prototype which uses the file sawNN127_24.aif. The file contains waveforms for midinote- number 127 until 24 concattinated. The waveforms have different sizes, so the frequency field looks a bit strange. Also notice the start, end, loopstart and loopend parameters.

4) SawBass enable a single voice of the same type of sawtype oscillator. Instead the VCF- filter is used and some distortion is added.


The idea started when I wanted to create a generator that did not alias and why not a sawtooth. One approach is already given by BenPhenix (the p5.kym). Although a very nice concept, one problem is the oscillator is filled with a different rate then the playback rate of the wavetable. This results in a startup-period of 4096/fs(=+/-9ms for 44.1kHz) were the output of the oscillator can have an unstable sound. One can here this during attacks. The other very simple approach is to just make all the wavetables for every midinote. The idea is not new at all and could be done by every Kyma user. We do limit ourselfs to midinotes! So pitchbends will result in some aliasing! My oscillator ranges from midinotenumber 24 until 127. For an audio oscillator this is good enough, it starts at 32.7 Hz (=midinn 24) and at the highest note(=127) only a single harmonic is left. All waveforms are placed in one aiff-file. The root of the oscillator is a "sample" prototype. One could also use a "waveshaper" with an seperate -1,+1 indexer from Share.Microsounds.PetesDSPModules9-12-03.kym, but I had some problems in getting this to work correct.

Sample indexing:

In the creation process I stumbled into the Kyma things, that you do not want to know. I will first like to reference ReadingSampleWithSignal, which is a discussion about the same stuff. What do you need to know when creating cyclic-wavetables (concattinated in a file) for the "sample" or "waveshaper" prototype?

  1. The first sample and the last sample in a file(or period) should be the same
  2. Wavetables should be a power of two in size
  3. The total file size should be a power of two + one (see first point)
  4. All waveforms should start with the same value having a period equal to the size

Use a sum of sines to get 0-value starts and pad zero at the end of the file. One cycle looks like this: sin(2*i*pi/4096) here i starts at 0 and ends at 4095.

If you want to generate non-sine phased signals (meaning not starting at zero for every period): all waveformperiods should be a power of two minus one and the first sample should be copied at the back to satisfy point 1 and 2. (I did not try this yet)

You need more info, but that will come in time.

-- ChristiaanGelauff - 10 Sep 2004

What more do you need to know?

(I hope someone can use this info in his advantage)I did some tests with the Kyma waveshaper prototype. I did this to get a better understanding of the exact indexing in the tables. For this test I have created three special wavetables with the following content:

x1 = [-1,-0.75,-0.5,-0.25,0,0.25,0.5,0.75,1]                % tablesize = 9 samples (=odd)
x2 = [-1,-0.7143,-0.4286,-0.1429,0.1429,0.4286,0.7143,1,-1] % tablesize = 9 samples (=odd)
x3 = [-1,-0.7143,-0.4286,-0.1429,0.1429,0.4286,0.7143,1]    % tablesize = 8 samples (=even)
Keep in mind +1 does not really exist on the capybara. What I did was put a control at the input of the waveshaper and send the output of the waveshaper to another controller on the VCS. I started with the x1 table and tested input to output relation with interpolation on and off. Next I did the same test with x2 and x3. The results are listed in the following tables:
table x1
Interpolation off     Interpolation on
input  output amount  input   output
-1     -1     8       -1      -1
-0.76  -1             ..      ..
-0.75  -0.75
-0.5   -0.5
..     ..             0.75    0.75
0.75   0.75           0.99    0.99
1      0.75           1       1
table x2
Interpolation off     Interpolation on
input  output amount  input   output
-1     -1     8       -1      -1
-0.76  -1             -0.75   -0.71
-0.75  -0.71          0       0.14
-0.5   -0.43          ..      ..
0      0.14           0.75    1
0.75   1              0.87    almost 0
1      1              1       -1
table x3
Interpolation off     Interpolation on
input  output amount  input   output
-1     -1     8       -1      -1
-0.76  -1             -0.75   -0.71
-0.75  -0.71          0       0.14
..     ..             ..      ..
0      0.14           0.75    1
0.75   1              ..      ..
1      1              1       1    (question for Kurt: is the last values copied once more at the end?)
amount = amount of outputvalues from the waveshaper

What can we learn from this?

Interpolation off: using a odd or even table (like x2 and x3) produces exactly the same behaviour! From the test with x1 and x2, one can see the last sample is never reached using a odd table! Conclusion: you can use this for integer index conversions with a even table size as expected.

Interpolation on: use an odd table as formatted like x2 to generate waveforms for audio-oscillators. Use an odd table as formatted like x1 for distortion applications. Use an even table as formatted like x3 for controlling some tablelookupvalue with lineair interpolation. The indexingcontroller to the waveshaper should look like this:

((!cc00*255)-128)/256 (btw C&K, can these !cc's be mapped different in Kyma?)

You may smooth or filter this controlsignal to get better results. For those who never made a lookuptable in Kyma, I can not help you, because I always use matlab. One would use a tablelookup like this if you want to get an complex equation to run at audiorate (Example: filterparameters).

Feedback or addition about this subject is always welcome.

-- ChristiaanGelauff - 24 Sep 2004

© 2003-2014 by the contributing authors. / You are TWikiGuest