Page 1 of 1

Wave Read Problem?

PostPosted: Sun Mar 19, 2017 12:49 am
by aronb
Hi,

I am having an issue that I cannot understand.

When I create an array (a ramp from -1 to 1), the output from the Read prim is incorrect :?:

Here is my example schematic (with 2 wave arrays) in hopes someone can help please.

2_Wave_Array_Read_Test.fsm
Wave Read Issue
(68.76 KiB) Downloaded 950 times


I need to create multiple channels of waves (5 in all) not band limited, and based off of an array I create in Ruby. I have the Ruby part working, but when I outputted the array it looked incorrect. I then simplified the schematic to remove any other possible issues and this is what I found (see schematic). :?

Thanks for any help,

Aron

Re: Wave Read Problem?

PostPosted: Sun Mar 19, 2017 1:54 am
by KG_is_back
The "wave table" prim is meant to be specifically used with "wave table read" prim. The wave table prim precomputes anti-aliased table that the wave table read prim can then use to generate oscillator. The table is constructed by decomposing the input table into harmonics. Incidentally, the first table only contains the base frequency (that's why you get the sine wave output - you are reading that part of the table) and each next one has one harmonic more, until the very top one is copy of the input table (you can check this by adding multiples of 32 to the index of read prim - you get waves with increasingly more harmonics). The "wave table read" prim uses these to produce anti aliased oscillator by picking the appropriate table to read its wave from (so that the harmonics never exceed half-sample rate).

Now, the correct approach depends on what you're after. If you want to create reliable anti-aliassed oscillator, just use the "wave table" prim like you do and connect it to "wave table read" prim, which has the same inputs as other stock oscillators. I'm assuming this is what you want to achieve judging by the fact that you have "ramp osc" driving the index readout.
If you just want an arbitrary array and read values from it at sample rate, then just use "float to array" prim in place where you have "wave table" prim and connect it to "wave read" prim exactly like you do now.

Re: Wave Read Problem?

PostPosted: Sun Mar 19, 2017 4:54 am
by aronb
KG_is_back,

Thanks for the help and explanation!

I got it working, and yes I need to index the data rather than just output the waveform - although I have used the array to waveform out type before.

Again Thanks for the help :D

Aron