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

Irregular Sine Waves

For general discussion related FlowStone

Irregular Sine Waves

Postby tulamide » Thu Oct 29, 2015 8:24 am

I wonder why there are adjustable square waves, where the center is moved around (like phase modulation of some sort)
Code: Select all
|  |  |
| |   |
|    ||


but no sine waves, adjustable in the same way? I can imagine this to be a rich sound if more than one oscillator is used.

Since time is constant in this scenario, I assume the gaps between two sample points vary according to some function, that is able to accept a varying factor. But I have no clue how to produce an oscillator from that.

Has anyone ever made something similar? Or is it just a stupid idea for reasons I don't see yet?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Irregular Sine Waves

Postby nix » Thu Oct 29, 2015 9:12 am

It is quite easy with wavetables.
Just get the 2 sine halves 0-180, 180-360 and resample them in ratio as float arrays.
'resample float array' is the one.
(edit-you will need float array append to join the 2 halves together)

This is not modulatable though really sadly.

I'm curious to write osc algos. Sine is the only one I'm stuck on,
but it can be realised by low passing a triangle.

hmm, you've got me interested in trying this somehow- so it can be swept, too
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Irregular Sine Waves

Postby martinvicanek » Thu Oct 29, 2015 8:18 pm

The equivalent to pulse width modulation of a square wave would be a synchronous phase modulation of a sine wave so that the valleys and crests get stretched (horizontally) in opposite directions, respectively. You can do that by feeding a fraction of the oscillator output back to its phase input. More variety is possible with some quadrature trickery.

Have fun. ;)
Attachments
Sine-ish.fsm
A demo of sine osc manipulations
(118.08 KiB) Downloaded 959 times
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Irregular Sine Waves

Postby tulamide » Thu Oct 29, 2015 11:04 pm

What can I say? Awesome as always, Martin!
I can already hear, just as I expected, that the sound characteristic changes distinctly. That will give some new options. I don't really understand what you mean by "quadrature trickery", but if that is something that doesn't cost you too much time, would you mind giving an example of that, too?

Oh, and what would be a good name for it? Pulse Width Modulation, or PWM, is known to the people, but would Sine Width Modulation, or SWM, really address the functionality of this? It would be more like half-cycle width modulation, or something, right?

EDIT: Oops, just read your answer again. So, "synchronous phase modulation", or SPM, would be the matching name?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Irregular Sine Waves

Postby BobF » Fri Oct 30, 2015 12:44 am

Hello gang,

Wow, now this is what I am talking about! Refferencing to "Crazy Ideas".
Cool tricks and tips stuff. Many thanks Martin, a very cool trick.

Later then, Bobf.....
BobF
 
Posts: 598
Joined: Mon Apr 20, 2015 9:54 pm

Re: Irregular Sine Waves

Postby Spogg » Fri Oct 30, 2015 9:47 am

Guys!
I spent a couple of hours on this last night, also playing around with self-phase modulation (feedback) and also using a second synchronised oscillator for the modulation source with various waveforms. I got similar results to Martin but not what I understood tulamide was asking for.
Like nix I thought he was after something like zero-crossing modulation as per my very poor sketch below.

Martin's technique is found in the DX7 and my QX7 whereby feedback around 1 oscillator and env creates a wide range of harmonic variations. Maybe tulamide could clarify what he wanted...?

Cheers

Spogg
Attachments
zero crossing modulation.png
zero crossing modulation.png (23.31 KiB) Viewed 20304 times
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Irregular Sine Waves

Postby tulamide » Fri Oct 30, 2015 10:53 am

Hey Spogg,

you are absolutely right. What you sketched is what I oringinally looked for. And I would love to see that realized. But I also have fun with Martin's demo. So, if my original thoughts can't be realized, at least some alternative is available.

My thoughts began with the simple imagination of a sine wave, whose "center point" is moved away from the center. I can replicate this behaviour with my spline class for Ruby. But I couldn't find a formula for this. (See attached fsm)

You can't just reduce/increase the radius of the two half-circles, since the whole line from the top of the first half to the bottom of the second half is influenced.

So, yes, you are right. That's what I wondered about.
Attachments
sine_center_moved.fsm
(8.8 KiB) Downloaded 918 times
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Irregular Sine Waves

Postby nix » Fri Oct 30, 2015 11:32 am

hmm-
you can't do it by decreasing the radius,
but it can be done by changing frequency.
If you could write a half cycle, the correct freq change would make the desired form.
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Irregular Sine Waves

Postby Spogg » Fri Oct 30, 2015 1:41 pm

One thing I tried last night was modulating the frequency (not phase) with a separate synchronised variable pulse width square wave oscillator.
I figured that by varying the mark/space ratio I could achieve the desired result. This kinda worked BUT the overall period changed with the m/s ratio. This is because the frequency control spent more/less time high than low as the m/s ratio deviated from 50/50. It might be possible to create some compensation for this but it would not be elegant.
Unless someone knows better...

I thought this was going to be easy when I read the OP but it ain't!

Cheers

Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Irregular Sine Waves

Postby KG_is_back » Fri Oct 30, 2015 2:22 pm

I've also tried different approach... instead of modulating frequency/phase, I distorted the ramp-osc which was then driven into a sin1(x) function. I've made 2 versions.
first one simply changed the straight ramp into two lines, intersecting at y=0.5 and x specified by mod. Problem was, the resulting oscillator was not smooth on zero crossings.
Second version, I've changed the ramp into exponential function that crosses [0,0] [mod,0.5] [1,1]. The resulting oscillator was smooth in the center, but the transition from one period to next was not smooth.
Lastly I tried to make it smooth on both zero crossings, but after about an hour I rage-quitted and destroyed versions 1 and 2 in the process... :shock:
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Next

Return to General

Who is online

Users browsing this forum: No registered users and 55 guests