Sound Engine & Midi Music player for the MTX

Everything about programming, including VDP and Sound programming.
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: Sound Engine and Music player for the MTX

Post by Bill B »

Potholepete wrote: 29 Jun 2023 01:20 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/
This seems to be related: https://www.deflemask.com/forum/rom-bui ... -homebrew/, however there does not seem to be a link to any accessible code.

The format of VGM files is described here: https://vgmrips.net/wiki/VGM_Specification. As you remarked these are probably too large to use directly, but it may be possible to scan them and extract envelopes which can be encoded in Envosound.
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: Sound Engine and Music player for the MTX

Post by Potholepete »

I will take a look at that tracker as its not one I have seen as yet. There are so many though and many people have different views on which is the right one to use that I have found myself spending ages on the net just looking at the various choices and coming away none the wiser lol.

I am yet to fully be able to say what all 15 parameters the envelopes use in ES, but it may be that as mentioned possible to create envelopes in a tracker that are pretty close and then map across. I guess in an ideal world we could have the envosound as a plugin for one of the trackers of choice then we would be 100% sure what we create can be done in real hardware. There is work on a VST plugin (although much more advanced than ES ever got to) but I am not aware if you can load VSTs into trackers? Not something I have looked at yet tbh.

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

Re: Sound Engine and Music player for the MTX

Post by Potholepete »

Re Pauls VGM player, it may well be that someone could find a way to convert the data used in that out to a format that is much less memory hungry, but its not something I have the skills for. I read some have done this and taken a 256k file and reduced it to 148k storage, but someone else did a manual conversion of the data and got it to around 5k, so the differences are huge and that is really where i am aiming towards.

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

Re: Sound Engine and Music player for the MTX

Post by Potholepete »

It seems there was an offshoot of the famitracker called SnevenTracker that was specific for the SN chip, it does not like it has been updated since 2016 though? I have been looking at the other tracker and it looks similar to Deflamask (free version)
Bill B
Posts: 596
Joined: 26 Jan 2014 16:31

Re: Sound Engine and Music player for the MTX

Post by Bill B »

I have found information on the DelfiMask file format:

https://www.deflemask.com/forum/general/dmf-specs/

One issue with Envosound is that, while it can produce complex 'Notes', which are good for individual events like a collision or explosion, it does not have any way of sequencing multiple 'Notes' to produce a 'Tune'. Whereas I presume that DAW and Trackers are intended for composing tunes.
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: Sound Engine and Music player for the MTX

Post by Potholepete »

could prove useful ref re deflamask. The fact it has a half decent PSG section could mean its possible to create stuff that can be used in ES with less effort than it would take hard coding it all in, but it needs playing with I guess to see what's involved.

Envosound can be configured to produce a simple tone as well as the complex ones so if someone wanted just plain tones they could do that in ES (there are a few examples in the 28 envelopes in the ES code you have)

Its the player code in RB that does all of the sequencing and then just sends that info to ES to play the required note. The missing part in the RB/ES puzzle is the player as understanding how that worked would then show how ES is used within the music part.

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

Re: Sound Engine and Music player for the MTX

Post by Potholepete »

Having looked at numerous options it has been concluded that going the midi route will provide the easiest option as far as being able to use a program of choice to create at least the initial part of any game music. There are ways to get midi into Deflamask, and Furnace has a ref to importing midi as well.

My method of choice is using a usb midi keyboard to create tunes and the trackers are not as easy for me to work with compared to DAWs like Reaper etc.

Bill is kindly looking at how to read in and then try to send that midi data across to ES. Anyone who has experience with this who would like to help please feel free to comment as if we manage to get a midi reading player working with ES for the MTX then that will be available to anyone wanting to create good sounds effects and music on an MTX game in the future.

J
stephen_usher
Posts: 326
Joined: 27 Nov 2016 19:58

Re: Sound Engine & Midi Music player for the MTX

Post by stephen_usher »

Can't the Z80 DART on the serial board be persuaded to talk MIDI? If so then the Memotech could act as a MIDI instrument and record the data coming in.
Potholepete
Posts: 83
Joined: 11 Aug 2012 22:13

Re: Sound Engine & Midi Music player for the MTX

Post by Potholepete »

er Bill ;-) I have no idea as thats way over my head lol.

I'm hoping that a way to decode the midi file and send it over to ES can be found in the longer term as this would also mean any z80 based machine with the SN chip may also have access to ES, and not all of them had Darts if my memory is correct?

The main need for this now is because I have a game at an advanced stage in Unity that has been designed to be capable of running on the MTX, all colours, sprite limits etc have been kept to make it possible and currently there is ongoing work already on the Z80 version. The area where we do not have available code is the sound effects / music side of things. I do not want to go the VGM route because of memory usage and hard coding it is not an option either so hopefully Bill and anyone else who wants to help will work out how to link midi to ES on the MTX.

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

Re: Sound Engine & Midi Music player for the MTX

Post by Bill B »

stephen_usher wrote: 03 Jul 2023 20:22 Can't the Z80 DART on the serial board be persuaded to talk MIDI? If so then the Memotech could act as a MIDI instrument and record the data coming in.
I believe that the usual voltages for MIDI are incompatible with RS232, so at least some level converters would be needed. However this is probably a common problem so such converters should exist.

However the current requirement is to embed tunes into games. For that, what is required is some way of converting MIDI data into Z80 code / data which can be included in the game code.
Post Reply