Author Topic: BGM in Axe?  (Read 7610 times)

0 Members and 1 Guest are viewing this topic.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
BGM in Axe?
« 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.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: BGM in Axe?
« Reply #1 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.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: BGM in Axe?
« Reply #2 on: June 28, 2010, 09:47:31 pm »
Also, is it possible to play multiple notes at once? o.o
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: BGM in Axe?
« Reply #3 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.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BGM in Axe?
« Reply #4 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. 

Offline quasi_Phthalo

  • LV3 Member (Next: 100)
  • ***
  • Posts: 90
  • Rating: +1/-1
    • View Profile
Re: BGM in Axe?
« Reply #5 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?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BGM in Axe?
« Reply #6 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.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: BGM in Axe?
« Reply #7 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.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: BGM in Axe?
« Reply #8 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?
« Last Edit: June 29, 2010, 07:37:57 am by Raylin »
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BGM in Axe?
« Reply #9 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

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: BGM in Axe?
« Reply #10 on: June 29, 2010, 11:30:45 am »
Yes! :D
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: BGM in Axe?
« Reply #11 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.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BGM in Axe?
« Reply #12 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...
« Last Edit: June 30, 2010, 11:33:00 pm by DJ Omnimaga »

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: BGM in Axe?
« Reply #13 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