Sound Engine & Midi Music player for the MTX

Everything about programming, including VDP and Sound programming.
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Sound Engine & Midi Music player for the MTX

Post by Potholepete »

I have been playing for a while with Tony Bs (Rolla Bearing etc) Envosound (ES) engine and after getting a lot of help from Martin (BIG thank you :-) I now have it as a runnable standalone option. Originally in Downstream Danger and then Rolla Bearing we created the music by hand coding it into the game. What note, how long, what envelope used etc. Sadly I have not been able to reverse engineer this part of the RB code and even if I could it would still mean having to work out how to code any new music by hand..... No trackers or DAWs existed back then.

For any new MTX game (or any machine come to that that uses the TI SN PSG chip) things are very limited as far as sound engines go and this was the major reason why I have been working hard on getting ES viable as a routine that can be added to someone's game and used. Given the opportunities that this offers for better effects in any new MTX game with Tonys kind permission ES will with a few provisos be available to use for anyone who asks and we agree.

My next task, working with Tony is to try and get a DAW with a VST plugin setup in such a way as to make it much easier to create new effects and then use the values in the VST to use in ES on the MTX and those sounds be as close as is possible. What I do not have the skills for is to create a music player (Not a VGM player due to memory usage etc) that would allow one of the DAWs music (midi?) to be exported in such as way as to then be able to put that data into an MTX and with the player play the music on an MTX. There are a few out there for the AY (CPC/MSX) sound chip but I could only find Deflamask which has a PSG (the Ti SN chip) part usable from the Sega Mastersystem which if I am not mistaken used this PSG?

Anyone with the skills interested in helping with please get in touch :-) Thanks

Jim
Last edited by Potholepete on 03 Jul 2023 19:46, edited 1 time in total.
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: Sound Engine and Music player for the MTX

Post by Bill B »

I could be interested in contributing, but I would need some translation and documentation:

After some Googling
  • DAW ? - Digital Audio Workstation
  • VST ? - Virtual Studio Technology (extends the capability of a DAW)
  • VGM ? - Video Game Music (a file format)
I think what you are trying to do is automatically convert music & sound effects from some industry standard format into the data structures you need to drive your Envosound code. If so, I would need:
  • Some pointers to whatever you would use to author the sounds, and what format this uses to store the data. It is something I have never looked at.
  • Documentation of the format of the data you need to drive Envosound,
Last edited by Bill B on 28 Jun 2023 20:40, edited 1 time in total.
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: Sound Engine and Music player for the MTX

Post by Potholepete »

Hi Bill,

Currently the one program that many seem to use for their Retro music is called DefleMask (Legacy is the free version), and this has several VSTs (A plug in that can emulate the specific sound chips capabilities) that can be added to the Tracker (the music creation tool) for the musician to then create effects that they know their target sound hardware can produce. Then they either export it and use in in their own programs or they have a way to read the saved music file and then play in on real hardware. I do not know how this side of things works at all as far as coding goes.

As far as the MTX is concerned I have Envosound taken from Rolla Bearing and spent the last month trying to reverse engineer it so that it can be used in any game. I am still not 100% sure of what all of the parameters do and sadly Tony has little to no paperwork left so getting the final ones understood will take playing about with. I do though know enough already to create new envelopes (by hand and experimental as to the results) and I know what registers to set up and what function to call to trigger off a sound using Envosound. I have a .BAS file that I could email over to you if you have a way of running it on real hardware as Memu (and from trying to run Downstream Danger just now on your version) cannot deal with the interrupts correctly and the sound effects that are made in the emulator(s) is not what they sound like on a real MTX.

Jim
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: Sound Engine and Music player for the MTX

Post by Bill B »

Jim,

Yes I can run code on a real MTX,

Dave gave me a bare Mk 1 MFX PCB, but for various reasons I have never got that fully working. I do have a working CFX-II, and can always transfer files to good old floppy discs.

If you don't want to post the code publicly, can you send it to me by PM?

Bill.
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: Sound Engine and Music player for the MTX

Post by Bill B »

The DefleMask is not very illuminating, No detail of any of the file format.

Also, to me it is not clear how you compose a tune, but then I am no musician. Presumably you know how to do that?

It does apparently support the SN76489 sound chip for a couple of systems. The "SEGA Master System" is probably the best starting point as that apparently has just the SN76489 chip, so anything that can do the MTX should be able to reproduce.

One of the supported output formats is ROM format. Presumably that is the Z80 code needed to produce the sound on the "SEGA Master System". In which case it is perhaps just a case of editing the generated code to use the I/O ports appropriate to the MTX rather than the SEGA. Will need to find documentation of the SEGA system.

This may end out not using your Envosound code.
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: Sound Engine and Music player for the MTX

Post by Potholepete »

Hi Bill,
I think a lot of those programs will not provide much useful information on their file formats, I know there is a common VGM format but this is not the direction I want to go down as it uses a lot of data to store the music info. Deflamask is more generally known as a tracker program, REAPER is whats known as a DAW (Digital Audio Workstation) and this is what I would be using for the VST plugin that we hope to use to be able to create sound effects that can be emulated in Envosound. The VST I hope to use will not work in Deflamask sadly. I do now know how well developed the envelope capabilities are for the mastersystem in Deflamask so it may be that creating sound effects in that will be short changing what Envosound can actually produce.

I have sent you the envosound source and a listing to have a look at and play with. Tony's music routine simply managed what sound effects and so forth were to the envosound routine but envosound managed to actual sounds being sent to the PSG etc.

J
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: Sound Engine and Music player for the MTX

Post by Potholepete »

i found a thread here that is similar to what might be needed for the MTX to play files from Deflamask. its just general but is on the same subject.

https://www.deflemask.com/forum/general ... die-games/

It may be the easiest way is for me to try and learn to use Deflamask and see if I can create some music in that and just play with the PSG options to see if I can get close to what I can create with envosound and then just make the envelope changes to the ones I use with envosound? Not sure how feasible this is yet but it may work.

J
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: Sound Engine and Music player for the MTX

Post by Potholepete »

So while hunting before I hit the bed I came across some writing about a VGM to Midi convertor utility. I do not know anything about it but that may be a way forward? Anyway lights out time.

J
User avatar
gunrock
Posts: 248
Joined: 28 Oct 2020 21:17

Re: Sound Engine and Music player for the MTX

Post by gunrock »

Two things!

I think Furnace is the tracker of choice for most people, now that full-featured, up-to-date Deflemask is paid for.
https://github.com/tildearrow/furnace


The other is that the SMS used the SN76489 and not the SN76489A of the MTX, which might have some implication for adapting playback code from SMS sources, particularly clock speed. Not necessarily an issue if you are using Envosound, I guess.
Steve G
Danish Memotech MTX 512, MFX and loving it
User avatar
gunrock
Posts: 248
Joined: 28 Oct 2020 21:17

Re: Sound Engine and Music player for the MTX

Post by gunrock »

Also, what about Paul Daniels' VGMPlayer? Is there anything useful that can be reused or gleaned from that?

http://www.primrosebank.net/computers/m ... m#software
Steve G
Danish Memotech MTX 512, MFX and loving it
Post Reply