waveform visualization, but only on one period
Hello
I would like to visualize a waveform, but only on one period.
Of course, when I use the "scope" object, I can visualize the waveform but the waveform "moove" with time,
and I would like to fix it only on one period.
The idea is to integrate this visualization in a synth I build.
In attachment, a picture of Absynth, a synthesizer which allows this kind of visualization.
Thank you in advance for your answer.
Check all options of scope in the inspector. It's possible to get a non moving waveform.
hello
thank you for your answer.
I already tried that, and yes the waveform doesn't moove with time, but moove with the frequency.
In fact, the idea is to have a representation of how the fm or additive or anything type of modulation shapes the waveform only on one period,
independently of the time or the frequency (in case of fm, the carrier frequency).
I hope I'm clear, I am not very good in english...
I tried several things, but none work...
If someone has an idea, it could be very helpful!
thanks
There's two ways to do it. The standard way is to set the display object to trigger when the waveform crosses a threshold (usually rising above 0.), which is the way most old-timer oscilloscopes function. By this method, the time taken between triggers is usually set to something like 50 ms, so that low-frequency audio waves display in entirety, and the buffer length is fixed.
This doesn't always work with waveforms containing more than one frequency fundamental, such as FM does, because cyclic variations cause the waveform to shift back and forth (as for example in FM, between zero-crossings of carrier and modulator waves at different intervals, depending on their frequency ratio). In Max however you may already have the frequency you wish to display available as a value elsewhere in your design. Thus the new way to display a single-cycle waveform of a particular wavelength is to set the buffer to an exact multiple of the frequency to display and disable the trigger function (or only trigger when the frequency changes, if you want the waveform to be in the same place across changes of the display period). To achieve the same rendering width for different frequencies, one changes the sample frequency in some way so the wave exactly fits in the pixel width of the window.
To determine the buffer length, one first determines the number of samples in one wave cycle, typically by reciprocating the frequency (1./Hertz) and multiplying by the number of samples per second. That provides the number of samples for a one-second buffer, which one can then scale to fit in a particular viewport. To fit one period exactly in the display, one simply divides the samples/period by the pixel width of the viewport. Max provides a number of objects for displaying wave forms in different manners, hence, the specific commands for any one type of display object varies, but the method is the same.
Thank you for your answer Ernest,
I will try to do something in this way.
How do you create your waveform? If it is oscillators, you can use the number of samples within one period and dump it into a buffer~. I would do it with with poke~... Then display with waveform~...
Stefan
Thank you Stefan.
It seems a good idea, I turn around the objects that you speak about.
But I'm a bit newbie, so it takes time...
I'll try to do that.
Louis