A MP3 Background player for programs

Got a brilliant program idea? Let us know!

Moderator: MaxCoderz Staff

Post Reply
Floodkiller
Sir Posts-A-Lot
Posts: 245
Joined: Mon 14 Nov, 2005 9:47 pm
Location: Getting overwhelmed by everything
Contact:

A MP3 Background player for programs

Post by Floodkiller »

excuse me if i know absolutely nothing on how this works, because i dont, but it would be just the best thing in the world if someone could create a realsound package that would create background sound for a program. then you could have dramatic sound along with the game.

however, something inside me is telling me i am thinking of the unattainable :P
Main Projects:
Zombie Attack: 20%

Side Projects:
???-25%

Image

Staff member of Hikaru Rakuen Programming.
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

If you were to just use a asm program which you just call from a basic program, then it wouldn't be possible. And in Asm having the realsound running and a game wouldn't be that easy :P.
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

I am making stuff that runs midi sounds as the background in a game. And realsound runs at 32khz, so it might be possible, but I doubt it.
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

MIDI, again, is a specific protocol for controlling musical instruments, not the beeps our calculators can make (in the same way that the Link menu is not referred to as "an FTP client").
Unless you're outputting MIDI commands out of the link port and have connected that up to a MIDI synth... (which is actually relatively easy... now there's an idea! You could use a PIC to drive the serial MIDI hardware interface...)
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

A more useful idea, involving less soldering work, would be to write a MIDI synthesizer like the one Windows uses. A program that reads a .mid file and generates the proper sounds like a MIDI device would do.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Then you could link the MIDI port of your computer to your calculator on one data line, take the sound off the other line, and use your calculator as a MIDI device... it would probably sound better than the terrible Roland software synth that Windows comes with by default :P
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Heheh :)
My idea was more that you could then play midi files as background music for games, or in a sound player. They allow for a bit more musical diversity and splendour than just beeps :)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

The problem would be working out the best way to simulate the instruments.

Fancy synths/cards have a wavetable (recordings of instruments that are adjusted), cheap synths/cards (such as Ad Lib) would just use FM (frequency modulation - the frequency of the wave is adjusted by another wave as it is played, which can produce a variety of different sound effects). Software emulation of these instruments is quite 'expensive'.

MIDI itself covers key down (with a note number of 0 to 127, and you also specify a velocity, which controls the volume of the note), key up (note number 0 to 127) pitch wheel (allows you to bend the pitch of the note) and then a variety of different controller messages (all keys up, change patch (instrument), that sort of thing). Channel 9 is reserved for percussion.

Just taking simple FM into consideration, it should be entirely possible to write a piece of code to create the output wave from a music file then use Jim e's RealSound code to play it back.

Ultimately, I think using a standardised music chip and building a little PIC-based controller board is the best bet for TI background music.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Yes, that would be the best solution, but the community has shown a bit of reluctance to having to build hardware that involves more than connecting a few wires. That's why I'm so happy about my networking theory (see announced project); a calculator hub will be no more than a few connected wires :)

Anyway, I guess that it should even be possible to output the wave in real time, as long as you only take the keys into account, and not the instruments. But that's probably what you meant with simple FM.

But then again, if you still only have beeps (be it more complex beeps) instead of music, it's probably a better idea to use a different music format than MIDI files. Something equally dynamic but without the information that the calculator can't emulate anyway.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Well you could just get a picture or something on the screen, run Quad Player by Ben until you press a certain key or the song/clip of music ends. If someone was to inter grade Quad into their game could they have text or some kind of animation every few seconds without it sounding like it was stopped? (the music/MIDI).
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

I know it isn't real MIDI files, it's just what it sounds like.
Image
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

I really don't know how well you could manipulate wave sound. That really blocks alot of stuff.

Another thing lets not use the word mp3 anymore, its not gonna happen on this system.

When it comes to BG sound we really shouldn't try to out do the gbc. we have considerable less to work with and not alot of speed for it.

However, it is possible to have realsound quality and a game going on at the same time. I realised this not to long ago. Though I still tell every n00b that ask no. Normally link port modulation would block 99% of the cpu, but by using interrupts its possible to reclaim more the 50% of the cpu time. And on an Se calc you have 15mhz, meaning you'll still have 7.5 million+ clock ticks to work in a second. The problem is size, even 4bit is a serious memory hog, you could get like 190 seconds on, but that would fill the entire archive.

Untill beeps and boops are actually used for a decent game, i don't see wave sound happening in game, its not worth it.
Image
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

Size is one thing, but if you could have a seamless pattern of just a few bits and boops it wouldn't take up much (just one pattern over and over again, or maybe different ones randomly chosen).

Speed is another. But I think ALL games should be targeted to the TI-83+ to get a greater audience.

However, what about interrupts? ;)
[..] in the same way that the Link menu is not referred to as "an FTP client"
Ahaha ROFL.
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
User avatar
anykey
Extreme Poster
Posts: 420
Joined: Mon 31 Jan, 2005 3:36 am
Location: In the matrix
Contact:

Post by anykey »

It isn't?
No wonder my attempts at calc-based ftp are such failures. :(
I think, therefore iMac
Image
Post Reply