Tuesday, November 14, 2006

XeO3: Father Ted....

Okay.... I've gotten the TED sound playing the main theme, although its been a bit of a nightmare.... it turns out that normally these operate at location $D400 - the original location of the SID on the C64. But add-on for the plus/4 is mapped to $fd40 (or $fe80), but when the card isn't there then this is just normal IO space - and theres no RAM there. This means it just doesn't work! What I've ended up doing is making a relocate routine that runs through SID music player and then moves the writes to the SID card to an area of memory the Frequency convertor can get access to. I've also managed to shrink it down by 50 bytes, but I've had to add the relocate routine... so I've uised up just over 1k for this.

However....now for the REALLY bad news! This routine takes around 16 scan lines to run, and thats on top of the SID player! This is very painful! So, if we run low on memory again, this is the first to go as it will slow the game down in busy areas.

Still, I've given Luca the mconv source and he can release it on +4 world at somepoint so others can use it. As I said earlier, the source lets you play around with it easier..... as well as relocate it and change the storage locations.

14 comments:

Chicken said...

You could use preconverted music. Some time critical demos do so (e.g. "Vector Victory" converted by Csory). However, then you probably won't be able to keep SID and TED music in the memory which means some extra loading.

A native TED music player would be best, though. TLC's TED player routine is nice and maybe Luca (who else? ;) ) can do a TED version of his musics. Sure, converting using Mconv is much easier.

Also, there are one or two frequency converters which are a bit faster than Mconv. However, they have less features and might not sound as good. Converting needs a lot of listening, tweaking and testing anyway. It's not a matter of just running a routine (sadly, many demos show that).

luca said...

Damn, 16 extra scanlines is too much! 16 for the conversion and max 24 for the music itself is a kick in the. :(

Mike said...

Yep...We've just been speaking about this.... The best bet would be to take the SID music file and write a TED player for it..... although loading 4k over the top once at the start wouldn't be the end of the world either......

Also... because each level has its own music, I'll be loading in the new music each level, so it would have to be on disk anyhow. I'm not sure what I'll do as yet.... might just be a lost cause.

Mike said...

Oh....and I'll just point out... that because the game run's in 2 frames, I currently lose 50 scanlines for SID only, and 80 for TED music over one game frame.... Thats a LOT - enough for a couple more sprites probably...

Anonymous said...

As you pointed out you need to load music separately anyway, so separate players for TED & SID is the only sensible solution. That means a bit more work than using converter, but 32 lines per game frame should make it worth the trouble.

If you can keep the exact same music data, you can load both player routines with the main code, then copy SID player over TED one if user has SID card.

What do you plan to do with sfx if there is no SID?

--
TNT

Mike said...

It all depends on how well documented the audio for the SID player is. I dont want to spend 3 months trying to reverse the SID data and then write a player. Its probably all going to come down to how much time I think its going to take.....

If I get this working, then I'd give the option to play music or sound - not both.

I'll look into the player, but Im not holding out much hope of doing a TED player for the data....

Chicken said...

I doubt that using exactly the same music data for SID and TED and keeping THIS SID player (and not one that is specially aimed at TED and SID) will win much. It'll just add complications to the TED player because the data is stored in a way that's good for SID (and the player routine), not for TED.
Right now the SID music data and the SID player use a continous memory range, don't they? So there's not really a difference in loading times when you either load SID player/data or TED player/data.

It's probably easier to compose TED music with a native TED player (which already exists and doesn't have to be coded).
Then you'd even gain some scanlines because native TED players are VERY fast (of course due to less features compared to SID).

I know that Luca is especially proud of his instruments but they get lost almost completely in the conversion process anyway.

If Luca doesn't have the time or inspiration to do a TED music and in case you won't have enough time for frequency converting and don't feel like writing a TED player for THAT music data: You can still do frequency converting in the front end (I guess there's enough time there) and then just have TED SFX in the game. Thus users without SID card get to here a tune in the front end and it's not silent the game. That's more than many C16 games have to offer.

luca said...

Chicken: the little and short TED tune I composed for Mermaid's pat in 8SOB C16 trackmo had taken more than 2K. We're fighting byte per byte, and a 2K addon looks like a terrible kick :(

Chicken said...

Blogger seemed to hang... I'm glad my posting got through. In case it shows up more than once I apologize.

Luca,
TED "instead" of SID music doesn't use more memory. If there's no SID card installed then SID music/player is not needed. That's 4k, isn't it? I'm sure you can do "something" in 4k.

As it seems you are planning on loading SID music/player level by level. Or will the player stay and just music data be loaded? Doesn't really matter... :) There's not much difference in loading time if you load the complete game or the almost complete game and then 4k for whatever music/player is required.

TLCCNS said...

Hi Guys!,

Gaia has kindly pointed me to these posts about the mconv routine being disassembled and presented in source (which is nice).

As for the music in XeO3, I guess Chicken has said it all, nothing more to add, just to clarify (as, I guess, you might have mis-gotten the idea he had talked about). The point is, to create native TED versions of the SID tunes (either in my player which Luca has experimented with or some othe TED player... Csabo's or 4-Mat's, all of them are available as sources AFAIK), and play _either_ the SID _or_ the TED version, depending on some settings or an autodetect feature. The tunes can be compiled to occupy the same memory areas. The loader might be made to care about loading the respective tune (AFAIK XeO3 is planned to work on top of a disk-IO system). This needs more work, but 1.) gives an opportunity to optimize the TED sound as much as possible (in opposition to the music converter approach, where it's hard), 2.) implies no overhead, neither memory nor cpu.

As of creating a TED player on top of SIDWinder: in short, it's a "bad idea". It won't save one from fiddling with the music data, rewriting things here and there, as the SID and the TED are generally very different, and the player is pretty dependent on the SID itself; for example, it uses SID frequency scale for the slides (which is absolutely different for the TED). And the player also won't be optimal for the TED, whereas that is just "given" if rather moving to a TED player's field.

AndyC said...

Gotta say I'd go with loading separate TED specific music + player routine.

If that's too much work, maybe just drop music from non-SID equipped machines. Whilst only 28% of users may own one, emulator support is pretty good so it's not like people won't get to hear it!

tlccns said...

Thinking this over... would that help, if I created a tool, nothing complicated, something like a perl script or an ansi C console app that reads a SIDwinder seq file and writes an asm template of the tune in the format used/seen in TLCPlay?...


Sure, the data would need to be edited, especially the arrangement part, but having the original data in the needed format would probably be a good start for the conversion.

Mike said...

Sure.... a console app that could read a sound module would help a lot. I'm still not sure how much effort I want to put into TED music, but if its format was exposed then there might at least be a chance.

TLCCNS said...

Hmmmm... O.K.

I don't like promising stuff before it's even in my own hands ;-) but this task of creating this tool shouldn't take more than probably an afternoon to create... whatever...

The game would benefit from having proper TED sound, I'm sure (for one, I do own a SID-card, but prefer native TED stuff anyway whenever it's just possible... I can listen to SID tunes anytime I just want, I need no Plus/4 for that, I mean). Nevertheless, if you both decide with native TED music, most of this work will have to be handled by Luca... This tool that exports the SID tune file into an editable and compilable template may be a great help, but it's still him who'll have to create the new sound arrangement, edit the tracks, listen, optimize, polish, etc.

Thinking this over again (as usual |-) ), I guess this won't be _that_ hard. After exporting the SID tune into the asm template, we have an editable source. Things that need to be handled are 1.) the sound arrangement, which is absolutely different on the TED, but the tool will export the original SID arrangement (and, for that matter, everything that has no equivalent) as comments, so at least Luca will have a remainder of the original. Another point is, if Luca uses similar arrangement in more of the tunes, the arrangement could just be copy/pasted between them. 2.) The tracks are basically the same, editing is only neccessary because the TED has 2 channels, whereas the SID had three. 3.) The sector data format (the score itself) is almost the same, editing is only neccessary because of the different slide commands, and because the fact that the TED is unable to play notes below a certain value (110Hz).

O.K. This is up to you both to decide if including TED music in the game... for one, I'd like it ;-).