Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 04:24:04 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: Help with freq( command -  (Read 307 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
goodegg610
LV0 Newcomer (Next: 5)

Offline Offline

Last Login: 25 June, 2012, 05:30:39
Date Registered: 15 April, 2012, 18:18:37
Posts: 4

Topic starter
Total Post Ratings: 0

View Profile
« on: 17 April, 2012, 02:18:47 »
0

How does the frequency command work? If we wanted to play a C for a period of time, what would you put in and why?
Logged
Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 06 May, 2013, 16:01:45
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #1 on: 17 April, 2012, 02:50:44 »
0

I believe it works like Freq(wavelength,period).
And it uses to produce sound.
EDIT: Freq(314,10000) produces A3 note (I think)
« Last Edit: 17 April, 2012, 02:53:06 by TBO_Yeong » Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
linuxgeek96
LV3 Member (Next: 100)
***
Offline Offline

Last Login: 16 May, 2013, 23:05:36
Date Registered: 17 October, 2011, 18:15:24
Location: WLHS
Posts: 96


Total Post Ratings: +3

View Profile WWW
« Reply #2 on: 17 April, 2012, 02:55:07 »
0

Freq(1.29,1000)
Logged

Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 06 May, 2013, 16:01:45
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #3 on: 17 April, 2012, 03:38:20 »
0

Can freq( take decimal value?
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
leafy
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: 17 May, 2013, 00:26:27
Date Registered: 26 December, 2010, 05:27:03
Location: the ninth circle of hell
Posts: 1545


Total Post Ratings: +371

View Profile WWW
« Reply #4 on: 17 April, 2012, 04:44:08 »
0

I'm assuming no, since Axe doesn't work natively with decimals. Also, for smaller questions like these maybe you want to post them in the Axe Q&A thread here?
« Last Edit: 17 April, 2012, 04:44:29 by leafy » Logged

In-progress: Blastlabs, TMJO, qb?, VVVVVV?
Finished: Tag, Tap, MFQT, Nyan
Dead: Graviter
Builderboy
Physics Guru
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Today at 03:28:01
Date Registered: 20 April, 2009, 00:28:53
Location: Ravenholm
Posts: 5642


Total Post Ratings: +589

View Profile
« Reply #5 on: 17 April, 2012, 05:00:13 »
0

Leafy you silly, Axe supports converting decimal numbers like 1.29 into 8x8 format Cheesy


1
INT.DEC The non-integer decimal number as an 8.8 fixed point number. Maximum 3 decimal places allowed.
Logged

Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 01:30:08
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #6 on: 17 April, 2012, 05:41:39 »
0

The Freq() command takes two arguments: wavelength and time. TBO_Yeong and linuxgeek96, I'm not sure where you got your wavelength numbers from, but neither of them appear to be correct. The approximate value that I got was 487, using this formula for the wavelength argument with middle C's frequency, 261.63Hz:

Wavelength argument = (6000000/frequency - 62)/47



Now, to deal with the time argument. The formula for this is a little more complex, since it doesn't have an explicit form, only implicit:

Desired duration = (47*time argument + 48*floor(time argument/wavelength argument) + 71)/6000000

However, if we give floor(time argument/wavelength argument) an approximate constant value instead (I'll give it about 50), we can get an explicit form:

Time argument = (6000000/desired duration - 2500)/47

If we wanted a note length of 1/4 of a second, this would give us a time argument of approximately 31900.



Putting it all together, to play middle C for about 1/4 of a second, you would use the following code: Freq(487,31900).
« Last Edit: 17 April, 2012, 05:42:50 by Runer112 » Logged
Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 06 May, 2013, 16:01:45
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #7 on: 18 April, 2012, 04:12:29 »
0

Oops. What I meant was A2, not A3. XP

Also, for wavelength, here: http://www.phy.mtu.edu/~suits/notefreqs.html

It works. Cheesy
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.479 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.