Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Show a single wave cycle in the Scope

DSP related issues, mathematics, processing and techniques

Show a single wave cycle in the Scope

Postby qqwy » Tue Dec 11, 2012 10:40 pm

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
Attachments
OneCycleScopeTest.fsm
(13.6 KiB) Downloaded 1549 times
qqwy
 
Posts: 6
Joined: Fri Jun 29, 2012 9:38 pm

Re: Show a single wave cycle in the Scope

Postby unkargherth » Thu Dec 13, 2012 1:40 am

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)
Free your memory, .. with a free(). Like a pointer
Cast a pointer into an integer and it becomes the integer...
Cast a pointer into a struct and it becomes the struct...
A pointer can overflow... or can crash...
Be a pointer my friend
unkargherth
 
Posts: 29
Joined: Fri Apr 08, 2005 9:46 pm

Re: Show a single wave cycle in the Scope

Postby digitalwhitebyte » Thu Dec 13, 2012 8:03 am

I use this system:
Sample Rate / (the buffer size of your soundcard) = Frequency for your oscillator.
User avatar
digitalwhitebyte
 
Posts: 106
Joined: Sat Jul 31, 2010 10:20 am

Re: Show a single wave cycle in the Scope

Postby qqwy » Thu Dec 13, 2012 11:45 am

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...
Attachments
OScSampleTest.fsm
(20.5 KiB) Downloaded 1573 times
qqwy
 
Posts: 6
Joined: Fri Jun 29, 2012 9:38 pm

Re: Show a single wave cycle in the Scope

Postby trogluddite » Thu Dec 13, 2012 7:29 pm

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).
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Show a single wave cycle in the Scope

Postby MyCo » Thu Dec 13, 2012 10:42 pm

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 :)
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Show a single wave cycle in the Scope

Postby matti » Fri Dec 21, 2012 11:15 am

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?
matti
 
Posts: 55
Joined: Fri Sep 24, 2010 12:06 pm

Re: Show a single wave cycle in the Scope

Postby trogluddite » Fri Dec 21, 2012 4:29 pm

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.
Attachments
Additive Waveform.fsm
(16.29 KiB) Downloaded 1555 times
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK


Return to DSP

Who is online

Users browsing this forum: No registered users and 59 guests