Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - VGM Tools

Reply to topic Goto page Previous  1, 2
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14744
  • Location: London
Reply with quote
Post Posted: Thu Nov 03, 2011 2:54 pm
It's easy to add panning support to multi-channel chip emulators, you just need to apply a panning algorithm to each channel before they get mixed together in stereo (or more channels if that suits the player). An alternative is to mod the emulators to output unmixed multi-channel audio and then have the player support mixing the many channels in whatever way you like, but that soon starts getting tricky and not very useful to most people. I find the stereo panning in in_vgm makes the music more interesting but with fewer channels, it can often end up sounding unbalanced (like early stereo pop music).
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Thu Nov 03, 2011 3:28 pm
I think we should preserve things in the way they were. The 2612 is stereo, so keep it stereo. The 2413 is mono, so keep it mono. The SN76496 is tricky since only the GG can pan it, even though I admit I'd like to see "impossible" vgms with 2612 + panned SN76496.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Oct 2011
  • Posts: 23
  • Location: Ethereal Plane
Reply with quote
Post Posted: Sat Nov 05, 2011 3:04 pm
@Maxim:
Hello, again, Maxim. You may (or may not) remember me from several years ago when you were still actively developing in_vgm -- I had contacted you via e-mail about in_vgm 0.36 alpha crashing Winamp when I would try to open a VGM-file -- Well, thanks again for taking some of your free-time to fix that bug. ;)

Maxim wrote
It's easy to add panning support to multi-channel chip emulators, you just need to apply a panning algorithm to each channel before they get mixed together in stereo (or more channels if that suits the player)

Hmmm, an "algorithm" ... Yes, since I was thinking from the POV of an Audio Engineer and an Amateur Programmer, I didn't consider how algorithms could be used in such a way as to multiplex channels. Well, you guys are the 'experts' in this field, so, I'll take your word for it that it can be done.

Maxim wrote
An alternative is to mod the emulators to output unmixed multi-channel audio and then have the player support mixing the many channels in whatever way you like, but that soon starts getting tricky and not very useful to most people.

Yeah, getting all of the emulators in-line with the players for this would probably be a real headache, especially now that the VGM spec supports so many audio-chips. However, it's really the last part of your quote that I want to emphasize, here ... One might could question the actual usefulness of such a 'feature', especially if it were to become far too technical for the average listener to deal with.

Maxim wrote
I find the stereo panning in in_vgm makes the music more interesting but with fewer channels, it can often end up sounding unbalanced (like early stereo pop music).

Exactly, we can only squeeze so much proverbial juice from an Orange, so, unless it's done carefully, it may just end up diluting the sound so much that it becomes undesirable to listen to. You're probably aware that a lot of songs' instruments are doubled (or even quadrupled within the Gen/MD version of ViewPoint) with a slight delay on each channel to give it the illusion of a wider sound-field, or to generally thicken an instrument's sound; that along with the 'fake' (i.e., non-sampled) Percussion might sound really bad without lots of tinkering and tweaking at the listener's end (no pun intended, here).

Tom wrote
I think we should preserve things in the way they were.

Aha, this is probably the biggest dilemma of them all: How to accommodate the 'explorers' whilst also satisfying the 'purists'? Solution: A compromise, by either making it optional (if possible) or by making it an offshoot (or branch) from the main project, only for those whom are truly interested in playing-around with it.

Tom wrote
even though I admit I'd like to see "impossible" vgms with 2612 + panned SN76496.

That, my friend, is what we call 'a double-standard' -- You can't have it both ways! ... Um, that is, unless, you are in favor of an optional-mode or branched-project? ;)
  View user's profile Send private message
  • Joined: 28 Oct 2011
  • Posts: 23
  • Location: Ethereal Plane
Reply with quote
Post Posted: Mon Nov 07, 2011 7:59 am
Last edited by Wraithverge on Mon Nov 14, 2011 11:55 am; edited 1 time in total
@ValleyBell:

I'm sorry to bother you again with more OPL-related questions, but, there are a couple of things I'm wondering about:

1) You are probably already aware of a document found on the web entitiled "OPLx decapsulated"; If so, then, have you been able to make use of its information to improve the accuracy of the OPL emulation utilized in VGMPlay?

2) I've been studying your edition of "fmopl.c" found in the VGMPlay sources, and without getting too technical about it, I would like to know your expert-opinion: Would you say that the emulation achieved with it is more 'accurate' than with other revisions of this file, for instance, such as the base one currently being used in "in_adlib.dll"? (Unlike with the 'standard' GPL'd AdPlug library, in_adlib uses the MAME licensed "fmopl" emulator)

The reason why I am asking you these things is, because, I (and, probably, only I) am still interested in improving the 'modified' AdPlug core library for the in_adlib project, but, I would like to see what you have to say about this before I go any further with the idea on my own.

Thank you in advance ...
  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Fri Nov 11, 2011 7:43 am
This week I noticed a bug in vgm_trim. If the end sample is in the middle of the last delay command, it simply copies the command, so the header's sample count doesn't match the number of samples in the file.

I fixed this bug and some other ones, so vgm_trim should almost bug-free.

I noticed this bug in some recent vgm packs, so I recommend to update immediately. (You don't need to retrim already trimmed tracks - I'll fix them before I upload them.)
vgm_trim_fix.zip (22.09 KB)

  View user's profile Send private message Visit poster's website
  • Joined: 08 Jun 2013
  • Posts: 2
  • Location: Rennes - France
Reply with quote
Post Posted: Sat Jun 08, 2013 4:36 pm
Hi!

I have a problem for convert VGM to MID with all vgm rip of SMS-Power, i have this message : (see attachment)



I have to convert the file to another format?

All VGM recorded when i play with the emulator Gens+ works fine with vgm2mid but not with file download on this site.


Sorry for my english if i made some mistake.
Error 0.png (12.8 KB)
Error message
Error 0.png

  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Sat Jun 08, 2013 6:55 pm
The file is probably gzip-compressed.
You can either rename it to .vgz and try again or use the VGMs from vgm7z packs, which are uncompressed.

It's a known bug that vgm2mid can't decide between compressed and uncompressed .vgm files.
It assumes .vgm to be always uncompressed and .vgz to be always compressed. (That worked fine at the time the initial version of vgm2mid was written.)
  View user's profile Send private message Visit poster's website
  • Joined: 08 Jun 2013
  • Posts: 2
  • Location: Rennes - France
Reply with quote
Post Posted: Sat Jun 08, 2013 11:12 pm
Yes thanks you, the files in the zip archive are in vgz with the vgm extension.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Dec 2004
  • Posts: 151
  • Location: Rouen, France
Reply with quote
Post Posted: Mon Apr 06, 2015 9:40 am
I experience problems with VGM trim. I'm trying to make a FM pack, and VGM trim deletes some instruments in the tracks. The last version I heard about is the 2012-12-07.

If I may have a few suggestions for an easier use:

-In VGM trim, not setting an end for trimming would have as default value the last sample. Now it interprets the empty field as zero.
-In VGM loop finder, a really nice addition would to allow to choose one of the suggested loop points and the VGM would be trimmed and looped in accordance. That would avoid any typing mistake or misinterpretation of the displayed durations (i.e. do I have to enter the displayed sample position or the number just before in order to loop correctly?)
-VGM splitter is nice, but in order to make the task easier I recorded a silence before each track in order to find easily where I havde to cut my VGM. An addition to VGM splitter is that it can split the file without entering any value: it would cut the file where there is silence.
-In the same idea, there doesn't seem to have a simple feature to strip silences. That would be a really cool feature to clean non-looping files.

With all these additions, making VGM packs would almost be a routine task.

I have another suggestion for VGM loop finder, albeit more time consuming to implement: supposing the VGM is already clean (only the tune we're interested with is in the file), we should be able to tell VGM loop finder exactly how many full loops are in the file, so ideally there should always be one result. It would avoid to type the minimum common command number.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Nov 2014
  • Posts: 365
Reply with quote
Post Posted: Mon Apr 06, 2015 9:34 pm
Quote
[quote="Hroþgar SCRB"]I experience problems with VGM trim. I'm trying to make a FM pack, and VGM trim deletes some instruments in the tracks. The last version I heard about is the 2012-12-07.


That is the version I use. There might be a newer experimental version (I forget) but it works the same as this one. I don't believe the tool has been updated. loop finder has a newer version with supposed improvements, but my use of it so far results in equal or worse results with sms sets, so I use the 2012 version.


Quote
If I may have a few suggestions for an easier use:

-In VGM trim, not setting an end for trimming would have as default value the last sample. Now it interprets the empty field as zero.


That would be nice. Currently, you would look at a vgm2txt for help (or use vgmtool r5 if that is more comfortable for you). If you record several tracks to one vgm, and leave a good bit of silence between them, the delay splitter will separate and crop the files very closely. If you are not careful with logging, you could have a case where you do not have genuine silence (long series of waits). The only alternative I've found that sometimes works with this issue is to use vgm_cmp to optimize the vgm. Normally this is not recommended, and it can cause problems with FM logs, but PSG based vgms are simple enough that in practice this should rarely if ever cause issues. Normally I write a single file to wavform and locate the end of the track and find the nearest sample in vgm2txt. This adds a bit of time to the process and having this feature would be nice, I agree. I can't remember if there was a reason it was not added.


Quote


-In VGM loop finder, a really nice addition would to allow to choose one of the suggested loop points and the VGM would be trimmed and looped in accordance. That would avoid any typing mistake or misinterpretation of the displayed durations (i.e. do I have to enter the displayed sample position or the number just before in order to loop correctly?)


You enter the sample values.. If a loop starts at 11025 and ends at 441000, you enter those values. Enabling copy/paste in the command line makes it easier so you can copy/past with a right click rather than typing it out.
Quote

-VGM splitter is nice, but in order to make the task easier I recorded a silence before each track in order to find easily where I havde to cut my VGM. An addition to VGM splitter is that it can split the file without entering any value: it would cut the file where there is silence.
-In the same idea, there doesn't seem to have a simple feature to strip silences. That would be a really cool feature to clean non-looping files.


As mentioned above, if you use sptd, then you can enter a single value and it will separate the vgm into multiple files. It worked for a good majority of the GG games in the mega pack music thread.

With all these additions, making VGM packs would almost be a routine task.

Quote
I have another suggestion for VGM loop finder, albeit more time consuming to implement: supposing the VGM is already clean (only the tune we're interested with is in the file), we should be able to tell VGM loop finder exactly how many full loops are in the file, so ideally there should always be one result. It would avoid to type the minimum common command number.


I might be losing something in the translation here, but it's difficult to see how that would help. Currently lpfnd does a brute force analysis, starting at the beginning and working through to the end, counting the number of matching commands. The track you just worked on, for example "appears" to loop at 0:51 and I did not think there was anything off about the pack, but lpfind as it is finds the right loop at 2:xx. If it were optional to guide it with a loop count value, it might help, but more likely it would not make much difference or introduce human error. Also, what if a track loops for 3 seconds? You would probably want more than one loop to show and trim unless you want to play with loop modifiers which not all players support. When in doubt, the waveform and vgm2txt help.

The minimum match is actually pretty important. You can set it to 5000 for example and have few or no results. No guarantee they will be correct. Sometimes the right loop shows up with very small values like 200 or even 50. I rarely have such issues with sms vgms, but there are also vgms with few commands. lpfnd will tell you the total number of commands in the files in addition to potential loop point and match counts. If you see similar values in the matches collumn such as 1526, 1527, 800, 1526...there is a good chance the mode (1526) is the proper loop or close to it. This usually shows up when there is no ! perfect match.


Maybe a tutorial would help? In practice, lpfnd often does not find a proper loop due to issues similar to those referenced recently, where the sound engine introduces minor differences in the track. Using vgm2txt to verify that the commands match at your chosen location to trim is essential with some tracks.
  View user's profile Send private message
  • Joined: 22 Dec 2004
  • Posts: 151
  • Location: Rouen, France
Reply with quote
Post Posted: Tue Apr 07, 2015 7:30 am
sherpa wrote
You enter the sample values.. If a loop starts at 11025 and ends at 441000, you enter those values. Enabling copy/paste in the command line makes it easier so you can copy/past with a right click rather than typing it out.


Oh, really? As it shows the start of the next identical block, I thought I had to substract 1 to the written value in order to have the position of the block's last sample. Hence the suggestion to apply directly the suggested loop, without having to type anything, avoiding any interpretation. By the way, in the same idea, when trimming a VGM, do I have to keep a zero sample in the beginning? Although the general process is clear, such small details are still obscure.

One thing I'm sure of is that the documentation should be developed a little, but Vally Bell said he's bad at it. :)

sherpa wrote

As mentioned above, if you use sptd, then you can enter a single value and it will separate the vgm into multiple files. It worked for a good majority of the GG games in the mega pack music thread.


I have to admit it, I felt so confused with the documentation of sptd that I left it altogether. Now I feel stupid and shameful.

sherpa wrote
it's difficult to see how that would help. [...] The minimum match is actually pretty important.


You may be right. I just gave my user's feeling, but there can indeed be exceptions. The example of variations in the loop is a good example, as I stumbled on this case with a track I'm working on.

sherpa wrote

Maybe a tutorial would help?


As far as I remember, there was a tutorial in another era, but with the arrival of new tools and new methods, maybe an updated tutorial would be useful to clear ambiguities.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Dec 2004
  • Posts: 151
  • Location: Rouen, France
Reply with quote
Post Posted: Tue Apr 07, 2015 7:47 am
Oh, I have another suggestion: VGMplay allows to log to WAV, with the output always in stereo. With SMS music and others, we end with duplicate data because the VGMs are in mono only. Conclusion: VGMplay should, depending of the used chips, choose to output WAV in mono or stereo.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14744
  • Location: London
Reply with quote
Post Posted: Tue Apr 07, 2015 7:48 am
You're welcome to write a tutorial and we can host it here.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Nov 2014
  • Posts: 365
Reply with quote
Post Posted: Tue Apr 07, 2015 10:31 am
Ok. That is something I wish for as well, however the truth:

There is no audible difference between a mono/stereo file for many tracks, but more importantly--

There is no easy way to tell if a track should be outputed in stereo/mono.

It makes sense on the user end, but in practice, it is not simple.

Also, many systems supported by the vgm format support and use stereo, so the overall benefit is to output to stereo. It does add some inconvenience to processing, but I use audacity to quickly convert to mono. For larger files it might be a bit less convenient, as the file is literally occupying twice as much space as needed, but even longish vgms should not be too unweildy given todays average storage capacity.

As far as a tutorial, I thiink I should. I've been hovering for over a month, not sure which to pick as an example, but I guess I should just start somehwere, I was hoping to work on a new pack while doing it as well, but it's probably better to use an older one I know a little bit about.

Are there any vgm packs you'd like to see done? It would be nice to have a tutorial with a pack someone cares about. I'll still have to see if it is appropriate, or what to select from the set, but preffered to just picking some random pack from what exists, or the mega thread.
  View user's profile Send private message
  • Joined: 22 Dec 2004
  • Posts: 151
  • Location: Rouen, France
Reply with quote
Post Posted: Tue Apr 07, 2015 12:19 pm
Maxim wrote
You're welcome to write a tutorial and we can host it here.


Hmm actually I'm not good (yet) at making packs, as can be seen in my previous posts. I've been working on a small pack for three days and still have to redo many things I messed. What would be the point of writing a tutorial if I write rubbish?

Sherpa: if you feel you can write a tutorial, maybe can I give a hand, but I don't want to be an annoyance.

As for the stereo/mono issue, it's just a detail for freing space and making handling easier. The only way to tell if the output should be in mono, is to rely on the chips used. If all the chips are mono chips, the file should be mono, otherwise: stereo. I don't think it's so important that a stream analysis is required. ;)
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Tue Apr 07, 2015 2:32 pm
Except that some chips, including our very SN76489, can be mono in one case and stereo in another (Game Gear). Besides, it's entirely possible (and sadly way too common) for a song not to use the stereo capabilities even if a chip would allow for them.

As much as I hate to see mono music saved in stereo files (and believe me when I say I ran several crusades against that), I don't think there would be an easy way to safely assume a song is mono or stereo without replaying the whole thing. One can switch to mono if chips that only have a mono mode are used, yes, but that would still leave us with a lot of stereo files containing mono songs played on stereo chips.

I think it's not a big deal as long as those pointlessly stereo files are only used for temporary reasons (such as trimming and looping), and anyone who is smart enough should convert suitable files to mono anyway if he wants to convert them to mp3 or ogg and store them on a portable device or use them as ringtones (don't even get me started on people using stereo mp3s as ringtones because this isn't the topic).
  View user's profile Send private message Visit poster's website
  • Joined: 22 Dec 2004
  • Posts: 151
  • Location: Rouen, France
Reply with quote
Post Posted: Tue Apr 07, 2015 7:15 pm
sherpa wrote
Are there any vgm packs you'd like to see done?


Well, I'm working on Double Dragon (FM), but whatever tool I use, I keep getting damaged data after trimming (dropped instruments with Valley Bell's trimmer or low gain on snare drums with Maxim's VGMtool) on some tracks. I don't know what to do about it. So, some tracks will probably have to be redone.

By the way, I highly suspect the Ys pack has the same issue and should be checked.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Nov 2014
  • Posts: 365
Reply with quote
Post Posted: Tue Apr 07, 2015 10:01 pm
Hey. The most common scenario is that you your loop points are off. They may be correct, but you need to look at vgm2txt in this case and see what is happening. If you are setting a loop after an instrument is initialized, you may get dropped notes. Also, if you are trimming the start point too late, it can cause issues. If you freeze the emulator before starting a log and change the id in memory, you can avoid this issue, since the start point will always be 0. There should be between one to two frames of sample (735-1470 ntsc) before you first see anything in a vgm wave log. If you are setting the start value late, this will cause issues. If you are not logging with this method (understandably) try cutting further back at the start point, and further in at the loop points (add 735). Either or both may help.

also from the text file, running vgm_trim.exe -state
may help. Without having the files specifically, and comparing the txt log I would not know. But these are the more likely issues.

Also, Tom's answer gets closer to the truth why vgm>mono wav output wasn't implemented. I glossed over those details in my response. But those are the reasons why.
  View user's profile Send private message
  • Joined: 22 Dec 2004
  • Posts: 151
  • Location: Rouen, France
Reply with quote
Post Posted: Wed Apr 08, 2015 5:01 pm
I've redone the ripping. I recorded all the tracks in the same file with a pause between them and tried vgm_sptd, with a value of 10000. While I expected to end with 10 files, I end with 14 files, with several of them containing only silence. Furthermore, in the documentation, I read "The delay where a file is split is stripped, so you shouldn't have any silence at the beginning or end of the file.". What if I still have silence at the beginning? It's not long: only a few hundred samples, but still. Should I strip it or leave it?
  View user's profile Send private message Visit poster's website
  • Joined: 28 Nov 2014
  • Posts: 365
Reply with quote
Post Posted: Wed Apr 08, 2015 8:04 pm
It looks like the sound engine may not be truly silent. If you have a few files that are a good chunk of the original vgm and a bunch 1-3kb files with silence, there is a good chance the sound engine is actually resetting every frame during what appears to be silence.

You should look at the vgm2txt to see if there are a bunch of delay waits in a row or if the delays during silence are actually followed by comand values with 00% volume.

I had some problems in the past with sms on this issue. It may be corigible. If you want true silence, you may need to enter 80 manually after you stop the engine to wait for the next song. I believe Double dragon stays at 00 when stopped and doesn't output 80. If the value in the trigger location is below 80 or above DF, SMPS is resetting itself every frame. It will sound like silence, but it won't be inactivity. the splitter will not work in that case. Optimizing might resolve this issue, but that is not a prudent option with FM. In general, either log separately, or make sure that silence is a long series of waits and not something else.

Also, not sure if you know but there is a new MEKA that lets you log music by pressing alt+v. It is available in a recent meka thread and now on svn. I would recommend grabbing this version and logging vgms individually.

As an alternative, if you were a bit more comfortable with the vgm format, I would recommend replacing the commands with the delay wait value,but it is very easy to make a mistake if you are not very comfortable reading vgm hex code. It's probably not worth the risk. It might be less work to start over. Under normal curcumstances, you would use a value closer to 100000 (2.x seconds). It's better to leave several seconds between tracks. (i usually leave ~10). If it is not splitting properly, the problem is very likely to be what i mentioned above, and you should start over.

update: Since a picture is worth 100 words, I've added a vgm. It has about 20 seconds leading in. Download an copy it to a new folder. Use sptd. Try seeing what happens if you use a value like 10000. (0 .226s)Then try it with 200000 (4.53s). After every track, I stopped the music, then set the value to 80 then waitend then started the next track..waited...then stopped (i used FF)..then set it to 80...repeat. etc etc..

This will split evenly. The alternative is to split it using spts, but that is going to be more time consuming than starting fresh.
Double Dragon (FM)BGM.zip (25.51 KB)
one big vgm use with sptd

  View user's profile Send private message
  • Joined: 22 Dec 2004
  • Posts: 151
  • Location: Rouen, France
Reply with quote
Post Posted: Sat Apr 11, 2015 9:04 am
If what you say about delays and commands may be true, there's another problem with the splitter: it deletes the end of my tracks with no explanation. On looping tracks, it's not a big deal, but it's more problematic with the others. I don't know what's going on and I've already spent too much time with that for nothing. It would be absurd to do it one more time without knowing if it will work when I know you've logged the tracks and will be able to make a nice pack without being mad.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Sat Apr 11, 2015 10:10 am
Just to be clear: vgm_sptd splits when no commands are sent to the sound chip for more than xx samples.
That means it can split in between a long chord, if you choose a "Split Delay" value which is too small. i.e. if there is a chord of 1 second (44100 VGM samples) length and and the Split Delay is 0.23 seconds (~10000 VGM samples).
So you have to enter pretty large values.

For the VGM sherpa posted, 88200 samples (2 seconds) work perfectly fine.
I wouldn't go lower than 1 second in general. Only if you accidentally didn't leave enough space between the songs.

(I wouldn't bother about ~100 samples of silence, btw. That should just be the time the sound engine requires to initialize the song.)

Some notes about vgm_trim:
If you trim without looping (loop sample = 0), the resulting VGM will keep the data of the End Sample. So any Note Off commands from the last frame are kept.
If you trim with looping, it effectively trims from (Start Sample) to (Loop Sample) to (End Sample - 1), i.e. does a hard cut at (End Sample). The "End Sample" is the "Loop Sample" for the second loop, so the data of Loop and End Sample would be redundant anyway.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Jul 2015
  • Posts: 25
  • Location: KZ
Reply with quote
Post Posted: Wed Jul 15, 2015 11:26 am
can you help for find midi to vgm converter?
  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Wed Jul 15, 2015 11:35 am
Yes.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Jul 2015
  • Posts: 25
  • Location: KZ
Reply with quote
Post Posted: Wed Jul 15, 2015 11:54 am
cool! i find two type of converters - why they convert a little wrong? i mean high of each sounds. aaaaaaaa... i think i understand. when instrument plays accords - converter take lower sound in this accord, not whole 2-3 notes.
  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Wed Jul 15, 2015 12:41 pm
I'll try to explain this with simple words since it seems that you can't speak English very well.

In a MIDI file you have 16 channels. Each channel can play more than one note at the same time. This is called polyphony. This allows you, for example, to play a chord of 3 notes on a single MIDI channel, just like you would play those 3 notes with your left hand on a piano.

However, this is not possible in a VGM file.

The number of channels in a VGM file depends on what chip you want to use (YM2413, YM2612, SN76489, ...). If you want to use the YM2413, you have 6 or 9 channels; if you want to use the YM2612, you have 6 channels. However, each channel can only play one note at the same time. This is called monophony.

Therefore, if you have 1 MIDI channel which plays 3 notes at the same time, you need to split it with some tool, and make it so there are 3 MIDI channels which play 1 note each.

If you don't do that, the MIDI to VGM converters will not be able to put more than one note in a VGM channel, and notes will be cut.

I hope this is clear and at least accurate enough.
  View user's profile Send private message Visit poster's website
  • Joined: 30 Mar 2009
  • Posts: 295
Reply with quote
Post Posted: Wed Jul 15, 2015 2:01 pm
Tom is correct.
Also, if you're using PSG and not the FM chip, you might want to be extra careful about the noise channel (midi channel 10), because your notes have to be short, with a clear NOTE OFF command (otherwise it will keep generating noise (white or periodic) indefinitely) and you basically only have 3 types of noise notes.
A2 (low), A3 (mid) and A4 (high) the rest is converted in between.

If you want, i can provide the midis of my GoT conversion, to make you understand better how to go from midi to psg.

http://www.smspower.org/forums/15529-GameOfThronesPSGCover
  View user's profile Send private message Visit poster's website
  • Joined: 15 Jul 2015
  • Posts: 25
  • Location: KZ
Reply with quote
Post Posted: Wed Jul 15, 2015 4:40 pm
about chip - i dont know what exactly i need :)

i just want try to make new sound for Dune - Sega Mega Drive. one man make hack for this game. my idea was add anthem for mentat.

so as i understand - midi must be "fixed" before converstaion. accords must be split, but only for 6 or 9 channels. and this is white noise was reason why export file was 200kb? i think i have old program - sonar - for midi work. later i will add some questions more :) thanks for answers.
DuneHack.gif (93.84 KB)
DuneHack.gif

  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Wed Jul 15, 2015 6:19 pm
The Sega Mega Drive uses a YM2612 and a SN76489 at the same time.

However, if you want to hack a game, please note that you can't do it in this way.

You can't insert a VGM file into a game, not in easy ways at least.

Games use different ways to generate their music output. Those ways are called "music engines". If you want to replace the music in a game, you must use the same music format used by the music engine of that game. Alternatively, you can replace the music engine with another one which can play VGM files, but that would be extremely hard.

The MIDI to VGM converters are intended for playback only -- to have fun with conversions. They have no real serious application.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Jul 2015
  • Posts: 25
  • Location: KZ
Reply with quote
Post Posted: Wed Jul 15, 2015 8:02 pm
i see... i thought this converters make "ready to eat" product.
  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Wed Jul 15, 2015 10:26 pm
Now that I had more free time, I gave a closer look to what you want to do. You can have some chances. As you can see here, the "Dune" video game uses a sound engine called "GEMS", which is one of the few engine researched with good detail. If you perform a "site:forums.sonicretro.org" research on Google, you can find interesting results, such as this, or this.

I never used any of the programs listed in those posts, so I can't tell you if they're good or if they work at all. However, you could have been much more unlucky than this. GEMS isn't the most popular driver in the world, but it got a decent share of research. With enough motivation I am sure you can do what you're aiming for.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Jul 2015
  • Posts: 25
  • Location: KZ
Reply with quote
Post Posted: Thu Jul 30, 2015 1:17 pm
did you know commands and parameter in *.code type file? i have one. it is Lego Tune music from Dune. i try to play it with my own programm by use midi. can you give a little answers about it? i have a big list of questions :)
004.rar (1.36 KB)

  View user's profile Send private message
  • Joined: 15 Jul 2015
  • Posts: 25
  • Location: KZ
Reply with quote
Post Posted: Fri Aug 07, 2015 5:32 pm
i have one more question about vgm and midi. as i know vgm instruments it is combination of parametres:
Feedback FB
Algorithm
AMS
FMS

x4 times:
Detune DT
Multiply MULT
TLevel TL
RateScale RS
Attack AR
A AM
Decay DR
Sustain SR
SustainLevel SL
Release RR
EG

my question is - where i can found this parametres for each instruments of midi? i know pc's midi is a suks and some Yamaha DX7 much better sound - but i want to get much closer to pc sounds of midi. this table of data for 127 instruments of midi is exists? can somebody help to find it?
  View user's profile Send private message
Reply to topic Goto page Previous  1, 2



Back to the top of this page

Back to SMS Power!