Noob's investigation of VGM and DMF and SMD audio drivers

For everything that's not in any way related to PureBasic. General chat etc...
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Noob's investigation of VGM

Post by wilbert »

SeregaZ wrote:and probably this one:
https://www.youtube.com/watch?v=EtceMig ... D9&index=2
problem place i think 23-24-25 seconds, where note need to be go down.
Sorry. I looked at your code but I don't know how to help.
I'm not familiar with Sega Mega Drive.
What I could try is to compare a C or C++ source with a PB source if it's a straight conversion and see if something went wrong with the conversion but your code doesn't look at all like the original C++ source.
Variable names, procedures, the code itself, everything is very different compared to the original source.
Windows (x64)
Raspberry Pi OS (Arm64)
SeregaZ
Enthusiast
Enthusiast
Posts: 617
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: Noob's investigation of VGM

Post by SeregaZ »

it is because that my friend is explaine by words what it need to happen. only later he make his port with this C++ from Z80.

about port i am not realy understand many thing from that C++. and i am not have external files, that it takes. i have asm file - so i am parse asm, not bin. and most unanderstandible things - it is counter with timer. how it decides with cycle need to run FM part, where is no need - not clear for me. but another parts is fine. probably i can make some dirty port... but as i am say - not clear how that counter deside wich one cycle is going to one place, wich one to another...

btw - you didnt know that Z80? becouse we need to make some changes in that original audio driver of Rock Roll Racing. now it is not support samples and FM music playing at same time. it is timers and procedures problem. but we cant to do this correct yet :)

next item, that i want to ask: i remember you are try to make samples playing with PSG core, that you do. SN9***... how it names. it is passible to make some sample playing procedure by sending 1 byte per 125 microsecundes? i think this 125microsec is 8000kbs frequency. 1000 millisec / 8000 = 0.125 millisec = 125 microsec. i mean not inside that your module - i mean same task. how this is happen at all?

i will try to make "dirty" port.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Noob's investigation of VGM

Post by wilbert »

In the '80s we had a MSX which has a Z80 processor and a AY-3-8910 chip for sound.
I am not familiar with the OPN2 chip SEGA used.
I did try a SN76489 port years ago but that chip was easier and I haven't done anything with it since then.
SeregaZ wrote:it is passible to make some sample playing procedure by sending 1 byte per 125 microsecundes?
I think it should be possible.
If the audio sample is 8 bit, 8000 Hz, mono, you should be able to output 1 byte every 125 microseconds.
Windows (x64)
Raspberry Pi OS (Arm64)
SeregaZ
Enthusiast
Enthusiast
Posts: 617
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: Noob's investigation of VGM

Post by SeregaZ »

i am start to do this... and stop after 5 min of work :) not clear many things. i am write a big post with my whining... and questions about original code. but then delete all of it. this code too dificult. my old wrong code play fine, but i have problem with pauses counting. it is not clear how to count that pauses from original code. probably it is one very small timer with a two counters. one is constant Timer B and it rule by slides bend and follow commands. second is BPM. next wrong item - i am take original patterns and fill them into big array, then play array, not patterns itself.


but now main quesion is: all of this time i am finish converter midi 2 deflemask. result of that work still making me smile over all my face. then we decide to make converter from midi to RRR audio driver (it have some name that driver, but i dont remember :) so RRR audio driver is fine - Rock n Roll Racing). next, on base of that converting we make deflemask to RRR. then it comes problem, as always they comes to me: slides. deflemask have a tonns of effects. RRR have only part of them. i have not idea how to make autorecount all effects from deflemask to RRR - that is why i want to use this RRR player. concept of that programm is:
Image

it load text asm file, then you scroll at that moment, which one is interest you and write bend and follow commands by manualy and hear what happen. it will no need to build rom every time, as it now happen. it will be fix that problem with deflemask's effects converting.

but then comes second - big problem :) size! it have less than 3kb size for all song. driver have some tricks - it cut original tracks to patters, that can repeat. my converter cant to do this. so my question is - have you an any idea how to make search and compare procedure?

i have a text:

Code: Select all

command 1
command 2
command 4
command 8
command 2
command 1
command 8
command 2
command 1
command 8
command 2
command 1
command 1
command 2
command 4
command 8
command 2
command 1
how to teach programm do from that to some kind of this:

Code: Select all

command 1
command 2
command 4
pattern1: -repeat 3 times
command 8
command 2
command 1
endpattern1:
command 1
command 2
command 4
call pattern1
i mean search same plaсes?
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Noob's investigation of VGM

Post by wilbert »

SeregaZ wrote:have you an any idea how to make search and compare procedure?
At the moment I don't have an idea but I can think about it.

I suggest you post this particular question as well in the "Coding Questions" part of the forum with a topic name like for example "Detecting repeating patterns".
There are probably other users who know a lot more about detecting repeating patterns.
By asking this in your "Noob's investigation of VGM" topic in the "Off topic" part of the forum, there might be a lot of people who aren't reading your question.
Windows (x64)
Raspberry Pi OS (Arm64)
SeregaZ
Enthusiast
Enthusiast
Posts: 617
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: Noob's investigation of VGM

Post by SeregaZ »

but one of the final targets is - VGM to ... (GEMS, RRR, Deflemask) converter :) it is part of investigation.
SeregaZ
Enthusiast
Enthusiast
Posts: 617
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: Noob's investigation of VGM

Post by SeregaZ »

about original RRR code (not original, but cpp port) - it creates wav output file, but not plays. maybe i can install all of that studio... but i dont know wich one and make a little changes into that original code? to write not in a file, but memory. and start play from memory - like winapi can do. and make it as dll. so idea is attach it to PB project and use as dll for playing short parts, that user is edit at this moment.
SeregaZ
Enthusiast
Enthusiast
Posts: 617
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: Noob's investigation of VGM and DMF and SMD audio driver

Post by SeregaZ »

wilbert, have you discord? we can show of progress of work :)
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Noob's investigation of VGM

Post by wilbert »

wilbert wrote:
SeregaZ wrote:have you an any idea how to make search and compare procedure?
At the moment I don't have an idea but I can think about it.

I suggest you post this particular question as well in the "Coding Questions" part of the forum with a topic name like for example "Detecting repeating patterns".
There are probably other users who know a lot more about detecting repeating patterns.
By asking this in your "Noob's investigation of VGM" topic in the "Off topic" part of the forum, there might be a lot of people who aren't reading your question.
I thought about it some more.
Maybe you could use the LZW algorithm or a trie to find repeating patterns.

https://en.wikipedia.org/wiki/Lempel-Ziv-Welch
https://en.wikipedia.org/wiki/Trie

At the moment I need most of my time and energy for other things as coding.
I don't mind doing small things but for now it's taking me too much time to find and code a complete solution for this problem.
Like I said before, this is a general problem not specifically related to VGM.
There are other forum users who have knowledge about compression or a trie who could help out but if you don't want to ask it in another forum topic, that's your choice.
SeregaZ wrote:wilbert, have you discord?
No, I don't have it.
I never heard of "discord" before. :shock: :)
Windows (x64)
Raspberry Pi OS (Arm64)
SeregaZ
Enthusiast
Enthusiast
Posts: 617
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: Noob's investigation of VGM and DMF and SMD audio driver

Post by SeregaZ »

it some kind of chat. can start with client on PC, phone or other devices and can be start with browser. it is not very well for history, because that chats not index by google. but it nice for chat :)

thanks about patterns, i will study it.
SeregaZ
Enthusiast
Enthusiast
Posts: 617
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: Noob's investigation of VGM and DMF and SMD audio driver

Post by SeregaZ »

heh... stuck again.

Deflemask have some 03 effect. for example it have two notes. C and D. C is starts normal, without effects. but D have this 03 effect. it means note C starts and play his length as it is, but then comes note D - C is not stop, it is continue play, but it start change C frequency into D frequency, with some speed, that was set as parameter of 03 effect. and this effect can be sets for multiple notes. i mean starts C, then start to change frequency into D, then comes third note - start comes into that third note frequency... and etc.

now final target of converting is driver GEMS. it no have this effect. it can have some "modulation". it have some timer and speed parametres. for this GEMS i am make all cases, what i can, but this 03 effects is too dificult for count :(
SeregaZ
Enthusiast
Enthusiast
Posts: 617
Joined: Fri Feb 20, 2009 9:24 am
Location: Almaty (Kazakhstan. not Borat, but Triple G)
Contact:

Re: Noob's investigation of VGM and DMF and SMD audio driver

Post by SeregaZ »

https://www.dropbox.com/s/gcjz36iw1imo7 ... g.zip?dl=1

archive with converter. and deflemask's file with demo effects. problem place is marked with ;- THIS EFFECT read and ;- THIS EFFECT write

it have two stage. first read deflemask and some counting - delays and durations, and second one - write file with more fine counting delays and durations and define them. it will convert in GEMS folder file with extention .code - it is note page, with events. place, that need to recount with modulation will be marked in that code file as nop ; it need 03 mod with 10
Post Reply