Page 1 of 1

Show a single wave cycle in the Scope

PostPosted: Tue Dec 11, 2012 10:40 pm
by qqwy
Hi there. I am fiddling around with some additive synthesis thingies, and I would like to see what I create in the Scope. However, it is hard to see it in the standard scope because it uses samples instead of a single cycle(i.e., for a sine it would be going one time up and down) of a wave.

Now I am wondering how I can create a scope that shows this. What I tried so far:

-Get the sampling rate object
-Get a fixed frequency (say 100)

-divide the sampling rate through the frequency and feed this to the Scope amount of samples(this is normally a Property)
-Attach a simple osciliator
(Patch can be found in the attachment)


This does not work however.
What am I doing wrong?

~Qqwy

Re: Show a single wave cycle in the Scope

PostPosted: Thu Dec 13, 2012 1:40 am
by unkargherth
well i usually do that on a simple float division

In terms of precission, it's better to decide first on how many samples you want. Suppose your scope is using 256 points block. Then, simply using a Normalized freq of 1/256 gives you a nice steady scope photo ( at least on a simple, really periodic, inputs signals accurate enough on zero crossings)

Re: Show a single wave cycle in the Scope

PostPosted: Thu Dec 13, 2012 8:03 am
by digitalwhitebyte
I use this system:
Sample Rate / (the buffer size of your soundcard) = Frequency for your oscillator.

Re: Show a single wave cycle in the Scope

PostPosted: Thu Dec 13, 2012 11:45 am
by qqwy
Thanks a lot. I have now figured it out.

If anyone in the future wonders how to do this, I have attached a patch explaining it.

A problem still is tough that when I use it in a Synth, I will need two oscilliators: The normal synth one, and one emitting the same wave but at the exact frequency needed for the Scope. Maybe there's a way around this that I don't know of yet...

Re: Show a single wave cycle in the Scope

PostPosted: Thu Dec 13, 2012 7:29 pm
by trogluddite
With a 'bench' oscilloscope, the usual way is to use a trigger input, or a threshold to tell the scope when to start the frame. The stock FS scopes don't have that feature - but I have one that does that I made using SynthMaker.
I'm currently working on porting a load of stuff like that over to FS to make use of the better Ruby features etc. - so hopefully I can get that posted some time while I'm off work for Xmas.
In the mean time, you can find the old one HERE - I've not tested it inside FS yet, but it ought to work OK (just use "show all files" in the FS loading window to open SM files inside FS, or rename the file extension to .fsm).

Re: Show a single wave cycle in the Scope

PostPosted: Thu Dec 13, 2012 10:42 pm
by MyCo
here is a more recent one:
http://www.synthmaker.co.uk/forum/viewt ... 10&t=11773

I'll probably port that to ruby, but that'll take a long time, because the project isn't very simple :)

Re: Show a single wave cycle in the Scope

PostPosted: Fri Dec 21, 2012 11:15 am
by matti
I usually just render it separately as a graphics object. So instead of recording an actual audio of it, i do a rendering with another oscillator and render it with the "Signal Analyser" primitive. This way it only updates when you change the parameters. Isn't that what you really needed in the first place?

Re: Show a single wave cycle in the Scope

PostPosted: Fri Dec 21, 2012 4:29 pm
by trogluddite
If the wave is being made using a wavetable oscillator (as it is inside the stock additive oscillator), even that should not be necessary - you can simply draw a graph of the float array that is fed into the 'Wavetable' primitive, which by definition will always be a single cycle with a fixed number of data points.