electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » Clavia Nord Modular » G2 Building Blocks
sin/cos oscillator
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
ik



Joined: Jan 30, 2005
Posts: 50
Location: North Carolina
G2 patch files: 25

PostPosted: Thu Mar 10, 2005 9:11 pm    Post subject: sin/cos oscillator Reply with quote  Mark this post and the followings unread

This is to generate sin(x) and cos(x) signals, made from basic "math" modules. Basically, it is a 2 pole filter with Q=1, forced to self oscillate.
See oscilloscope signal, there is a 90 degree phase shift between the two outputs to obtain sin(x) and cos(x) signals.
("blue" and "red" versions added.)
ik.


sin_cos OSC.jpg
 Description:
oscilloscope
 Filesize:  65.35 KB
 Viewed:  8941 Time(s)

sin_cos OSC.jpg



sine osc.pch2
 Description:
simple structure to make sin(x) and cos(x) signals....

Download
 Filename:  sine osc.pch2
 Filesize:  1.54 KB
 Downloaded:  1386 Time(s)

Back to top
View user's profile Send private message
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 18197
Location: Durham, NC
Audio files: 212
G2 patch files: 60

PostPosted: Fri Mar 11, 2005 3:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

Maybe this has been posted before, but where is a good place one can read up on the theory on how these "math" patches work?
_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
ik



Joined: Jan 30, 2005
Posts: 50
Location: North Carolina
G2 patch files: 25

PostPosted: Sat Mar 12, 2005 12:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
...where is a good place one can read up on the theory on how these "math" patches work?...


MusicDSP has lots of code (many way over my head Embarassed ):
http://musicdsp.org/
While the G2 was not particularly designed for this, it is an interesting area to explore ...
I usually try port the C++ code first into SynC Modular, (some already there!) since it is easier to explore there, and when/if it's working, I port it to the G2 (if I can ... Wink ).

As a very simple example, I found this code at MusicDSP:

===============================================
"Cheap pseudo-sinusoidal lfo

References : Posted by fumminger[AT]umminger[DOT]com

Notes :
Although the code is written in standard C++, this algorithm is really better suited for dsps where one can take advantage of multiply-accumulate instructions and where the required phase accumulator can be easily implemented by masking a counter.

It provides a pretty cheap roughly sinusoidal waveform that is good enough for an lfo.

Code :
// x should be between -1.0 and 1.0
inline
double pseudo_sine(double x)
{
// Compute 2*(x^2-1.0)^2-1.0
x *= x;
x -= 1.0;
x *= x;
// The following lines modify the range to lie between -1.0 and 1.0.
// If a range of between 0.0 and 1.0 is acceptable or preferable
// (as in a modulated delay line) then you can save some cycles.
x *= 2.0;
x -= 1.0;
}
"
===============================================
Now, the SynC port looks like this (see image):

then

the G2 port (see attached): ....
ik.


pseudo-sine.jpg
 Description:
2*(x^2-1)^2-1 in SynC Modular
 Filesize:  30.09 KB
 Viewed:  8855 Time(s)

pseudo-sine.jpg



pseudo-sine.pch2
 Description:
2*(x^2-1)^2-1 for the G2.

Download
 Filename:  pseudo-sine.pch2
 Filesize:  1.16 KB
 Downloaded:  1405 Time(s)

Back to top
View user's profile Send private message
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 18197
Location: Durham, NC
Audio files: 212
G2 patch files: 60

PostPosted: Sat Mar 12, 2005 12:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks, IJ, that makes this much easier to understand. (sorta Laughing )

It might be nice to put this information in the posts and/or in the textpad.

_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Clavia Nord Modular » G2 Building Blocks
Jump to:  

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


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use