I give you, S3M 2 HSS
Sachiel7
Posts: 41
Totally digging that rockin' HSS but wishing you could have an all-in-one simple tool for converting your music?
Well my friends, wish no more, I give you S3M2HSS.
S3M2HSS is a simple tool that will convert any 4 track, 8363 Hz sample - based S3M and shoot out a nice hot, fresh HMUS file for you to load onto your prop and jam out. Or game out. Whatever your fancy.
It also includes instrument-specific resampling and will (in the future) support RMUS files. RMUS is a new format for HSS +Retro Mod, which is basically a stereo HSS mod. RMUS retains all panning and shifts in S3M files.
Anywho, enough talking, more Converting!
I've included 2 short little songs I keyed up in a jiffy just to test out the system.
Please, please leave me some feedback, I'd like to continue supporting this (and fixing any bugs that may still be crawling within, though I haven't seen any in a while!)
Make sure you do a quick check through the Help/About just to get some quick pointers for setting up your S3M files.
Enjoy!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
Well my friends, wish no more, I give you S3M2HSS.
S3M2HSS is a simple tool that will convert any 4 track, 8363 Hz sample - based S3M and shoot out a nice hot, fresh HMUS file for you to load onto your prop and jam out. Or game out. Whatever your fancy.
It also includes instrument-specific resampling and will (in the future) support RMUS files. RMUS is a new format for HSS +Retro Mod, which is basically a stereo HSS mod. RMUS retains all panning and shifts in S3M files.
Anywho, enough talking, more Converting!
I've included 2 short little songs I keyed up in a jiffy just to test out the system.
Please, please leave me some feedback, I'd like to continue supporting this (and fixing any bugs that may still be crawling within, though I haven't seen any in a while!)
Make sure you do a quick check through the Help/About just to get some quick pointers for setting up your S3M files.
Enjoy!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
zip
262K
Comments
I am about to release my own project based on HSS.
[noparse]:)[/noparse]
Thanks for your addition.
Also, I put a post on the "Projects" page in the Hydra forum, linking to this thread.
Looks like I need to update the projects page...
(I know what I'll be trying out later tonight.)
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
I'm getting hung up on converting samples to 8 bit.
I'm assuming you are using Audacity? Can you share what you are using and
some details on how to accomplish this?
Thanks
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
What I typically do to convert samples is open the s3m in ModPlug, export all the Samples to wav files, open them in audacity and resample them at 8363 Hz, then reload the resampled files into the s3m in ModPlug, and trim them. Then I convert them to 8 bit as above, and set looping points, if necessary.
I wouldn't mind adding support for 16 bit samples in a future version of S3M2HSS, but I'm not sure where the S3M file stores the Sample's bit rates (if it does). I have to double check my documentation, but it wouldn't be hard for me to add.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
If you go to Edit>Preferences in Audacity, under the file formats tab you can choose to export *.wav in 8 bit PCM format.
I haven't tried this, but I believe it should work fine. Lemme give it a try...
EDIT: Yes, this method works properly. Make sure that you set your project rate in audacity to Custom>8363. Once you export your *.wav, you will probably want to re-open the exported file and trim it as Audacity preserves the original sample length, so there's typically a long period of silence on the end of your resampled files. You can do this in ModPlug as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
Post Edited (Sachiel7) : 8/7/2009 12:58:12 AM GMT
Right-click on the sample itself.. Duh.. I was making it too difficult.
Here's one that I've attempted to convert, but for some reason it crashes your program.
Perhaps a bug?
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
EDIT: I think I'll add a warning dialog in the next release if there's more than 16 samples.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
This has raised a few notes for me to mention:
-Only 16 samples. It seems S3M files are notorious for using empty samples with parts of the file comment as their name.
I'm going to most likely add code to v1.1 that skips these, and warns the user if there are more than 16 nonempty samples.
-Arpeggio effects aren't supported by HSS (as far as I know). This is any Jxx command, so things like track 4 in Oldbitcollectors sample will not play anything but a solid note. HSS recognizes the command JCC as a standard Tremolo. More documentation on effects is under the Help/About tab in the program.
I am still trying to find out why ModPlug won't remove empty samples. Sometimes it will, sometimes it won't. I think that it has to do with the file comments being stored there, but even if a sample doesn't contain a comment, it doesn't always delete. I think I'm gonna have to make a post over on the ModPlug forum about this one...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
before I go to work... So let me know if these work for you guys. [noparse]:)[/noparse]
OBC
Files failed: removed
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Post Edited (Oldbitcollector) : 8/7/2009 11:14:31 PM GMT
Looks like all of those files are too large for HSSPLAY (>32K), so wouldn't be able to get those to work.
Maybe it is the samples getting included making them large?
--trodoss
I'll play with them more tonight..
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
In my files, Samples typically account for ~70% of HMUS size, and song data ~30% (For a longer track, like Mohauk in the included samples)
You can check out the sample tracks I included and kinda compare sample lengths/ song length to the result file to get a feel for file size results. I try to keep sample length around 4000 at a max, and if I have one or two that are that big, that means the rest need to be tiny. With that methodology and about ~5/6 instruments, a long song of mine weighs in around 8-9k, give or take a few bytes.
Another trick that's easy to use, is if you want that Retro feel, or you're sampling some 8 bit era music, you can have some REALLY short samples for Square, Sin, Saw, Noise, (like a single period of the waveform sampled at the frequency of whatever you want C5 to be, then resampled to 8363 Hz) and you're good to go. I think traditional 8 bit systems like the NES had 1 Tri channel, 2 Sqr channels, and a Noise channel. Those kind of music files tend to be ~2K at the most in my experiences. Yet another trick you can pull in HSS is to load multiple sets of Song Data, but reuse the same samples. Just stop playback, change the pointer to the song data, and restart playback. That gives me an idea...
Perhaps I can add an option to S3M2HSS for a HSNG file export. This file would ONLY be SongData used by HSS.
Then you could just add a function to HSS like, PlaySong, which in pseudo-spincode would be sonething like:
Where songptr is @Song.HSNG and Song_Buffer is the first HMUS file that contains the samples.
In fact, I'm pretty sure you could make an HMUS with no Song Data (no notes/patterns, etc) just to store samples. S3M2HSS would simply write the first commands as v64 for all tracks, then Song End. You could then cue up the actual song data you want to play with something like PlaySong() above.
I think this will definitely make it into a future version of S3M2HSS.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
For some reason my song is playing about 25% faster than expected.
Perhaps I clipped my samples too much.. but it fits. and plays under hssplayer
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
@Sachiel7: Any advice on a painless way to create extremely lowfi .wav files?
Ghostbusters II for HSSPLAY
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
What I typically do for samples is this:
-Load up a base sample in ModPlug, like dragging an instrument in from a Midi bank, or a Soundfont.
-Try it at C5. HSS only covers the range C2-B6, so sometimes you may want to make a note if you want to
shift the sound up or down an octave, depending on the range you want to get for that sample.
-In ModPlug, export the sample as a Wav file.
-Open the wav file in Audacity.
-Set the Project Rate (Bottom Left in the main window) to Custom > 8363.
-If I need to apply an octave shift, or any other effects (sometimes I fade off a sample early to trim it shorter) I do these now. You can octave-shift in Audacity under Effect > Change Pitch, and use semitones. I should note here, that we haven't converted our sample to 8363 Hz yet. You tend to get the best final sound when you apply all your effects, shifting, etc before converting the rate. Sometimes I'll mix two samples as well, as with my example file 'Rockit', the strings/choir are two separate samples mixed to one. If you have two instruments that will play the same notes all the time, this is a sneaky way to add more sound to the mix. This usually happens with multiple instruments in the same range. (Bass, Mid, Treble)
-Once all is set, I export the WAV to a new WAV. I usually add a suffix of '2' to my files.
-In ModPlug, load the new Wav in the sample window.
-Audacity will leave alot of silence at the end of the sample, because it preserves the original sample length of the original bitrate. Select the waveform & a little silence on the left and Right Click > Trim. Repeat this until your sample is trimmed properly.
-Try the sample again at C5. If it sounds any different in tone than the original, then something is wrong (as long as you didn't pitch-shift it.) Also note the Length of the sample in the sample window. I try not to exceed 4000 for a single sample, and having several close to that number will eat up Ram fast.
-See if you can shorten the sample if it's too long. Sometimes you can get away with trimming a sample really short and looping it (easily done with basic waveforms) or trimming it shorter and looping the end (better for more complex sounds, sometimes) or sometimes just making it shorter in general. As I said above, sometimes I'll trim it down and fade off the end, and it still sounds ok.
-Right click and Convert to 8 bit, if Audacity hasn't already exported 8 bit (see above post for 8 bit Audacity WAV export settings)
At this point you should be good to go. You can calculate the size of samples in your hmus by:
(Sum of all sample lengths) * HMus bitrate (8 bits or 4 bits).
I try to keep my files to an 8K size, so I can have a dedicated 8K HSS buffer in memory, and load in and out of it from EEPROM or Serial (I have 4x1MB of Dedicated Runtime EEPROM storage on the Retrosys, as well as dataflash for primary storage).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
I've attached a version of Fletch1 that has the initial speed set to 7, and a reconverted HMus at 4 bits.
I'm glad to see that the tool is working OK, and not crashing on everyone! lol. Honestly, this is probably the first time I've released a more 'public' utility.
EDIT: One more thing I wanted to mention to anyone following this thread; above I stated that HSS doesn't do arpeggio. I'm not sure its true arpeggio but I tried some of the effects out today, and the tremolo effect, JCC (which is arpeggiation in S3M) sounds pretty close on HSS. Thus, my statement before about track 4 of Skate.s3m is probably wrong. I believe if you replace all the Jxx commands with JCC in track 4 of Skate it will sound close. I might give it a try later tonight just to see (I'm still trying to get these effects down, I wish ym2413a was around to answer a few questions...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
Post Edited (Sachiel7) : 8/8/2009 1:24:41 AM GMT
I'm betting this .s3m file breaks a lot of rules... It's very SID sounding.. [noparse]:)[/noparse]
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Yeah a lot of interesting tracker commands aren't supported in HSS. Memory needed to be saved to fit everything in the 2.7k foot print. :P
A lot of neat effects can be still down with sample tricks though. [noparse]:)[/noparse]
Thanks all!
--Andrew Arsenault.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Share the knowledge: propeller.wikispaces.com
Lets make some music: www.andrewarsenault.com/hss
I don't know if this converter supports 4bit samples. But they work well for things like Hit-hats and high pitched synth sounds. [noparse]:)[/noparse]
8bit samples work well for bass instruments.
Thanks! [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Share the knowledge: propeller.wikispaces.com
Lets make some music: www.andrewarsenault.com/hss
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
ym2413a, my converter lets you choose a sample by sample conversion rate. You can choose 4 or 8 bit sample rates. That way you can choose to make low frequency samples 8 bit, while downrating high frequency ones, if you choose. I tend to just convert all my samples to 4 bit.
I'm glad you guys are sharing your S3M's with me, I tend to convert songs I've written with the converter in mind, so I'm less likely to catch bugs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
There was a call to instrument #18. Even though there are only 14 instruments in the file (which should be ok) the file called instrument #18. For what reason, I dunno. I've noticed this happening in a few s3m's. That or you already trimmed the file down to < 16 instruments.
I will make a note to have a fix in the next version for this.
I only allot a byte for all commands to HSS. The way I build an instrument command (for instruments over #8) is: (Channel | Convert.ToByte(newInstrument - 8 << 5) | 0x10). Since HSS has only 16 instruments, this works fine, but if newInstrument > 16, the left shift overloads the command byte. I'll just add detection to skip command calls for instruments over 16.
Thanks for bringing this up. You should be able to convert that file as is by just removing any instrument calls > 16.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-
Yes, many of the decent mod, s3m, etc files do not regard a limitation like we have imposed on ourselves. [noparse]:)[/noparse]
Being able to easily strip excess samples out without having to parse the file will be very helpful!
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
-Empty sample removal/ignorance
-Automatic handling of > 16 instruments, both in the file in general, and calls to instruments > 16
-HSNG export option - only export song data file. Use with a HMUS that has no pattern data but samples to swap out different songs that use the same samples.
I'd also like to add support for files that have 16 bit samples, the only problem is that I can't find anywhere within the S3M file that it stores this information. I could easily add a check box for it though, but I need to do some more research of how S3M's are structured with those kind of samples. They would still have to be downrated to at least 8 bits.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-=Sachiel7=-