Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:55 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : VGM to MOD

Author Message
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 11:03am 18 Oct 2023
Copy link to clipboard 
Print this post

Hello

Anyone knows a good software to convert VGM audio files to MOD?
I need it for playing a game music using the play modfile basic command

Thanks
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 11:32am 18 Oct 2023
Copy link to clipboard 
Print this post

never heard of VGM audio
  Quote  
VGM (Video Game Music) is a sample-accurate sound logging format for many machines and sound chips. It logs the commands sent to the sound chips, so the resulting files are much smaller than mp3s. The normal extension is.vgm but files can also be gzip compressed into.vgz files.


I know Mod Files
  Quote  MOD is a computer file format used primarily to represent music, and was the first module file format. MOD files use the “.MOD” file extension, except on the Amiga which doesn't rely on filename extensions; instead, it reads a file's header to determine filetype. A MOD file contains a set of instruments in the form of samples, a number of patterns indicating how and when the samples are to be played, and a list of what patterns to play in what order.

at first glance they are very different,
VGM audio uses a list of commands for the sound chip. Probably comparable to Midi

MOD files work sample based with play- and pattern lists.these are two different things.
Of course you can go there, sample the audio of the sound chip and build a MOD file from the samples, but I don't think you can automate that.
'no comment
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 11:36am 18 Oct 2023
Copy link to clipboard 
Print this post

More VGM info here
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 12:11pm 18 Oct 2023
Copy link to clipboard 
Print this post

I have found a tracker software that maybe can help.I will try it.

https://github.com/tildearrow/furnace

Maybe my question is wrong. I have the game music files in mp3 and WAV as well. The problem is how to play the SFX while the music is playing. The MMBasic player effect command only works while mod files are playing. Is it a better way to do it?
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 05:46pm 18 Oct 2023
Copy link to clipboard 
Print this post

A while back, I wrote some instructions for working with MOD files. This doesn't help though with simultaneous music. Storing the music as a (very large) MOD sample is probably silly...
Visit Vegipete's *Mite Library for cool programs.
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 06:23pm 18 Oct 2023
Copy link to clipboard 
Print this post

I use for Nostalgic reasons ProTracker 2 Clone .
Because that's what I started with. That was basically the first time that you could produce music without having to buy expensive instruments.  (it was exactly Noisetracker on Atari ST).
Later on the PC i changed to Fuity Loops, as that was also pattern based.
And today I still use the successor "FL Studio" as my DAW
I try to replay songs without having the sheet music or a MIDI, just by ear.
And something like that  comes out of it. (Rocky B. is my alter ego on Youtube)
Cheers
Martin
Edited 2023-10-19 04:25 by Martin H.
'no comment
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 12:30am 19 Oct 2023
Copy link to clipboard 
Print this post

  vegipete said  A while back, I wrote some instructions for working with MOD files. This doesn't help though with simultaneous music. Storing the music as a (very large) MOD sample is probably silly...


Thank you Vegipete
The music files are not large. I will follow your instructions. Let's see if I can make it work.
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 03:25pm 24 Oct 2023
Copy link to clipboard 
Print this post

  vegipete said  A while back, I wrote some instructions for working with MOD files. This doesn't help though with simultaneous music. Storing the music as a (very large) MOD sample is probably silly...


vegipete, thank you for your detailed tutorial. It worked like a charm for creating the MOD.
My current problem is the MMBasic play modsample can't sustain the sample for the length of my game music, which has 17s. The music plays correctly inside OpenMPT, but when played with basic, it is cut when the first pattern ends. I tried to use three empty patterns to extend the time of the audio, but I didn't have any effect on basic.

This is the music file:
02_majou-densetsu-psg.zip

It will be nice to have support for .xm audio files (extended module)
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 03:38pm 24 Oct 2023
Copy link to clipboard 
Print this post

  LeoNicolas said  
  vegipete said  A while back, I wrote some instructions for working with MOD files. This doesn't help though with simultaneous music. Storing the music as a (very large) MOD sample is probably silly...


vegipete, thank you for your detailed tutorial. It worked like a charm for creating the MOD.
My current problem is the MMBasic play modsample can't sustain the sample for the length of my game music, which has 17s. The music plays correctly inside OpenMPT, but when played with basic, it is cut when the first pattern ends. I tried to use three empty patterns to extend the time of the audio, but I didn't have any effect on basic.

This is the music file:
02_majou-densetsu-psg.zip

It will be nice to have support for .xm audio files (extended module)

I think you are turning to a wrong direction ..

The main task of a MOD is, to play different samples in a fixed order, where 1 sample is a tone from 1 instrument in predetermined pitches, or a very short loop.
Look at it as a (kind of) Midi Player who brings his own instruments.

It can/should NOT hold a whole song in one Sample.
Edited 2023-10-25 01:47 by Martin H.
'no comment
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 03:55pm 24 Oct 2023
Copy link to clipboard 
Print this post

  Martin H. said  
  LeoNicolas said  
  vegipete said  A while back, I wrote some instructions for working with MOD files. This doesn't help though with simultaneous music. Storing the music as a (very large) MOD sample is probably silly...


vegipete, thank you for your detailed tutorial. It worked like a charm for creating the MOD.
My current problem is the MMBasic play modsample can't sustain the sample for the length of my game music, which has 17s. The music plays correctly inside OpenMPT, but when played with basic, it is cut when the first pattern ends. I tried to use three empty patterns to extend the time of the audio, but I didn't have any effect on basic.

This is the music file:
02_majou-densetsu-psg.zip

It will be nice to have support for .xm audio files (extended module)

I think you are turning to a wrong direction ..

The main task of a MOD is, to play different samples in a fixed order, where 1 sample is a tone from 1 instrument in predetermined pitches, or a very short loop.
Look at it as a (kind of) Midi Player who brings his own instruments.

It can/should NOT hold a whole song in one Sample.


You are right, I know about this. I am trying to have a workaround for playing the song and sfx together.

I think the other alternatives I have are:

1) Rewrite the song using patterns/notes
2) Break down the wav in 3 or 4 samples, and play them as 3 or 4 notes, what will be hard to keep the tempo
 
javavi

Senior Member

Joined: 01/10/2023
Location: Ukraine
Posts: 218
Posted: 04:02pm 24 Oct 2023
Copy link to clipboard 
Print this post

Hello Everybody!
Introducing my simple player
PMMP -- Pico Mite Music Player
for playing .MOD .WAV .FLAC files  


PMMP.zip
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 05:44pm 24 Oct 2023
Copy link to clipboard 
Print this post

Might be nice, but wouldn't solve the Problem LeoNicolas asked for.
Playing music and Sound FX at the same Time.
In Pico Petsciirobot I  added all SFX to the Mod, cause the Mod can hold 32 Samples and the Music there mostly uses 10 to 16, therefor the rest "Slots" were free.
Play Modsample plays the SFX while the Music is playing. You have to make compromises because the maximum size of the mod file for the Pico is only 125 kilobytes and the effectsamples alone take up almost 80 kb.
'no comment
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 05:56am 25 Oct 2023
Copy link to clipboard 
Print this post

LeoNicolas
try this little example:
I found a short "*.MOD" file. I also found the SFX Samples as 48KHz Stereo mp3 Files on Github and convertet them to 11025 8 Bit Mono using an Audio Editor (like audacity, Audition etc.)
Then used Protracker to add SoundFX starting at SampleNo 16 (&H10)



use this little Test Program
It plays the annoying Music as normal until you press ESC
Pressing keys 1 to 5 plays the SFX while the Music is playing



'Load modified MOD File
Play modfile "bubble bobble sfx.mod"
Bubble=16
BKill =17
Hurry=18
Jump=19
Damage=20
Do
 k$=Inkey$
 Select Case k$
   Case "1"
     Play modsample Bubble,1
   Case "2"
     Play modsample BKill,1
   Case "3"
     Play modsample Hurry,1
   Case "4"
      Play modsample Jump,1
   Case "5"
      Play modsample Damage,1
Case Chr$(27)
Exit


End Select

Loop
Play stop


the modified Mod File
bubble bobble sfx.zip
I hope this makes the principle more understandable
have fun
cheers
Mart!n

EDIT
maybe you can use this to read the VGM Pattern Structure:
https://pastebin.com/PLYUVvgk
with the Patterns as Text Output it would be easier to create a Mod out of it
Edited 2023-10-25 19:10 by Martin H.
'no comment
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 02:47am 26 Oct 2023
Copy link to clipboard 
Print this post

  Martin H. said  LeoNicolas
try this little example:
I found a short "*.MOD" file. I also found the SFX Samples as 48KHz Stereo mp3 Files on Github and convertet them to 11025 8 Bit Mono using an Audio Editor (like audacity, Audition etc.)
Then used Protracker to add SoundFX starting at SampleNo 16 (&H10)

...


Thank you very much Martin, this is very cool. I could make it work by slicing the song into multiple pieces of 8.110 seconds, creating three samples.

This is the final MOD file: 02_majou-densetsu-psg.mod

I'm using Audacity to slice the music and OpenMTP to create the MOD file.

I also found a pretty good audio tracker for old videogames/computers audio formats, such as VGM. It's called FamiStudio
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 05:21am 26 Oct 2023
Copy link to clipboard 
Print this post

  LeoNicolas said  I could make it work by slicing the song into multiple pieces of 8.110 seconds, creating three samples.

could be done this way and you save yourself having to re-record it note by note ... but this significantly increases memory usage.
Mod size 302 KB so that's totally ok for your project on CMM but doesn't fit to Picomite..
The main thing is that you make progress with your program, your demo already looks very good
Edited 2023-10-26 15:39 by Martin H.
'no comment
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 06:20am 26 Oct 2023
Copy link to clipboard 
Print this post

I'm not too much concerned to have the game running on the pico right now. I can replace the big mod files by more optimized ones in the future. Even the game is not optimized for speed and memory usage, something I can improve after completing it.

By the way, I just committed the enimies spawning.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024