Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Mon Apr 14, 2008 7:47 am Post subject:
Wave-Goo Subject description: Wave Morphing
I had this idea the other day, I don't know if it's original, probably not.
Wave-Goo, like Kai-Goo. Morph a wave from one shape to another over time. A sequence could be defined that given a control input, could morph a wave from it's starting shape to an ending shape that depends both on the morph target wave shape and the control amount which states how far to take the morphing process.
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Mon Apr 14, 2008 8:54 am Post subject:
Hmm. I think that's similar to what I want to do.
I would do this with DSP in an FPGA.
Looking at the block diagram on Don's site, I think I see how this works.
He mentions that a two channel panner is a denerate form of this. In order for his system to not be a simple panner, it needs more than two waveforms.
The interpolation occurs across several waveforms, but it is trapped in time.
The design I am considering could operate as a morpher with only two waveforms because unlike Don's system, the information for a complete wave cycle is known in advance so anchor points can sort of go back or forward in time. In other words, the beginning of one waveform doesn't have to coincide with the beginning of the other waveform.
Joined: May 04, 2007 Posts: 1734 Location: NM USA
Audio files: 54
Posted: Mon Apr 14, 2008 9:27 am Post subject:
ScottG wrote:
The design I am considering could operate as a morpher with only two waveforms because unlike Don's system, the information for a complete wave cycle is known in advance so anchor points can sort of go back or forward in time. In other words, the beginning of one waveform doesn't have to coincide with the beginning of the other waveform.
So ... this is somehow different from cross-fading between two waveforms? Sorry, not following you. Anchor points?
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Mon Apr 14, 2008 9:49 am Post subject:
Like when Kai-Goo morphs a man face into an ape face, the eyes are set as anchor points, the ears are set as anchor points, the center of the forehead, etc. When the program generates the morph frames, it makes sure that the anchor points move from their start position to their end position.
I'm not sure it isn't a simple pan yet either, if it is, I'll look into a digital version of system Don describes using several waveforms. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Mon Apr 14, 2008 10:04 am Post subject:
Here's a graphic of what I mean. This would be morphing a sine into a saw. The connecting lines between the two waveforms represent the "anchor points".
While the beginning and end are simply the two waveforms, I think that the waves generated in between will not represent a simple two channel panner.
May be not exactly the way you think , but yes
I have recently released a little 8 bits hardware platform and PC editor software who do that and many other things ...
The software is freeware to download from my site and morph waves in all directions/sizes. You can also simulate the morphing in realtime or pre-calculate it and animate it..
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Tue Apr 15, 2008 9:42 am Post subject:
Thanks Marc,
Does one of the samples on your site contain an example of the wave morphing I refer to above ? I.e., morphing that uses only two wave samples (the starting and ending waveforms) and math functions that do the morph as a control value is increased.
Basically, I'm looking for something with a more profound sound changing character than simply panning between two waveforms. In other words, if this sound can be produced other ways, I'm probably not interested in spending a lot of time developing this. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima
based on your diagram this would be different from a simple x-fade. would be cool to hear what it sounds like i reckon you could write a program to load the two endpoint waves, let you set the anchorpoints, and generate the in-between waves. you could then load these waves into marc's quantix-8 and scan them with a cv...
Here's a graphic of what I mean. This would be morphing a sine into a saw. The connecting lines between the two waveforms represent the "anchor points".
While the beginning and end are simply the two waveforms, I think that the waves generated in between will not represent a simple two channel panner.
It's still interpolation, no? Simple linear interpolation will be just simple panning (finding the midway point between the two waves)... A cool thing would be finding the peaks and valleys of both waves and using them as the "anchor points"... This would be like the traditional EMS Synthi triangle/saw morph, but with dedicated DSP, much more could be achieved...
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Tue Apr 15, 2008 5:03 pm Post subject:
The way I see this, the ending waveforms are mapped to each other through nonlinear time compression and time expansion functions. These functions would then be driven by a linear standard time scale so that pitch is preserved regardless of the interpolation. The morphing happens by interpolation between the time scale functions to generate a table lookup address for each of the two tables and then using lookup tables to get the two output values which are then panned using the interpolation value as a pan amount input. This should certainly distort the waveforms as they are morphing, but should preserve the endpoint waveforms when the interpolation factor is at either end of it's range.
This means that the waveforms stored in the wavetables must be pre-distorted so that when played through the time compression/expansion functions, the waveform plays correctly. Consider a sawtooth that is recorded with a compressed section followed by an expanded section. When played back with an expanded section followed by a compressed section, the waveform would look like a saw - but it would not look like a saw as stored in the table or if played back with linear time.
I'd like to do this in realtime, but I'm not sure how practical that is. I may need to do some things precomputed such as the distorted version of each endpoint waveform. I'm working out the math details to do this. I will probably start with a simple experiment in C to generate a .WAV file. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Wed Apr 16, 2008 11:59 am Post subject:
After reviewing this idea and the complexity of the math and logic involved, I believe it will work, but is not worth the coding effort. It's affect will not be intuitive. I don't believe it will do more than either Marc's method or Don's.
Marc's method appears to be more intuitive, but requires lots of RAM. There is a 64 megabyte DDR SDRAM on the board I have... _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Sun Apr 20, 2008 4:58 pm Post subject:
In case there are still interested parties, I've decided to do a digital MIDI synth with voice expression implemented using an interpolating scanner .
What I have working right now is a simple two waveform panner system. MIDI Velocity and the ADSR value are used to pan from waveform 0 to waveform 1. 8 voice polyphony using MIDI is working. This much is using about 15% of the FPGA. Sample rate is 250KHz.
Hopefully, the final version of the synth will max out at 16 wavetables, 1024 samples each; each voice will have an ADSR to control interpolation over the 16 wavetables, another ADSR to control output amplitude and if resources permit, a third ADSR to control an SVF per voice. Wavetables will be preinitialized with usable data and updatable by system exclusive messages.
The state machine for the current version is using only about half of the time it is allowed for each voice, so I believe all the above is possible. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima
Joined: Mar 22, 2007 Posts: 27 Location: valence france
Posted: Sun Apr 27, 2008 6:17 am Post subject:
hello,
I am wrong or true morphing (not just crossfading) between two arbitrary waveforms would require finding a formula, general enough to represent both waves, and then interpolating its coefficients ?
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Sun Apr 27, 2008 7:04 am Post subject:
That is one way that can work.
Another way would be to have many successive waveforms to interpolate through. If you imagine going from a square to a saw, this seems a bit difficult, but what if you made many waveform images that are succesive steps toward the morph, then it's more like a movie. You can't imagine how to get from the first frame to the last unless you watch the whole movie and see the characters smoothly move about. That's the idea behind the interpolating scanner. Not two waveforms, but many that define the progress of the morph over time. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima
Joined: Mar 22, 2007 Posts: 27 Location: valence france
Posted: Sun Apr 27, 2008 8:48 am Post subject:
( how are you, yves ?)
wavetable stuff is more easy to deal with than additive synthesis, but you're limited to plain periodic waveforms then, and, unless you have huge memory ressources (frequency, amplitude and possibly expression should affect harmonic content, with decent resolution, all this being user editable) and/or intend to add some post-processing (filters, etc...) the sound will remain rather artificial and static, let aside aliasing issues (?)
Morphing vs crossfading is an interesting subject.
My poor maths background unfortunately don't allow me to fully understand how fft analysis really works...
For example :
Considering a width modulated pulse, going from infinitely narrow (all harmonics theorically equal) to square (odd harmonics only, -6db slope)...
A naive guy like me would be tempted to perform an fft analysis of the start and another of the end waveforms, take the union of the two, recompute the two spectra (setting the amplitude of the partials not initially present in one, to zero) and interpolate all partials...
Which I think would lead to crossfading, not morphing...
My understanding is that only morphing would allow to faithfully restitute the original pwm sound (?) I'd really like to know how to do that in an additive synthesis context...
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Thu May 01, 2008 1:52 pm Post subject:
Thanks to Yves, I tried something that I think is interesting.
I started thinking about the trigonometric identities and what they might supply.
I see this...
Code:
sin(2u) = 2sin(u)cos(u)
I then thought of this:
Code:
out = ( sin( angle ) * ( P * cos( angle ) + ( 1.0 - P ) ) ) * ( P + 1.0 ) ;
which is capable of smoothly moving from sin(u) to sin(2u) by varying the parameter P between the values 1.0 and 0.0. I generated a wave file sweeping from 1.0 to 0.0. Note that parameter P handles both the "morph" and compensates the amplitude to a constant 1.0.
What I can't say is whether this sweep represents the same sound animation as would a simple pan from sin(2u) to sin(u).
EDIT ADD: I now see this:
Code:
sin(u)cos(v) = [ sin(u+v) + sin(u-v) ] / 2
I believe I can do a sweep between sin(u) and sin(3u) using this, where sin(3u) represents a perfect 5th interval. I think I can also use this with the one above and do some other weird stuff.
sine_morph_test.wav
Description:
sin(2u) to sin(u) sweep using parametrically driven trigonetric identity
Joined: Mar 22, 2007 Posts: 27 Location: valence france
Posted: Thu May 01, 2008 3:11 pm Post subject:
weird...I'm getting a very different result (sounding like a crossfade) with your function (sweep is reversed) Are you using very short tables for your sine/cosine waves ?
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Thu May 01, 2008 3:26 pm Post subject:
usw wrote:
weird...I'm getting a very different result (sounding like a crossfade) with your function (sweep is reversed) Are you using very short tables for your sine/cosine waves ?
No, I used a C program, double prec. arith. and the built in sin/cos functions.
If I were to implement this in an FPGA, I would use a table, it would be the equivalent of 4096 samples of the wave by using a quarter cycle 1024 location table folded out. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Thu May 01, 2008 3:58 pm Post subject:
Ok, the second identity did not yield a sweep from sin(3u) to sin(u), however, it does yield a sweep from sin(3u) to sin(2u) as I used it in the function below. The attached wave was produced with this:
Code:
out = sin( u + u ) * ( P * cos( u ) + ( 1.0 - P ) ) - ( P / 2.0 ) * sin( u ) ;
This doesn't have amplitude compensation (my brain already hurts), but the amplitude change isn't outrageous. Sample attached.
EDIT ADD: What's really cool about this is that there's no sin(3u) anywhere in the input, yet it certainly exists in the output
EDIT ADD:
this:
Code:
out = ( sin( u + u ) * ( P * cos( u ) + ( 1.0 - P ) ) - ( P / 2.0 ) * sin( u ) ) * ( P + 0.9 ) ;
nearly compensates for amplitude, but not exactly.
sine_morph_test_2.wav
Description:
sin(3u) to sin(2u) using a parametrically controlled trigonometric identity
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Thu May 01, 2008 5:55 pm Post subject:
Last one, I took the two systems above and drove one with the other. The result was a sweep from sin(3u) to sin(u) as I orignally wanted. Again, I never actually use sin(3u), only sin(u) and cos(u) from which sin(2u) and sin(3u) are generated.
EDIT ADD: To me, this one sounds like it morphs from sin(3u) to sin(2u) to sin(u)...
sine_morph_test_3.wav
Description:
sine morph from sin(3u) to sin(u) using two parametrically controlled trigonometric identities
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima Last edited by JovianPyx on Fri May 02, 2008 1:51 pm; edited 1 time in total
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Fri May 02, 2008 7:11 am Post subject:
This has been an interesting experiment for me. I'm not sure where this will go, but right off, perhaps an FPGA based bell synth?
I also noticed that the basis for sideband is rooted in trig identities. With that formula, one can create sines (or cosines) with angle sums and differences. Eg: using sin(2u) and sin(3u) as inputs, one gets sin(5u) and sin(u) as outputs, but parameterization allows a sweep between them. The resources required are multiplies, add/subtract and a single table for sine/cosine. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima
Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
Posted: Sat May 03, 2008 7:22 pm Post subject:
First cut of a test FPGA synth is working using a simple sin(2u) to sin(u) morph.
8 voice polyphonic, morph is controlled by an ADSR and velocity.
Next is to get the sin(3u) to sin(u) morph working because I think that will be more interesting and may allow other morphs using simple arithmetic.
This synth uses an 18 bit wide 1024 location 1/4 cycle sine table producing both sines and cosines. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat?corruptio optimi pessima
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum