PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

New modplayer... UPDATE!!! (08/29/04)

Hello!

For those who are interested in my little modplayer application,
i added a position slider, volume control, S3M support (preliminarily) and fixed some minor replay bugs.

The download URL below is still valid but i'd also like you to visit the new MilkyPlay home:
http://oldschool.voodoofrog.com/

Download URL:
http://peter.nxbone.net/download.php?file=MilkyPlay.zip

Regards,
Peter
Attachments:
milkyplay_pic2.jpg
milkyplay_pic1.jpg
Hi Peter,

Great job! I tried Milky Play on my Axim X5 and it works perfectly. You did a very nice job of coding on this one. The output is crystal clear. Honestly, I wish I knew how to code this kind of application.

Anyway, for a first pass, it looks like a winner!
:D
Worked fine for me as well (axim x30). I even played the songs from Lejjo on it and they sounded identical (well, maybe better) than the ingame sound using Hekkus.

I did get a little section of un-updated screen when switching to the 'small' screen mode. I think it may have been something on the today screen that did update - so it's probably not really your program's fault.

Speaking of the small mode - why not let the user move it up or down a bit so they can see some of the today screen stuff?
BapDude wrote:Hi Peter,

Great job! I tried Milky Play on my Axim X5 and it works perfectly. You did a very nice job of coding on this one. The output is crystal clear. Honestly, I wish I knew how to code this kind of application.

Anyway, for a first pass, it looks like a winner!
:D

Thanks for the compliment. Coding it wasn't really difficult although i spent lots of time listening to modules and comparing it to other players (but i did that back in 1997 already ;))
fast_rx wrote:Worked fine for me as well (axim x30). I even played the songs from Lejjo on it and they sounded identical (well, maybe better) than the ingame sound using Hekkus.

I read a lot about Hekkus and i guess it's a much more professional library for playing SFX as MilkyPlay.
One thing i always wanted to know is how do you achieve a continuous audio stream in Hekkus? Do you have a separate mixing thread or do you mix the next buffer in the waveOut callback function?
fast_rx wrote:
I did get a little section of un-updated screen when switching to the 'small' screen mode. I think it may have been something on the today screen that did update - so it's probably not really your program's fault.

Well all i do is a SetWindowPos() call so i guess there's not much i can do about this :(
fast_rx wrote:
Speaking of the small mode - why not let the user move it up or down a bit so they can see some of the today screen stuff?

I actually tried to let the user set the windows' position with the stylus but it caused so much flicker so i decided to dismiss it.

Regards,
Peter
xPeterx wrote:
I read a lot about Hekkus and i guess it's a much more professional library for playing SFX as MilkyPlay.
One thing i always wanted to know is how do you achieve a continuous audio stream in Hekkus? Do you have a separate mixing thread or do you mix the next buffer in the waveOut callback function?


Sincerely Hekkus was a big hack at the beginning, it was a port of a player that I have written for the gameboy advance, I have always loved that little machine.
Now it is a little more polish and I have written an api with c++ objects that should be more easy to learn than a simple c library, IMHO of course!

On Hekkus I was using a thread to provide continuos audio stream, than I have discovered that some new ppc models have problem with that on power on/off (the device hang). Now I'm using a two step procedure with a thread and the waveOut callback function, something similar to what are used on the sdl library.
In theory you aren't suppose to update your sound stream with the waveOut function, at least this is what are written on the msdn reference, but it seems to work, at least on ppc :)
gersen wrote:
Sincerely Hekkus was a big hack at the beginning...

Sounds exactly like my story :)

As for the callback question i must confess that i've always been mixing the next buffer to be played in the waveOut callback function and never had any problems.
(even under win95 with a very lousy Gravis Ultrasound driver)
The only problem with this method is that it interrupts the current process until the mixer has finished computing the next buffer (which might take a while in case of a 32 channel song)
Excellent work. Love the GUI and the visuals. Behaves really well when running other programs in the background. Even when copying things to the PDA. No stuttering or anything, very impressive :)

Had a few issues with a couple of modules not playing quite right, but thats the only problems I've come across so far.

BTW, are there any plans to support screamtracker s3m modules? Other additions such as a sliding progress bar and volume control like in Cybermod would be nice too :wink:

Excellent start though, keep up the good work! :D

Cheers,
Richard.
Yes !!
A good fasttracker player for PPC.
Thanks
Some comment:
- sound is buggy with onward/jugi (module from the 'complex' demo: dope) http://www.modarchive.com/cgi-bin/downl ... /onward.xm

- could you associated .xm & .mod files to your player ?

Code:
RegFileInfo(g_hInst,"xm", IDI_APP); // where g_inst is the global instance of your sofware (specified in the WinMain)
RegFileInfo(g_hInst,"mod", IDI_APP); // & IDI_APP is the reference to your icon in your ressources

void RegFileInfo(HINSTANCE g_hInst,char *ext,int idi_app) // IDI_APP
{
TCHAR szBuff[MAX_PATH + 32];
TCHAR szModule[MAX_PATH];
GetModuleFileName(g_hInst, szModule, MAX_PATH);

TCHAR wExt[32], wFile[32+4], wCommand[32+15], wIcon[32+10];

TCHAR wDefault[256];

_tcscpy(wDefault, _T("Default"));

TCHAR t[32];

mbstowcs(t, ext, 32);
_tcscpy(wExt,_T("."));
_tcscat(wExt,t);
mbstowcs(wFile, ext, 32);
_tcscat(wFile,_T("file"));
_tcscpy(wCommand,wFile);
_tcscat(wCommand,_T("\\Shell\\Open\\Command"));
_tcscpy(wIcon,wFile);
_tcscat(wIcon,_T("\\DefaultIcon"));

DWORD dwSize;
HKEY hKey = 0;
DWORD dwDisposition;

if (RegCreateKeyEx(HKEY_CLASSES_ROOT, wExt, 0, _T(""),
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey;, &dwDisposition;)==ERROR_SUCCESS)
{
_tcscpy(szBuff, wFile);
dwSize = (_tcslen(szBuff) + 1) * sizeof(TCHAR);
RegSetValueEx(hKey, wDefault, 0, REG_SZ, (LPBYTE)szBuff, dwSize);
RegCloseKey(hKey);
}

if (RegCreateKeyEx(HKEY_CLASSES_ROOT, wCommand, 0, _T(""), REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey;, &dwDisposition;)==ERROR_SUCCESS)
{
wsprintf(szBuff, _T("\"%s\" %%1"), szModule);
dwSize = (_tcslen(szBuff) + 1) * sizeof(TCHAR);
RegSetValueEx(hKey, wDefault, 0, REG_SZ, (LPBYTE)szBuff, dwSize);
RegCloseKey(hKey);
}

if (RegCreateKeyEx(HKEY_CLASSES_ROOT, wIcon, 0, _T(""), REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey;, &dwDisposition;)==ERROR_SUCCESS)
{
wsprintf(szBuff, _T("%s,-%d"), szModule, idi_app);
dwSize = (_tcslen(szBuff) + 1) * sizeof(TCHAR);
RegSetValueEx(hKey, wDefault, 0, REG_SZ, (LPBYTE)szBuff, dwSize);
RegCloseKey(hKey);
}
}


- and why do you refresh screen each time ? For instance, buttons don't not need to be refreshed at each frame. It take a lot of CPU for nothing.
laxity wrote:Had a few issues with a couple of modules not playing quite right, but thats the only problems I've come across so far.

Can you send me those modules with a short description of the fault? (song position maybe?)
laxity wrote:BTW, are there any plans to support screamtracker s3m modules? Other additions such as a sliding progress bar and volume control like in Cybermod would be nice too :wink:

I'm planning to support every format i can find specs for, s3m is next on my list.
As for the progress slider, that was in my mind too but i didn't really know where to put it ;)
(but i'm definitely going to implement a volume control)
redbug wrote:Some comment:
- sound is buggy with onward/jugi (module from the 'complex' demo: dope)

Got that song already, although i never got the impression that it sounds wrong...
Can you tell me exactly where it sounds wrong?
redbug wrote:- could you associated .xm & .mod files to your player?

Now that you've sent me the code :)
redbug wrote:- and why do you refresh screen each time ?

Just because of laziness ;)
From 11% (on my ipaq 5450)

But forget it.. I do a soft reset of my ipaq, and all was right after that.

Good work :)
xPeterx wrote: Can you send me those modules with a short description of the fault? (song position maybe?)


1. Right at the beginning of the module "full moon end" one of the drum beats is missing :

http://www.modarchive.com/cgi-bin/downl ... llmoon.mod

2. Glitches at positions 43sec, 50sec, 56sec, etc in the module switchback1 :

http://wuarchive.wustl.edu/pub/aminet/m ... ckMods.lha

xPeterx wrote: I'm planning to support every format i can find specs for, s3m is next on my list.


There are some specs and source code for many formats on this web page if it helps :

http://exotica.fix.no/tunes/formats/


Cheers,
Richard.
@RedBug:
I've uploaded a newer version that associates itself with the supported filetypes and stores the last settings in the registry.
Hope it helps.

@Laxity:
I fixed the fullmoon.mod bug in the latest version. Tomorrow i will listen to the other module...
Thanks for the links, i'll take a look!

Regards,
Peter
Since there are so many module fans around here, how about if someone would port a PC soundtracker to PPC so that we could make mod music on the go?

Protracker works on PocketUAE but it's a bit too slow and limited for real use.

/clickdev
clickdev wrote:Since there are so many module fans around here, how about if someone would port a PC soundtracker to PPC so that we could make mod music on the go?

Not a bad idea actually... I wonder how many people want something like this! Maybe we should start a poll ;)
clickdev wrote:Since there are so many module fans around here, how about if someone would port a PC soundtracker to PPC so that we could make mod music on the go?

Protracker works on PocketUAE but it's a bit too slow and limited for real use.

/clickdev

Maybe modplug tracker could be a good base:
http://www.modplug.com/modplug/download ... e&session=

Olivier has released the source code for the MODPlug Tracker under the GNU public license.

xPeterX: Thanks for the update
If modplug was successfully ported to PPC I'd poop my pants... seriously.
Peter,

Just want to say thanks for the latest updates
to milkyplay on your site :) Keep up the good work!!
Off to test the newest version now :D

Cheers,
Richard.
I just wanted to say that i spent the last week rewriting the mixer-core and it turned out pretty well.
The new mixer has a much better click-removal and is also MUCH faster.
A new version is going to be released this week with support for some more fileformats.

Regards,
Peter