ModPlayer - Music on your newton!
Quick Description
This program will play music files (.MOD files) trough your newton's speaker
at 22Khz mono. (The mod format itself is about 44Khz stereo, but the newton
can't do that). A MOD file is a file containing one sample of each instrument
which will be used, and a midi-like collection of note information to play the
song, along with effects to be applied to instruments such as vibrato, tremolo,
and porta to name a few. Alarm and sleep features allow you to use it as an
alarm system!
Features
- 22Khz 16bit Mono output (the best the newton can do)
- You can tap on the song packages themselves and they will launch the player for you.
(Just don't do it if the package is frozen)
- Individually turn on/off channels
- Jump to any location in a song
- PlayModes are Single, Repeat, and Random
- Bass Boost for that crappy little speaker.
- Song information and instrument list viewable in a scrolling window.
- Assembly-code core means mixing happens very fast, and takes less than 1% cpu
- 2.0 only, I believe. I know it works on an MP2K upgraded or not, MP2100, and emate.
- While a song is playing, or paused, the auto-power-off feature is defeated.
- Sleep option to make newton stop playing and sleep after a length of time.
- Alarm option to wake-up newton at a predefined time and begin playing the last
song referenced, and in the last modes selected. Don't forget to set the volume!
- Yup. it's free.
Bugs/Problems
- When playing in 8bit mode on a MP2K or emate, you can hear small pauses. No idea why. (why would you use 8Bit anyway? Use 16Bit!)
- When playing in 8Bit mode, all mixing is performed at 21600Hz (optimum rate for MP2K's). Problem, is, the MP130 plays at 22050, so it's out by 2%. oh, well.
- I have no idea yet whether the 8bit mode even works for MP130's. I added it in hopes that it would work.
- I know that not all effects are working correctly. This can make some
songs sound strange. As I find bugs, I'll post newer versions. I did fix
a big bug lately though, so if you don't have V1.1, get it. More songs will
now sound right.
- Repeat seems to be loosing timing a bit between end of song and start.
- I've recently added more songs. Some of them have a built-in repeat (The author
makes the song repeat himself), there's nothing I can do, really, to stop this.
It means if you have one of those installed and are listening on random, you'll
always eventually find yourself listening to that mod over and over. (It never gets
to the end to trigger the randomizer).
- This little proggie'll suck the life out of your batteries if you use it
too much. (but that should be obvious, it's using the speaker alot).
- Tapping a frozen MOD package thaws it, and begins playing it, but then
The package thinks its' job is done, and closes again, severing the
connection to the player. ARGH! Wat can I say... don't do that?
- My Bass Boost code is shitty. I just look at the note pitch, and
amplify low notes. Sounds good? Well, it really depends entirely on
the sample, how low or high that note is, overall. If you know a good
3 or 5 band graphic equalizer code-snippet I could use to post-process
the mixing buffer, tell me!
Instructions
Launch the player.
Tap the "Select MOD" button, and pick a mod which you have previously
installed. If no mods appear, either your MOD files are frozen (don't TAP
them to play them when frozen!!) or you haven't got any mods on your newton.
You must upload both the mod player app, and the assembly-code package before
it will work (and at-least one song too!!)
The PAL button is for changing the timing, like running on a PAL or NTSC Amiga.
(Depending on where you lived, Europe or America, the timing was diferent, making some
songs play too fast or slow. If it sounds wrong, try changing this. Most songs were
written in PAL).
The 8Bit button is for if playing on the MP130. If you have an MP2K or emate,
leave it unchecked, and you'll get 16bit sound. On a MP130, leave it checked since you
can only have 8bit on that device.
Instructions for putting a .MOD file into a package for the newton
To find mods, go to a search engine, such as Yahoo, and search for something
like "MODS MUSIC",and you should find stuff pretty quick. Currently, this
player only likes 4 channel mods, preferably protracker ones.
This requires experience using the NTK for windows. (You should be able to
do this with the MAC NTK too, but I don't know anything about it).
- Create a project and name it after the mod you are creating
(eg. HighVoltage.ntk)
- Change the application and packge name and the application symbol of the
package to HighVoltage.mod:SIG - The modPlayer searches for packages with
a symbol containing .MOD somewhere in it.
- You might also want to turn on the package compression option, etc. at this
time (and pick an icon maby?) or steal mine - mod-icon.bmp
- Add a clView to the project.
- Change its' viewBounds to all 0's
- Add a slot named aMod, and set its' contents to:
- WINDOWS NTK
LoadDataFile(""&kAppName,'modFile);
Note the class is 'modFile - that's how the modPlayer finds it in the package!
This loads a binary file, in this case, HighVoltage.mod - make sure
you have the mod in the same dir as your NTK project! (or put a path in
the quotes to where the .mod can be found)
- MAC NTK (courtesy Avi Drissman), I hope I didn't mess it up transfering it from my email...
-
OpenResFile(home&kAppName);
a := GetResource("MODf", 0, 'modFile);
CloseResFile();
a;
- Now, move the MOD file into a resource. Using Resorcerer, Open a _copy_ of the MOD,
get info on the data fork, and change the resource type to
'MODf', ID 0. Save the copy in the directory with the project.
Note the class is 'modFile - that's how the modPlayer finds it in the package!
- Add a slot named ViewSetupDoneScript, and set its' value to:
(only needed if you want the mod file to launch the player when tapped)
func()
begin
// attempt to launch the player and tell it to play this file
if isFrame(GetRoot().|modPlayer:RSM|) then
begin
if call kViewIsOpenFunc with (GetRoot().|modPlayer:RSM|) = nil then
GetRoot().|modPlayer:RSM|:Open();
GetRoot().|modPlayer:RSM|:AutoPlay(kAppSymbol, 'aMod);
end else begin
:Notify(kNotifyAlert, kAppSymbol, "Can't play MOD file, ModPlayer Application not installed!");
end;
AddDeferredSend(self, 'Close, []);
end;
- From the sounds of it, the pc version works, I don't know whether there's an error in the mac instructions though... Let me know if there is.
Screen Shots
- Modplayer playing a song...
Changes
- V0.9 -> V0.9.1, March 21, '99
- Fixed: Repeat
- Added a callback system so that player could be tied into newts cape through a helper app.
(Sorry, this caused confusion: This just means I
made it possible for a program such as newtscape to call the ModPlayer app in-order to play a mod.
NOTE that it still requires that the other program [such as newtscape]
implement what's necessary to ask the ModPlayer to play a song!)
- Default playmode is now Single
- Newton will no-longer sleep when a song is playing.
- V0.9.1 -> V1.0, March 23, '99
- *** WORKED AROUND THE CALLBACK PROBLEM, WOOHOO!! ***
- (Also increased the sound-buffer size a bit to help sound not break-up when playing in the
background) - it's a total of 1.5 seconds (~64K of heap, it was previously ~44K for 1 second)
- Fixed: Newton not sleeping if a song is playing, works better now.
- Application is now more display-friendly.
- It's a DragnGo view now, so it doesn't insist on being on top, and can be dragged.
- It's got a minimize button now!
- Removed prints which appear in NTK inspector window if the newt is connected.
- Fixed the end-of-song detection so it shouldn't play a fraction of the start of the song anymore.
- Fixed some samples not playing because loop-length was 0
- V1.0 -> V1.1, March 28, '99
- Program remembers its' last settings now. (with a soup)
- Fixed more asm-code. The player is now able to play more songs that previously sounded screwed-up.
- Added a PAL/NTSC switch (Leave it on the default, PAL, unless the song is playing too slow, most songs are PAL)
- Using Star-Notify code now - the app can shrink into a tiny star atop your screen. (Thanks Matthew Vaughn!)
- V1.1 -> V1.2, April 3, '99 (final version, I hope!)
- Fixed a bug caught by BugTrap when a song ends (didn't hurt, but caused a note to be generated by BugTrap every time)
- Added a Sleep Timer!
- Added an Alarm System for starting music when you want.
- V1.2 -> V1.3, April 4, '99 (really final version, I hope!)
- Fixed a bug in the alarms. A last-minute change bit me in the ass.
- V1.3 -> V2.0b1, April 11, '99 (ok, so it wasn't the final version, I felt inspired again)
- Fixed a bug in the sleep-timer - when an alarm wakes up, the sleep timer wasn't working.
- Fixed another bug in the sleep-timer - when the timeout was changed as volume was fading, the volume was not restored.
- Added an 8Bit button for testing whether player will run on an OS2.0 device, like MP130.
- Added NoiseTracker file support!
- Added StarTrekker file support! (only 4-channel mods)
- Added Bad mod-file detection (won't play files which don't look like probable mods - necessary after adding NoiseTracker files which have no form of identification)
About writing ASM for your Newton
Go To Downloads
Home Page