Jump to content
IGNORED

MIDI2POK -- 5200 music convertor & player


calamari

Recommended Posts

I've written a program that will convert a MIDI text file to a format easy for the 5200 to play. There are some limitations on the source midi, and it will need to be converted to a text list (see the documentation for details).

 

Also included in the ZIP is a full example, with MIDI music source, before & after modifications and after conversion, as well as a working 5200 POK player, with 5200BAS source, compiled ASM source and test binary.

 

The example song doesn't convert the best, but the other song I made that sounds better I plan on putting into my game

 

Moderator Edit: MIDI2POK is located here: http://lilly.csoft.net/~jeffryj/5200bas/5200bas.html

Link to comment
Share on other sites

Very Nice!

 

Would like to see a mode where an ASM code comes out of this utility. This ASM code can be later just included in any ASM/BAS file and just get enabled when the music is needed...

 

Also, the output can be used on NTSC consoles only? Is there a mode to select between NTSC vs. PAL?

 

Any inention to support drums in the future?

 

One thing I can tell you for sure is that I'm going to use it from now on... Any idea where can I find MIDI samples of shooting sounds, laser guns, etc. ?

 

Thanks,

O.G.

Link to comment
Share on other sites

quote
Would like to see a mode where an ASM code comes out of this utility. This ASM code can be later just included in any ASM/BAS file and just get enabled when the music is needed...  

 

The song player routine you can probably just grab out of the compiled source, then to start playback you'll need to point the VBI at the player routine and enable it. Take a look at the MUSIC.ASM file.

 

quote:

Also, the output can be used on NTSC consoles only? Is there a mode to select between NTSC vs. PAL?


 

Actually no, but that should be trivial to implement. I'll add a -pal switch . I didn't know there were many PAL 5200's anyways though.

 

quote:

Any inention to support drums in the future?


 

Not ATM. I'll need to play around with my 800xl a while to see what sound effects I can make. Right now, everything comes out as a square wave.

 

calamari

Link to comment
Share on other sites

As long as you don't use it for looping game background music. I'd hate myself if I knew that I helped make your game sound like Super Mario Bros

 

Actually, I think the lack of constant music is one of the cool things about classic games. Some games have music before a level or when you die, like Jungle Hunt or Galaxian. The only game I can think of on the 5200 that has constant music is Pitfall 2, the music is cool for a few minutes, but I can't stand playing it for long sessions.

 

calamari

Link to comment
Share on other sites

Sound comments.

 

I like the bg music of both Popeye and Donkey Kong. I can't imagine playing either with no bg music. 2-part melodies mostly comprised of bass = it works.

 

I've thought about this for Koffi; I intend to have an introductory 'theme' which will be based of Beethoven's 6th Symphony Allegro, if I can pull it off that is. It's got a good theme that I often listen to as I'm programming koffi. I've already figured out the notes so I could transcribe it myself, but I'm not sure if I can get pokey to perform well or not. OldGuru's music for castle blast has a kind of vibrato effect on the lead instrument, doesn't it? How is that done?

 

 

But in-game, I will have only sounds. I haven't begun to implement them yet. I need a good thunder/lightning crash sound. I'm not sure if I will put in a little kopter buzzing sound or not, it depends if it is annoying or good sounding. When Koffi bounces off the clouds, I want a tone to sound; but koffi can rapidly hit a cloud about 5 times a second, and I'm not sure if the sound will become annoying or not. We'll see. I'm also not sure if the fire should have a distorted quiet sound or not.

 

Inspired by NiGHTS into Dreams, I'd also love an ascending tone to play when koffi catches each raindrop in succession.

Link to comment
Share on other sites

cool! a midi2pokey converter. this sounds great BUT

 

sorry to ask this provocant question:

 

why are u inventing the wheel twice?

 

there are so many atari 8bit music routines out there which just have to be adapted to new pokey adresses...

 

i put our music routine online for atari

computers:

http://www.s-direktnet.de/homepages/k_nadj/main.html

 

(the last topic of the "techinfos")

 

unfortunatly it is optimized for our XASM

Crossassembler here are more infos for XASM:

http://www.s-direktnet.de/homepages/k_nadj/xasm.html

 

cheers hve

Link to comment
Share on other sites

this sounds great BUT

 

How do you use it? Can you write up a document explaining how to incorporate it into a program (or maybe an example program)? Is there a tool to translate MIDI songs to the format?

 

Thanks,

calamari

 

P.S. Oops, I forgot to answer your question! I wrote the music player because I didn't know about any existing routines except those premade songs. I also wanted a utility that would translate MIDI songs, because MIDI is a universal format. For example, there is a NSF (Nintendo Sound Format) to MIDI convertor, so now I can have access to NSF's as well. Really, the player was the easy part to write, using 5200BAS ... the convertor was more of a pain.

 

[ 02-12-2002: Message edited by: calamari ]

Link to comment
Share on other sites

f.e. the mpt-replay source code is not usable for straight away usage into 5200. but what you can learn is how the code is written, you can see tricks...that's it...

i have had a close look into the code and it seems you have the same difficulties like i had when i joined taquart in 1996. all the guys used strange tools & strange assemblers with "non-western style" so i could not even use their code...

 

but after realising that i leeched any tool from them and so it was no problem at all...

 

in the replay routine you should download the xasm package and try to assemble the source on a ram-boundarie f.e. $3000.

 

the assembler uses many custom opcodes that is why you can not use it in DASM or any other "standard" 6502 assemblers...

 

of course you need also MPT-music files.

 

Moderator Edit: The homepage of the Grayscale musicians is located here: http://grayscale.scene.pl/en_index.php

Link to comment
Share on other sites

Hi guys & Girls

http://www.s-direktnet.de/homepages/k_nadj/main.html

 

i uploaded 2 of the best music composing tools for atari 8bit computers. maybe you find it usefull for your projects

 

use them in atari800 win 2.x. they are all in .atr format. try our theta music composer. you can save the music replay routine separatly as a binary file with all necessary adresses. sorry. even i can not read the polish docs. tell me your experiences with it. maybe i can catch the coder of it...

 

heaven/TQA

 

ps sorry for little spamming...

Link to comment
Share on other sites

Well Heaven, I could use a small, efficient and fast decompression routine for the 5200 with a compressor for the IBM. I have been dealing with pucrunch but have not had time to really figure out what he is doing with the code. I admittedly am nowhere near that great at ASM but the original programmer wrote a lot of self-modifying code and such.

 

All I need is a compressor that runs on the IBM (pucrunch does this) then a 5200 decompression routine I can jump to. I feed it an address and it decodes until 960 bytes are forced out. If I can write or modify a fast one with an average of 300 bytes after compression for the screens I'll be a lot further along on A2.

 

Unfortunately this has to be done first in my opinion as I don't want to get 3/4 thru and then run out of room and jump thru hoops getting everything crunched.

 

Any help would be greatly appreciated.

 

AlanD

Link to comment
Share on other sites

well... where is the difficulty? if you

post is a positive post (i understood your critics...) i could help you

as well with our FASTPACK. it is one of the fastest 6502 depack routines out here.

 

but unfortunatly the depack source code is also done in XASM and not in DASM as the code is still written by Fox the guy who wrote XASM, FASTPACK and Vector...

 

Heaven

 

ps if you are offended by my tips which are useless for some people because they are so "non-understandable"...ask me concrete questions you get concrete answers... what i try to give is an direction & tools which can let people imagine what is possible. coding on consoles & 80s machines is not easy... nevermind

Link to comment
Share on other sites

Cafeman - sorry to sound pissy, but I think your "Heaven/TQA" post was both harsh and ill directed.

 

I find Atari message boards, by and large, populated by people who know very little about the architecture and programming of the 8bit Atari systems in practical terms, few have produced code and almost no one has great programs. But here at Atari Age that's not true...

 

I think that Heaven makes a pretty bold contribution to almost all of the threads in the technical and coding boards.

 

I for one find his contribution stimulating - he and his crew have produced MANY great demos - far surpassing a few sprites and DLI FX...

 

I would think this community would do better to stick together, encourage each other, focus on helping everyone be creative and actually get the 5200/7800/2600 homebrew scene away from the usual fanboy graphic hackers and pirates...

 

I've worked on 8bit hardware for years, I professionally produce and design video and computer games (you've probably played some and maybe even own some), for almost every format created. Long ago the games industry realised support and collaboration produced the best results...

 

I look at the work being done, by people like yourself, Heaven, Calamri and others (sorry I don't mean to miss anybody out)- its fabulous to see all this new stuff happening. I can't wait to join in - my kit is almost here :-)

 

sTeVE

 

[ 02-15-2002: Message edited by: Jet Boot Jack ]

Link to comment
Share on other sites

Heaven,

Here's what I am trying to do. The 5200 will onyl use 32K of ROM. Each screen runs 960 bytes. To get a decent number of screens I need about a 4:1 compression ratio in which case I think I can get around 80 screens in + character sets + code etc and fit in under the limit. I need a routine that I can call that pulls the location of the first byte of the screen I want displayed, decompresses the screen and stores it in screen memory. The uncompressed length of the screen is always the same (960 bytes) and the screen memory is always in the same spot (unsure where atm as my notes aren't here)

I tried to use a simple RLE packing/unpacking method and that simply will not cut it for the complex screens such as the castle. The compression is simply too low that way. The pucrunch code I was looking at for the C64 I haven't had a lot of time to look at but it is pretty obtuse. The routine from what I have figured out is set to copy itself into ram and then modify itself with the Huffman codes and such. With more time I'm sure I can figure it out but if you have a fast routine I can adapt I would love to see it. At least with something that you and others are using I can ask questions about it. Thanks,

AlanD

Link to comment
Share on other sites

I just re-read my post -- Sorry, Heaven! I can't even recall what I was trying to say there, but it does sound 'harsh'.

 

I think what I was trying to say was something like this: "Heaven knows the Atari 8bit world so much more than I do, that his posts make me feel like a total newbie".

 

I didn't mean to criticize...

 

[ 03-10-2002: Message edited by: Cafeman ]

Link to comment
Share on other sites

ok... another try guys

 

thanx jet boot...

 

re: packing

 

well... i found the tool i used in my projects & taquart used in all of their demos. fox coded "FLASHPACK 2.x" (sorry... it is not called fastpack...

 

i dont know actually which compression method he uses. i dont care because it works really fine...i never even understood how it internally works but how to use it...

 

i will upload it on sunday. to become more concrete:

 

you can squeeze every screen 960 bytes with flashpack and save it separatly as binary file. the depack routine will be saved with it, too... so... let me think... every screen would fit into 1024 byte incl. the depack routine... so you can do this, f.e.

 

$4000 screen1

$4100 screen2

$4200 screen3

...

 

the main engine would do this:

 

ldx room-number

jsr build_screen

...

jsr play

...

 

build_scren

lda room_lo,x

sta v0

lda room_hi,x

sta v0+1

jmp (v0) ;f.e. $4000

 

but you have to save in FLASHPACK each

screen to the correct adresses. the depack routine will be assembled to the correct adress and contains where to write the depack code...

 

so in flashpack you would f.e. save the data to $4000 and tell flashpack to depack the data directly to screen-ram, f.e. $bc40...

 

flashpack is really fast because it uses selfmodifing code...it was developed for realtime depacking... so maybe not the best

for a game and ROM usage... so i am thinking

of the second packer i have used in the past called SUPERPACKER from BEWESOFT. it is slow but the depack routine is reusable and flexible so you can tell the routine where the pack data is and where to depack it... so this would be the best i guess... let me think tomorrow more detail abou it...

Link to comment
Share on other sites

what i have done in the past you can

find under

http://www.s-direktnet.de/homepages/k_nadj/i.html

 

but i havent touched coding 8bit atari for now more than 3 years. so that is why i can sound sometimes confusing... nevermind...

 

f.e. i havent got all my tools i used at that time because most of them are on 5,25 disks or better on atari ST virual atari drives which i havent any more (same with most of my source codes... )

 

in real world i am International Product Manager in a entertainment software company here in germany dealing with PC, handhelds and next gen consoles... so that is why i have not much time to help you guys really with practical help... just what i have in memories...

 

so... let us all code! and produce great products!

Link to comment
Share on other sites

Flashpack 2.x & Superpacker online under

http://www.s-direktnet.de/homepages/k_nadj/main.html

 

in the file section at the bottom of the page... the ZIP archive contains all necessary files. please do not open the DOC with MS Word. better use notepad...

 

both packers have to be loaded in Atari800win 2.x & be copied on a ATR image with a DOS. Otherwise you can not handle your

pack sessions...

 

it could be possible that you can pack directly without an atari dos loaded by loading the COM-files from the emulator and pack files straight from the "H:" PC harddisk. But remember to unlock the the Harddisc for writing!!!

 

i will open a new html-page where i describe how to handle the packers on 5200...

 

yet i dont know how to make homebrew 5200 code to test. i check cavemens site so i can give you more advanced help with code working on the 5200...

 

heaven

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...