[TI-83+ BASIC] Non-MIDI music...is it possible in BASIC?

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
User avatar
Delnar_Ersike
Sir Posts-A-Lot
Posts: 153
Joined: Mon 22 Jan, 2007 3:05 am
Location: UNATCO Headquarters

[TI-83+ BASIC] Non-MIDI music...is it possible in BASIC?

Post by Delnar_Ersike »

This has been plaguing me for months now: is it possible to program non-MIDI music for a TI-83+/84+ family calculator in BASIC? If it isn't, then my second question is: Is it possible to play two MIDI sounds in BASIC on a calculator VERY fast to achieve the effect of two notes playing at once?
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

Not unless you write an App that can be called from a basic program.

Yes, I've done it. I made a piano program that supported two notes being played at once.
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

If you can show me how to play MIDI on the calculator, BASIC or otherwise, I'd be interested... ;)

I remember saying to tr1p1ea that he could nick the routines from QuadPlayer if he wanted to add tone generation to xLIB. QuadPlayer plays two notes at once by controlling both lines of the link port independently, so you don't have to resort to tricks for two notes. For four notes it runs two sets of pairs of timers, and picks a different one of these sets every other update to 'interlace' four-channel sound from two sets of two-channel sound.

A potential problem with BASIC sound is that any activity on the link port bothers the calculator (it appears to think something is being sent to it), so in a BASIC program it might decide to start trying to receive data. You can see this with most sound programs, in that when you exit the shell the homescreen "freezes" for a couple of seconds.
User avatar
Delnar_Ersike
Sir Posts-A-Lot
Posts: 153
Joined: Mon 22 Jan, 2007 3:05 am
Location: UNATCO Headquarters

Post by Delnar_Ersike »

Well, I've worked with a funny combination of Omnicalc and xLib, and that is how I achieved the sound stuff. Omnicalc clears the parser hook detection of xLib, but xLib does not. This means if I enter Omnicalc, it will clear the xLib hook detection, but when I enable xLib, the Omnicalc parser hooks stay :twisted: . From here, I can put xLib's functions into my programs and, at the same time, put in Omnicalc's "real(31"s.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Oh, if Omnicalc can play sound then my last point is irrelevant.

Take a look at Wav Player 83+ - it might do what you need.
User avatar
Delnar_Ersike
Sir Posts-A-Lot
Posts: 153
Joined: Mon 22 Jan, 2007 3:05 am
Location: UNATCO Headquarters

Post by Delnar_Ersike »

benryves wrote:Oh, if Omnicalc can play sound then my last point is irrelevant.

Take a look at Wav Player 83+ - it might do what you need.
Tried it before.

It is all right when you play short clips, but when you are planning to play a one-minute long soundtrack... :(
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

Running a BASIC program generally requires that you leave the OS's interrupts intact, so unless you throw it on one of their interrupts, it's not going to happen.
Image
Post Reply