Oric computers >> Announcing: MIDI/Karaoke program for the Oric

by Euphoric » Thu, 02 Dec 2004 19:21:05 GMT

Hello all fellow Oricians, this is just to say you only have 3 weeks left if
you

want to build your midi interface or modify your Telestrat to be able to

invite your friends to Oric Karaoke evenings !

The software is available at http://oric.free.fr/DISKS/karaoke.zip

Attached below is the description file,



Cheers,



Fabrice





-----------------------------------------

IMPORTANT NOTICE:

This program requires a hardware MIDI interface on your Atmos or Telestrat.

Oric emulators don't currently emulate MIDI interfaces, so this program is

only intended for real Oric. If you do a small modification of your
Telestrat

(see CEO-MAG #176, Dec 2004), or build a MIDI interface for your Atmos (see

for example http://www.teaser.fr/~amajorel/oricmidi ), and have a MIDI
device

(synthesizer or expander) connected to your interface, then you have all
what

is required to have fun and impress your friends with Oric Karaoke evenings
!

USAGE:

First load a song/midi file, then load the KARAOKE program:

playback will start immediately.

If present, lyrics are displayed at the bottom of the screen:

a single line is displayed at once, it appears one beat time in advance so
that

you can read it. Then each syllable is video-inversed, perfectly
synchronized

with the music.

You have the option to mute the melody part:

load MELODYOFF before executing KARAOKE.

This melody-off status will remain for all subsequent songs, so MELODYON

enables the melody part again.

The KARAOKE program can be called from another program: for example, you can

write your own small BASIC program to play a sequence of Midi files.

However, be sure not to exceed 256 bytes for your BASIC program, and do a

HIMEM#600 to prevent corruption of the Midi files. Read the end of this file

to learn how to transfer Midi files to your Oric.



SPECIFICATIONS:

- supports SMF format (Standard Midi File) type 0 and 1

- up to 24 simultaneous tracks, 16 MIDI channels

- supports all MIDI messages :

channel (voice & mode), system (common, real-time, exclusive)

- special display routine with enhanced 5x11 font for readibility

- support for Latin-1 text (ISO8859-1), including all accentuated letters

LIMITATIONS:

- a single MIDI/Karaoke file can not exceed 43.5 KB.

If you have a too large file, have a look at the midi_extract program I'm

providing with this package.

- only a few meta-events are processed (the others are skipped):

Text ($01), End of track ($2F), Set tempo ($51).

- Text meta events are only processed if in track #3:

titles are displayed on the top of the screen, lyrics at the bottom.

- some symbols of the characters set have been replaced in order to display

133 international characters, this should not be a problem as lyrics don't

use them.





VERSION HISTORY:

* Version 1:

- delta-times limited to 2 bytes (14 bits), instead of 28 bits.

- lyrics displayed one syllable at a time, not very practical...

- ASCII charset with conversion of a few french accentuated letters from
both

the IBM PC charset, and the ISO8859-1 set.

* Version 2:

- delta-times limited to 16 bits

- video-inversion of the syllables

- each line of lyrics is displayed when the last syllable of the previous
line

has just been video-inversed (somewhat confusing because you don't see it)

- titles are displayed

* Version 3:

- delta-times still limited to 16 bits

- added a filter for MIDI messages sent to melody channel #4

- new special display routine with conversion from the ISO8859-1 charset to
a

specially defined set, with a separate top part of lowercase characters

requiring to combine characters on two successive lines.

- lyrics lines are now displayed at the exact time-point between the last

syllable of the previous and the first syllable of the new line (still

somewhat confusing for the singer)

* Version 4:

- delta-times are now limited to 21 bits, this should be way enough

- lyrics lines now appear one beat time before the start of the first
syllable,

this seems rather convenient

MEMORY MAP:

0000-00FF: variables of the program (in the txtbuf area, so direct commands

after KARAOKE will be lost)

0100-01FF: variables of the program that couldn't find a place in page 0

0200-02FF: variables for the BASIC interpreter

0300-03FF: I/O area

0400-04FF: disk interface routines

0500-05FF: room for a small BASIC program

0600-B3FF: midi file

B400-B4FF: initialization routines of the Karaoke program, overridden by the

serial transmission buffer

B500-B7FF: special character set

B800-BB7F: karaoke program

BB80-BFDF: screen memory

BFE0-BFFF: reserved for future versions

C000-FFFF: rom 1.1 / Sedoric in overlay ram



ASSEMBLING THE KARAOKE PROGRAM FOR A DIFFERENT MIDI INTERFACE:

The program is written for a 6551 ACIA located at address $031C (like on the

Telestrat). If your 6551 ACIA is located at a different address, you have to

change the ACIA definition at the beginning of the source file and assemble

the file again with osdk\bin\xa.



HOW TO TRANSFER MIDI/KAR FILES TO THE ORIC:



Midi files have to be loaded at address $0600 (1536 decimal), and can extend

up to $B3FF, so if the file is smaller or equal to 43.5 KBytes (44544
bytes),

if fits in Oric memory.

You can use the OSDK Header program to add a tape header to that MIDI file,

like this:

osdk\bin\header -a0 MyMusic.mid MyMusic.tap $0600

Then use the tap2dsk tool to transfer this tape image to a disk image.

If you have several files you want to put on a single disk image, first

catenate all the tape images:

copy /b MyMusic.tap MySong.tap HisSong.tap HerSong.tap /b AllSongs.tap

If you fetch Midi files from the Internet, you might find bigger-than-44544

files. I've included a (not so) quick (but really) dirty program to let you

extract all the events in a given time range, so you can use it to either

extract a single smaller-than-44544-bytes chunk, or split the original file

in several chunks. First locate the time point at which you would like to
cut

the file (by playing it on a PC platform for example), and then use the

midi-extract program with the given time interval (in seconds).

E.g:

midi_extract LongFile.mid 0 312.5 FirstPart.mid

0123456789012345678901234567890123456789012345678901234567890123456789012345
6789

This will create a new file named FirstPart.mid, containing the midi events

of LongFile.mid between time 0 and time 312.5, ie 5'12"5.

Check that FirstPart.mid is smaller than 44544 bytes.

Now if you want a file with the remaining data, you can do:

midi_extract LongFile.mid 312.5 9999 SecndPart.mid

So, on the Oric, you will be able to play the two files by writing a small

Basic program like:

10 FIRSTPART:KARAOKE

20 SECNDPART:KARAOKE

A final advice: cut long files at appropriate time points, like during a
long

silence, or a long steady sound (ie. when no midi events occur).



Happy singing :-)

Fabrice