Function Question: (sqwv)

 
Post new topic   Reply to topic    SoundSpectrum Forums Forum Index :: G-Force General Discussion
View previous topic :: View next topic  
Author Message
JayPro



Joined: 01 May 2004
Posts: 720
Location: Huntington Station, Long Island, New York

PostPosted: Fri Oct 05, 2018 8:44 pm    Post subject: Function Question: (sqwv) Reply with quote

What does this function do exactly??

Since I suck at mathematics in general, I could use some help extrapolating the subjectively perceived gibberish required to explain the concept to what I can actually see it doing.


Thanks.
_________________
"Some people look at things as they are and ask why. I look at things that never have been and ask why not."
Back to top
View user's profile Send private message Send e-mail
jerohm
Senior Member


Joined: 09 Jan 2009
Posts: 394

PostPosted: Sat Oct 06, 2018 6:35 am    Post subject: Reply with quote

Code:
Aspc=1             // so it is visible in frame
ConB=1

// sqwv(x) :
// return 1 if abs(X) <= 1.0, otherwise 0
//  or MORE ACCURATELY a square PULSE [-1 ... 1]

A0="(2*s-1)*2"         // [-2 ... 2], inclusive

X0="A0"
Y0="sqwv(A0)/2"       // divided by 2 so it is visible in frame

Vers=500



Code:
Aspc=1
ConB=1

// REAL(static) square wave

A0="(2*s-1)"    // [-1 ... 1], inclusive
A1=10           // Pulse Count
A2="A0*Pi * A1" // Cycles

X0="A0"
Y0="(pos(sign(sin(A2))) -.5)/A1"   // centered about Y axis

Vers=500



Code:
Aspc=1
ConB=1

// REAL(moving) square wave

A0="(2*s-1)"    // [-1 ... 1], inclusive
A1=2            // Pulse Count
A2="A0*Pi * A1" // Cycles

X0="A0"
Y0="(pos(sign(sin(A2 - A1*t))) -.5)/A1"   // centered about Y axis

Vers=500


are we good??
Back to top
View user's profile Send private message
ShohS



Joined: 06 Apr 2018
Posts: 16
Location: no one must know shhhh

PostPosted: Tue Oct 09, 2018 8:21 am    Post subject: Reply with quote

I think its a square wave that doesn't loop
_________________
Nut
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
DanPin



Joined: 15 Mar 2016
Posts: 139
Location: Los Angeles County, California

PostPosted: Wed Oct 10, 2018 7:08 pm    Post subject: Reply with quote

ShohS wrote:
I think its a square wave that doesn't loop


Well, you're absolutely right. The abbreviation 'sqwv' can mean 'square wave'. In the Documentation, under Config Programming | Logic/Discrete it technically explains "returns 1 if |x| <= 1.0 and 0 otherwise". This should make sense to you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SoundSpectrum Forums Forum Index :: G-Force General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
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




Powered by phpBB © 2001, 2002 phpBB Group
Charcoal2 Theme © Zarron Media