MIDI play for Oric.

This forum is about audio tools, including samplers, sound trackers, sound chip editors, how to do sound effects, etc...
User avatar
ibisum
Squad Leader
Posts: 872
Joined: Fri Apr 03, 2009 8:56 am

Re: MIDI play for Oric.

Post by ibisum » Sat Jan 11, 2014 9:00 pm

I don't want to make standard MIDI-files sound great on the Oric. I want the Oric just to have working MIDI so it can be used as a synthesizer beyond playing the MIDI SMF 1.0 format, or XG, or GM, or whatever.

If it helps, I think MIDI i/o could definitely get some multiplayer gaming action happening! :)

User avatar
peacer
Flight Lieutenant
Posts: 351
Joined: Wed Jun 09, 2010 9:23 pm
Location: Turkey
Contact:

Re: MIDI play for Oric.

Post by peacer » Sat Jan 11, 2014 10:19 pm

Ok, I do admire all the demos using atari st music and i would be happy if I can do such conversions from atari too..

I can't insist to use one type of file for sure. All I want is to get a simplest way to transfer existing "cool" musics from other platforms to oric.

Midi is -as far as I know- simplest and richest source and there is a simple way to transfer it to oric which is made possible by fabrice frances and there might be automated and simpler way too if we keep on using it..

I am imaging platform games like giana sisters.. playing music tunes in the background. Unfortunately I won't be talented ever as Twilighte did to make it all by my own :)

Maybe I can't express my idea and need clearly due to my lack of language but I hope you get the meaning..

User avatar
Dbug
Site Admin
Posts: 2367
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: MIDI play for Oric.

Post by Dbug » Sun Jan 12, 2014 11:17 am

I made a small test for you:
ArcadeMusics.dsk
Bubble Bobble + Giana Sisters + Rainbow Islands
(131.5 KiB) Downloaded 265 times
Contains three musics:
- Bubble Bobble
- Giana Sisters
- Rainbow Islands

You can see the size of the music files on the floppy (from 3 to 6 kilobytes, some musics are much bigger than that), on top of that you have to add the 3584 bytes of temporary buffer depacking used by the player, and the 512 bytes used by the player itself.

When doing BASIC or using the ROM there's not much choice, all this must be in the main memory and protected by a HIMEM instruction, when not using the ROM then it's possible to have all that in the Overlay memory so you keep all the rest of the ram for yourself.

Here is the source code of the BASIC program:

Code: Select all

10 REM Simple music player:
20 REM - Music files are loaded in $7600
30 REM - Register buffer in $6800
40 REM - Player binary code in $6500
50 REM Oric 1 compatible version
60 REM
70 HIMEM #6000 
80 TEXT:PAPER4:INK6:CLS
90 GOSUB 1000
100 PRINT "Loading music player"
110 LOAD"MYMPLAYER.BIN"
120 PRINT"Choix musique: 1/2/3 Epace:Quitte"
130 GET A$
140 IF A$="1" OR A$="2" OR A$="3" THEN GOTO 200
145 IF A$=" " THEN CALL#6503:TEXT:END
150 GOTO 120
160 REM
170 REM Loading music
180 REM
200 PRINT "Loading "+A$
210 LOAD"MUSIC"+A$+".BIN"
200 PRINT "Currently playing music "+A$
220 CALL#6500
230 PRINT"Press a key to continue"
240  GET A$
250 CALL#6503
270 GOTO 120
1000 REM
1001 REM MENU
1002 REM
1010 PRINT"   WELCOME TO THE ORIC "
1020 PRINT"ARCADE MUSIC GREATEST HITS"
1030 PRINT
1040 PRINT"CHOOSE THE MUSIC:"
1050 PRINT"1-Bubble Bobble"
1060 PRINT"2-Great Giana Sisters"
1070 PRINT"3-Rainbow Islands"
1500 RETURN

User avatar
peacer
Flight Lieutenant
Posts: 351
Joined: Wed Jun 09, 2010 9:23 pm
Location: Turkey
Contact:

Re: MIDI play for Oric.

Post by peacer » Sun Jan 12, 2014 4:20 pm

Now that's great ! Thank you :)

This is exactly doing what I wanted.

So, how can we transfer such music data to oric? Is there a special operation to do or just adding oric header is enough?

User avatar
Dbug
Site Admin
Posts: 2367
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: MIDI play for Oric.

Post by Dbug » Sun Jan 12, 2014 9:18 pm

peacer wrote:Now that's great ! Thank you :)
This is exactly doing what I wanted.
So, how can we transfer such music data to oric? Is there a special operation to do or just adding oric header is enough?
It's slightly more complicated than that, and there are still more phases than I wish they were, but I'm in the process of simplifying it all.

There's the complete source code available here: http://miniserve.defence-force.org/svn/ ... ym_player/

One important parameter: This whole project is dependent on all the changes recently made in the OSDK (recently like 'during the christmas break') and there's no official release of the OSDK with these changes... BUT all the changes are also on the SVN depot at: http://miniserve.defence-force.org/svn/ ... sdk/_final_/

So if you get this folder and map your OSDK env variable to it, you can use it as a normal OSDK, it's what I have so I eat my own food.

Basically you need to use YM2MYM.EXE to convert the YM musics to the MYM format, then yes you can just add a header and load them wherever you want (as long as the music player knows where they are loaded of course).

User avatar
peacer
Flight Lieutenant
Posts: 351
Joined: Wed Jun 09, 2010 9:23 pm
Location: Turkey
Contact:

Re: MIDI play for Oric.

Post by peacer » Sun Jan 12, 2014 10:00 pm

I am mostly focused on "I'm in the process of simplifying it all." sentence :)

Thank you again.

User avatar
Dbug
Site Admin
Posts: 2367
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: MIDI play for Oric.

Post by Dbug » Mon Jan 13, 2014 9:32 pm

peacer wrote:I am mostly focused on "I'm in the process of simplifying it all." sentence :)
Thank you again.
I'm about to submit the simplification.
So basically last week in order to use an Atari ST music on the Oric you had to:

* Find the song you want in the STSOUND archive
* Rename the file from .YM to .LHA
* Extract the content of the .LHA file to get the other .BIN or .YM hidden inside (generally with a name like SONG_0362.BIN)
* Call Ym2Mym.exe to convert this file to a MYM file
* Call Header.exe to add a tape header
* Call TapTap.exe to modify the header with a name that will make Tap2Dsk happy

The new process (requires Ym2Mym.exe version 1.2) is:
* Find the song you want in the STSOUND archive
* Call Ym2Mym.exe to convert this song file to a TAP file with the correct header with valid address and name

Here is what I used to generate the musics used in the arcade music demo:

Code: Select all

%OSDK%\bin\ym2mym -h1 "data\Bubble Bobble 1.ym" build\BubbleBobble.tap              $7600 "Music1"
%OSDK%\bin\ym2mym -h1 "data\Great Giana Sisters 1 - title.ym" build\Giana-Title.tap $7600 "Music2"
%OSDK%\bin\ym2mym -h1 "data\Rainbow Island  1.ym" build\RainbowIsland.tap           $7600 "Music3"
%OSDK%\bin\ym2mym -h1 "data\Pacmania 1.ym" build\PacMania-1.tap                     $7600 "Music4"
%OSDK%\bin\ym2mym -h1 "data\Tetris title.ym" build\Tetris.tap                       $7600 "Music5"
%OSDK%\bin\ym2mym -h1 "data\Speedball 1.ym" build\SpeedBall.tap                     $7600 "Music6"
%OSDK%\bin\ym2mym -h1 "data\Nebulus.ym" build\Nebulus.tap                           $7600 "Music7"
Can't think of something simpler on that side, except you asking to somebody else to do your work for you :)

User avatar
peacer
Flight Lieutenant
Posts: 351
Joined: Wed Jun 09, 2010 9:23 pm
Location: Turkey
Contact:

Re: MIDI play for Oric.

Post by peacer » Tue Jan 14, 2014 3:00 pm

That would certainly help :) Thank you and looking forward to your new tool :)

User avatar
Dbug
Site Admin
Posts: 2367
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: MIDI play for Oric.

Post by Dbug » Tue Jan 14, 2014 8:38 pm

New version, this time with 11 musics (I added Outrun, Commando, Ghostbusters and Supercars) and with Rainbow Island fixed.
ArcadeMusicDemo.dsk
New version, with 11 musics
(175.25 KiB) Downloaded 252 times
The problem with Rainbow Islands was caused by a bug in the converter, which is fixed, so please use only version 1.4 or later of Ym2Mym.

User avatar
peacer
Flight Lieutenant
Posts: 351
Joined: Wed Jun 09, 2010 9:23 pm
Location: Turkey
Contact:

Re: MIDI play for Oric.

Post by peacer » Tue Jan 14, 2014 8:57 pm

Excellent works !

User avatar
Chema
Game master
Posts: 2068
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: MIDI play for Oric.

Post by Chema » Tue Jan 14, 2014 8:59 pm

This is fantastic! I loved listening to those tunes (I really always loved the Outrun theme).

I am not really convinced that in-game music is really a good idea. At least I always end up disabling it. You enjoy it the first time you play, but after a while... However for intros, specific events, configuration screens, etc. it is indeed great!

So I am not sure if I went the wrong way trying to create my own player. Dbug, can you tell me the average size of the tunes and the player, please?

I also suck at creating (or transcribing) music, so although Wave is indeed incredible, it was a terrible experience to do even the 1337 tune! And my small demo of my player was also a tough job, even if it is still full of glitches.

User avatar
Dbug
Site Admin
Posts: 2367
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: MIDI play for Oric.

Post by Dbug » Tue Jan 14, 2014 9:39 pm

Chema wrote:This is fantastic! I loved listening to those tunes (I really always loved the Outrun theme).
I am not really convinced that in-game music is really a good idea. At least I always end up disabling it. You enjoy it the first time you play, but after a while... However for intros, specific events, configuration screens, etc. it is indeed great!
Really depends of the games, but for many yes I agree :)
Chema wrote:So I am not sure if I went the wrong way trying to create my own player. Dbug, can you tell me the average size of the tunes and the player, please?
Well, that's the main problem, the MYM format is not particularly compact. On Amstrad they have switched to AYC which is an alternative way of compressing YM differently and which apparently is more efficient and requires less memory.

Right now it's very dependent of the musics, the style of the musician, the type of instruments, etc...

So in the case of this small Arcade Music demo, the play is 681 bytes long (it's larger than normal because that one is compatible with Atmos, Oric 1, and BASIC) a default one that do not use the ROM at all is less than 512 bytes.

Then there's the musics, sorted by size:
* BubbleBobble.tap 2 092
* Tetris.tap 2 775
* Giana-Title.tap 3 371
* Nebulus.tap 4 312
* RainbowIsland.tap 4 932
* PacMania-1.tap 7 623
* SpeedBall.tap 10 030
* Supercars.tap 11 332
* Commando.tap 12 880
* Ghostbusters.tap 13 179
* Outrun.tap 13 508
* IcePalace.tap 18 935

And on top of that you need to add 3584 bytes of buffer for the decompression (14 registers * 256 bytes).

So for small jingles no problem, if you have the overlay ram no problem either, for long musics and tight memory, need to investigate other packing methods.

Chema wrote:I also suck at creating (or transcribing) music, so although Wave is indeed incredible, it was a terrible experience to do even the 1337 tune! And my small demo of my player was also a tough job, even if it is still full of glitches.
It's hard indeed :)
Imo the best solution would be to make an Oric player for one of the most commonly AY trackers:
* Maxymizer
* Vortex Tracker
* Arkos Tracker

User avatar
iss
Flight Lieutenant
Posts: 496
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: MIDI play for Oric.

Post by iss » Tue Jan 14, 2014 10:01 pm

Great tunes and it's really fun listening!

Now back to topic "MIDI play for Oric" :).

Here you can find some midi files converted to AY register/values, converted to assembler sources:
midi-tests.zip
(39.88 KiB) Downloaded 268 times
Here are sources of midi player for Oric/Atmos:
midi-player.zip
(2.46 KiB) Downloaded 244 times
To create TAP file, simply compile sources plus one of the samples i.e. main.c + ay.S + irq.S + test.S, add tap header
and enjoy in emulator!

And here are the converters:
midi-tools.zip
(12.39 KiB) Downloaded 240 times
1. midi2ay.exe - original link at http://www.worldofspectrum.org/utilities.html.
Unfortunately no sources. Usage:
midi2ay -out test.mid
This will produce file: test.out
2. out2asm.c - convert above test.out to assembler source (You have to compile out2asm.c for your platform. It's almost ANSI C so no problems are expected. If needed I can provide executables for Linux and Windows). Usage:
out2asm test.out test.S

Happy MIDI-listening :)

(In player sources some lines are borrowed from mym_player. Thanks, Dbug ! ;))

User avatar
barnsey123
Flight Lieutenant
Posts: 379
Joined: Fri Mar 18, 2011 10:04 am
Location: Birmingham

Re: MIDI play for Oric.

Post by barnsey123 » Wed Jan 15, 2014 10:42 am

Dbug wrote:New version, this time with 11 musics (I added Outrun, Commando, Ghostbusters and Supercars) and with Rainbow Island fixed.
This made me smile... :D :D :D

Agree that they sound muuuuuch better than most of the midi tracks.

I suppose it's cool that we CAN play MIDI tracks if we want to (but they mostly sound awful and take up too much memory). Agree with ibisum that a MIDI interface for Oric would be neat and open up some possibilities (purely for the reason that we can do it...not for any practical real world purpose...maybe networking but with only 1 oric I couldn't connect it to anything!).

I've got midi keyboards, PC midi interfaces etc but it's simply a case of having all the gear and no idea! I can't actually use any of this stuff properly.
I can compose music in my head...just not on any real instrument or even software. I can't use trackers, sequences or similar. I'm anxiously awaiting the time when we'll have mind-reading devices that will allow the composition of music direct to computers...probably still some way off yet... :(

User avatar
peacer
Flight Lieutenant
Posts: 351
Joined: Wed Jun 09, 2010 9:23 pm
Location: Turkey
Contact:

Re: MIDI play for Oric.

Post by peacer » Sun Feb 09, 2014 12:24 pm

So.. Where can I find this "YM2MYM.EXE" tool?

Even google gave this topic only and one C source on OSDK :)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests