[Fpga-synth] Odd Waveguide Behavior
Scott Gravenhorst
music.maker at gte.net
Fri Aug 10 00:14:43 CEST 2007
Actually, I'm not at all sure where the oddness actually is. I've been
beating my head against the wall for days now.
The waveguide seemed to be working just fine, doing all of the expected
things - until I tried to move the pickup.
I've been through the symbol name length thing already due to another weird
problem. Shortening names (down to mostly 3, 4 or 5 characters) fixed that
one. I left no name unshortened...
As far as I know, the way I'm using RAM to implement a delay line is not
unique. I have an end point "pointer" that is used to both read and write
data to/from RAM within the state machine that runs once for each DAC
enable. The last thing that happens is the pointer is incremented and
wrapped to zero at waveguide length. First the picup position is computed
and data fetched from RAM. Next, data is read from RAM for the computation
through the filter, the computation output is then written to the same
location. Then the bump happens. Fine and dandy, it works, halve the
waveguide length, the pitch goes up an octave - but only as long as the
pickup position pointer is zero (which means it's the same as the main
pointer).
The pickup is currently only monitoring one delay line. It's position is
defined as an offset from the main pointer. The address into the delay
line is selected by a mux that picks either pointer+pickup (if <
waveguide_length) else pointer+pickup-waveguide_length. The position value
currently comes from the mod wheel, but I can make the system fail by
setting it to a constant other than zero. The symptom is that when the
position value is increased above zero, the note played is raised in pitch
- not just during the motion of the mod wheel (as I'd expect a doppler
effect then), it stays there raised as long as the wheel isn't returned to
zero. Also, the whole keyboard goes sharp, each key up the scale is a bit
more sharp such that octave keys are more than one octave apart. The
higher the pickup position value goes the more stretched the tuning gets.
The whole thing goes back to normal when the wheel is set to zero. This
behavior does not appear in my C simulation.
So it _acts_ like either the waveguide length is shortening or the sample
rate is changing or the pickup position isn't stationary with respect to
the pointer (delay line endpoint).
I've read several articles today about this, they all say the same thing,
that my structure is correct, and I've seen it work in a C program that
generates .WAV files, I hear a timbre change but no pitch change. The
timbre change is because I'm summing both delay lines as per the algorithm.
I monitor only one delay line in the project for troubleshooting - I know
I should not get a timbre change this way, but I should not get a pitch
change unless I'm actively moving the pickup.
I've measured the sample rate, it is not changing. I've checked to see if
the pointer is incrementing by more than 1 in any DACena cycle, it is not.
I've made the pointer position a constant so that it can't possibly
change, yet the problem persists.
The project files are here:
http://home1.gte.net/res0658s/proj.zip
DWG.v is the top module. If you look, please ignore the mess that is the
code...
I don't expect anyone to tell me what I'm doing wrong, but who knows what
comment might send me looking in the right direction.
-- ScottG (who is stymied)
-------------------------------------------------------------
-- Scott Gravenhorst
-- GateMan I - Xilinx Spartan-3E Based MIDI Synthesizer
-- FatMan: home1.gte.net/res0658s/fatman/
-- NonFatMan: home1.gte.net/res0658s/electronics/
-- When the going gets tough, the tough use the command line.
More information about the Fpga-synth
mailing list