Page 3 of 5
Posted: Tue Apr 22, 2008 5:58 am
by TmEE co.(TM)
Well, I'm open to all ideas. I will not write a YM2612 and PSG emulator in QuickBASIC 4.5 in which MD Tracker is written (though for challenge I might try someday).
Tinctu said that he'll create a 2x YM2033 (or what's OPN1) LPT board, which I'll support in MDT, also a device called FM beauty will get supported once its finished and I get some dev hardware. FM beauty has onboard CPU which is Z80 so I can adapt my MD engine to it, and also all sample playback issues are solved as there's a CPU and HW sample player. But for other stuff, I may still need to use MIDI drums, or write some Sound Blaster stuff so you could use your own samples...
As for freq tables and such, I finally managed to create them. Shiru, thank you very much for the formulas, with some fixing on one I got exact same values which you got by hand (well, some values are 1 step higher, but it doesn't really matter).
Aslo, as soon as I fix some memory corruption bug (which is related to sound effects playback) I'll add support for vibrato and freq sliding... which will be last effects as I'm out out room for code on Z80 side then.
The DOSbox idea is VERY good. Pier Solar people have been using MD tracker with DOSbox and so far no complaints... the latest 0.4a version is not yet publically available, only to certain people who have expressed their wish to use it.
Also, I was told that MD tracker runs relatively well under Vista too, even better than in XP (!!!)
Posted: Tue Apr 22, 2008 6:21 am
by Shiru
Sik wrote:I know, I know, but see, the circuitery used for the octaves may not be perfect, hence small variations may occur. Probably frequency values would have to be changed a bit (not much, I highly doubt the difference between two octaves would be > 10).
Frequency for note of some octave is a exactly divided-by-two frequency of upper octave. That exactly can be not perfect in simply divider-by-two? Of course there is no perfect (musical) frequencies for notes possible because limited freq. resolution, but same thing with any other sound chips.
I checked pitch of same notes in different octaves long ago, actually. They rarely differs even for one cent.
TmEE co.(TM) wrote:The DOSbox idea is VERY good.
So, if you can add support for modded DosBox in MD Tracker, I'll look into DosBox sources then and try to make mod.
Posted: Tue Apr 22, 2008 7:22 am
by TmEE co.(TM)
If you provide me modded DOSbox, I'll do the rest. Only obstacle for now is the sample playback, need to do some real time mixing (if you want to hear your own samples too, not just MIDI) and that and I can't have it in QB anymore, all timing stuff is for background TMF playback...
One other idea is to have whole MD sound part (YM2612, PSG, Z80) integrated to DOSbox, then I can use TMSE, and not have to write........ nevermind, it gets little complex to handle...
Posted: Tue Apr 22, 2008 10:27 am
by Shiru
I think, it's better to start with just YM2612, and make something to handle samples later. Z80 etc will be really complex, because it must be work in sync with main CPU and also must have own memory (RAM instead of ROM) and some interface to load samples. I think, more HLE solution will be much simpler.
And sort of good news - there is SN76489 emulation already in DosBox (based on MAME source code), as part of Tandy Sound System which it emulated. So you already have something to start with - you can enable Tandy Sound in DosBox and use PSG through 0C0h port.
Posted: Tue Apr 22, 2008 3:24 pm
by TulioAdriano
Seems I'll have to restart my research on sound buffers ASAP and start writing the TMSE WinTracker very soon. I wrote the md_audio.DLL that can interface with any software (I use on Visual Basic and C#) which will be available with my instrument editor when Tiido decides to release it. Same DLL will be used for TMSE WinTracker, I just have the problem with the buffers since I use DirectSound for audio output and most examples on Google are for C++.
Posted: Tue Apr 22, 2008 5:26 pm
by TmEE co.(TM)
Shiru wrote:I think, it's better to start with just YM2612, and make something to handle samples later. Z80 etc will be really complex, because it must be work in sync with main CPU and also must have own memory (RAM instead of ROM) and some interface to load samples. I think, more HLE solution will be much simpler.
YM2612 and MIDI (or SB when I revise my x86 ASM skills) samples... can't be that bad combination
Shiru wrote:And sort of good news - there is SN76489 emulation already in DosBox (based on MAME source code), as part of Tandy Sound System which it emulated. So you already have something to start with - you can enable Tandy Sound in DosBox and use PSG through 0C0h port.
That Tandy Sound is same PSG ? Ok, I never knew that. I'll experiment a little with that... I hope my work PC can handle everything... I don't really want to use my gaming system for any dev...
May I ask where this sudden interest about my stuff came ?
Posted: Tue Apr 22, 2008 5:37 pm
by Sik
Shiru wrote:Sik wrote:I know, I know, but see, the circuitery used for the octaves may not be perfect, hence small variations may occur. Probably frequency values would have to be changed a bit (not much, I highly doubt the difference between two octaves would be > 10).
Frequency for note of some octave is a exactly divided-by-two frequency of upper octave. That exactly can be not perfect in simply divider-by-two? Of course there is no perfect (musical) frequencies for notes possible because limited freq. resolution, but same thing with any other sound chips.
Tell that to the circuitery that makes the analog signal out of it

Posted: Tue Apr 22, 2008 11:48 pm
by Shiru
Sik wrote:Tell that to the circuitery that makes the analog signal out of it :P
None of SMD sound chips has analog circuits, they all completely digital except the DAC (same with most of sound chips at all).
TmEE co.(TM) wrote:May I ask where this sudden interest about my stuff came ?
You can, but I don't know what to answer. I got idea with DosBox and can help with it, so why not?
Ok,
here is first try (pass 'tmf'). I hooked YM2612 but not tested it, because I don't use DOS for long time and don't have anything to write test program. So it will help if you make simple test, something like playing any instrument. Ports:
SN76489 - C0h
YM2612 A0 - C8h
YM2612 A1 - C9h
YM2612 D0 - CAh
YM2612 D1 - CBh
You can also say which devices is not needed, and settings which is best for MD Tracker. I already removed support for IPX, COM, Gravis and some other devices, but leave CD, Adlib, SB, MPU401, etc.
I experience some strange problems with my build - sometimes keyboard or mouse buttons does not work completely (and sometimes work). I don't know if it my local problem, or problem with build, etc, so test it too.
Current configuration file assumes that you have /mdtrk/ folder in same folder with DosBox and have mdtrk.exe in it. In this case starting DosBox causes to start MDTRK and after quit from it DosBox closes too.
Posted: Wed Apr 23, 2008 1:58 am
by Sik
Shiru wrote:Sik wrote:Tell that to the circuitery that makes the analog signal out of it

None of SMD sound chips has analog circuits, they all completely digital except the DAC (same with most of sound chips at all).
Then how do you get sound? I mean, somehow the sound must be converted as an analog signal in the end

Oh, just forget this... >_>
Posted: Thu Apr 24, 2008 9:33 am
by TmEE co.(TM)
Problem no 1 - It says it won't run in 98SE, so I booted into XP and...
Problem no 2 - It won't start, says its missing something... what version of DOSbox did you use (I have 0.72 installed, and I guess you used something newer thus I get errors....) ?
I prefer to use software that runs 98SE as its my primary OS, I hate XP... so slow and doesn't like DOS much...
Posted: Thu Apr 24, 2008 9:58 am
by Shiru
TmEE co.(TM) wrote:Problem no 1 - It says it won't run in 98SE, so I booted into XP and...
I did nothing for that. Maybe it's because latest VC.NET which I forced to use to compile that. I'll check later.
TmEE co.(TM) wrote:Problem no 2 - It won't start, says its missing something... what version of DOSbox did you use (I have 0.72 installed, and I guess you used something newer thus I get errors....) ?
It's usual 0.72. Maybe, you forgot about 'sdl.dll'? If not, that exactly is 'something' that missing?
I don't have Win9x and telepathic skills, so more detailed information can help to solve problems faster.
Posted: Thu Apr 24, 2008 10:21 am
by TmEE co.(TM)
I put the DOSBOX.EXE from you over a fresh install of DOSbox 0.72 and I got same error : the application is missing components, reinstalling it might fix the problem (or something similiar). No other info... all files were there, including SDL.DLL
Posted: Thu Apr 24, 2008 2:02 pm
by Shiru
Well, I found that Win9x and NT support was removed in VS2008. Try same link again, I now built this with VS2003 (also includes sdl.dll which I built too).
Posted: Thu Apr 24, 2008 4:57 pm
by TmEE co.(TM)
keyboard doesn't work (seems like its always handling DOSbox needs ?), but PSG works just fine, I've added full support for it in MD trk. I'm gonna try YM2612 a bit later.
Things MD Tracker needs :
Keyboard (it only reads port 60h, doesn't use any DOS functions for it)
Mouse (which works fine already)
MPU-401 (only UART mode)
LPT port (not yet, but will make use of it)
Sound Blaster (not yet, but will most likely make use of it)
There's one issue with Programmable Interval Timer - for some reason, in XP(and probably other new OS) and in DOSbox, touching it will result in hyper fast time, never happens in pure DOS or Win9x...
Also, could you add some fake I/O port which I can use to know when MDT runs in this version of DOSbox so I can disable unneccesary I/O stuff (PSG, YM2612) (I'm not making more than one version of MDT) ?
Posted: Thu Apr 24, 2008 5:16 pm
by Shiru
TmEE co.(TM) wrote:LPT port (not yet, but will make use of it)
Is DosBox emulate LPT already (don't see that in sources)? Don't forget, emulator works not in realtime, so you can't rely for exact timings when access to LPT from emulator.
TmEE co.(TM) wrote:Also, could you add some fake I/O port
Yes, I already thought about that.
How fast this mod works on your machine (not slower than official 0.72?), and which best settings you found?