Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Raylin on June 28, 2010, 07:36:06 pm

Title: BGM in Axe?
Post by: Raylin on June 28, 2010, 07:36:06 pm
Is it possible to play BGM music in Axe if the following were true:

*If there was an AppVar that acted like a filetype and the bytes for the sound frequencies were stored inside.
*If it was played as frequently as an interrupt.

Comment and tell me what you think.
Title: Re: BGM in Axe?
Post by: Quigibo on June 28, 2010, 09:15:10 pm
Funny you mention that.  I was playing around with that as an idea for my example program, but I realized I need my note constants becasue its too tedious to type in the note values manually.  There is something you have to realize however; The interrupts trigger more rapidly then you might think.  According to WikiTI, at their slowest speed, the interrupts trigger around 100 times a second and at the fastest speed its closer to 1000 times a second!  Your typical 16th note is 8 beats per second so you can see the problem that arises.

What you have to do is have the interrupt use a decreasing counter which only plays a note when the counter reaches 0.  Then, you have to reset the timer to a next wait time, which should be part of your note data.  This strategy works very well, I was able to get BGM into my games with no appreciable slow down at all.  So to answer your question, yes, it is very possible, I've done it.
Title: Re: BGM in Axe?
Post by: Raylin on June 28, 2010, 09:47:31 pm
Also, is it possible to play multiple notes at once? o.o
Title: Re: BGM in Axe?
Post by: FinaleTI on June 28, 2010, 09:54:13 pm
From what he posted, you could give the illusion of it by having barely any cycles between the notes, but truly playing multiple notes... I'm not sure if that's possible.
Title: Re: BGM in Axe?
Post by: DJ Omnimaga on June 28, 2010, 10:45:42 pm
I tried in Wabbitemu and it sounded crappy, but idk about on-calc. I heard it wasn't too great either, though. It would also be nice if someone made a music maker program to quickly produce VGM data to insert in your program then you just need to code a routine that'll play through the data using Freq()/SinReg() in an interrupt. 
Title: Re: BGM in Axe?
Post by: quasi_Phthalo on June 28, 2010, 11:17:45 pm
what would happen if, instead of this:
Code: [Select]
set output high
wait 2 ms
set output low
wait 2 ms
repeat
you did this:
Code: [Select]
set output high
wait 1 ms
set output low
wait 3 ms
repeat

what kind of sound would the second one make?
Title: Re: BGM in Axe?
Post by: DJ Omnimaga on June 28, 2010, 11:22:00 pm
I am not too sure. I guess the only real way to check is to try.

One thing people can do if chords are impossible is to just alternate between notes repeatedly at a fast but slow enough to hear each notes separately well. This will give a Commodore 64 style sound, to a certain extent.
Title: Re: BGM in Axe?
Post by: willrandship on June 29, 2010, 01:01:06 am
Did metroid use something like this in the NES games? Sounds similar! That would be cool: a metroid clone that has the same type of music.

The nes had 2-track music, I believe, which is why zelda 1 sounds worse when your hearts are low.
Title: Re: BGM in Axe?
Post by: Raylin on June 29, 2010, 07:36:30 am
So, would you say that if you alternate the frequencies fast enough, you can give the illusion of 2-track music?

Also, can someone link me that note chart that someone gave SirCmpwn with the frequencies and what not?
Title: Re: BGM in Axe?
Post by: DJ Omnimaga on June 29, 2010, 11:16:26 am
If it didn't sounded terrible, then yes.

As for a note chart, do you mean this? http://www.phy.mtu.edu/~suits/notefreqs.html
Title: Re: BGM in Axe?
Post by: Raylin on June 29, 2010, 11:30:45 am
Yes! :D
Title: Re: BGM in Axe?
Post by: Quigibo on June 30, 2010, 07:07:13 pm
Thought I'd post this in this topic since its related.  I rewrote the Freq() command so that it is actually a REAL square wave now and not that blippy thing it was.  It is now significantly louder and higher quality and surprisingly its the same size as the original routine.  I uploaded both the old and new executable of the AxeSound test program so that you can hear the difference.
Title: Re: BGM in Axe?
Post by: DJ Omnimaga on June 30, 2010, 11:16:07 pm
Oooh nice! I will brb then test this ASAP!

EDIT: WOW nice, now it sounds exactly like in TI-Jukebox, CalcMOD and most other calc music players. I can't wait to test with new Axe version. I wonder if chords could now be possible...
Title: Re: BGM in Axe?
Post by: ztrumpet on July 01, 2010, 02:04:54 pm
Wow, that sound sounds great!  I can't wait for 0.3.2, coming out today! ;D