Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: goodegg610 on April 16, 2012, 08:18:47 pm

Title: Help with freq( command
Post by: goodegg610 on April 16, 2012, 08:18:47 pm
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?
Title: Re: Help with freq( command
Post by: Yeong on April 16, 2012, 08:50:44 pm
I believe it works like Freq(wavelength,period).
And it uses to produce sound.
EDIT: Freq(314,10000) produces A3 note (I think)
Title: Re: Help with freq( command
Post by: linuxgeek96 on April 16, 2012, 08:55:07 pm
Freq(1.29,1000)
Title: Re: Help with freq( command
Post by: Yeong on April 16, 2012, 09:38:20 pm
Can freq( take decimal value?
Title: Re: Help with freq( command
Post by: leafy on April 16, 2012, 10:44:08 pm
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? (http://ourl.ca/9165455)
Title: Re: Help with freq( command
Post by: Builderboy on April 16, 2012, 11:00:13 pm
Leafy you silly, Axe supports converting decimal numbers like 1.29 into 8x8 format :D

Code: [Select]
INT.DEC The non-integer decimal number as an 8.8 fixed point number. Maximum 3 decimal places allowed.
Title: Re: Help with freq( command
Post by: Runer112 on April 16, 2012, 11:41:39 pm
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).
Title: Re: Help with freq( command
Post by: Yeong on April 17, 2012, 10:12:29 pm
Oops. What I meant was A2, not A3. XP

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

It works. :D