DefleMask Forum

DefleMask => General => Topic started by: Fragmare on March 08, 2017, 04:20:51 pm

Title: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Fragmare on March 08, 2017, 04:20:51 pm
A friend and I, zeromus, got together and made a little program + bat file that will rip PC-Engine DMW wavetable files from any standard WAV file.  It's not a plugin, but a standalone program that uses SoX (free, tiny, command line based).  Just install right into your Deflemask/wavetables folder, and then all you do is drag and drop a WAV file onto the BAT file.  It will ask you what sample rate you want to resample to (you'll need to calculate this beforehand), and then spit out 5-bit PC-Engine wavetables in DMW format.  It also creates a TXT file with each wavetable's decimal values logged to a separate line.  Here is the link on GitHub:

https://github.com/zeromus/chipifier/tree/master/bin/Release


Here is a link to SoX, if you don't already have it (required by Chipifier app):

https://sourceforge.net/projects/sox/
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: SpoonyBard on March 08, 2017, 10:54:01 pm
This looks super interesting! Though, I could use a bit of assistance with some of the directions.
When I enter a WAV file into the program, where does it show up, and how do I know if it worked properly?
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Fragmare on March 08, 2017, 11:56:06 pm
This looks super interesting! Though, I could use a bit of assistance with some of the directions.
When I enter a WAV file into the program, where does it show up, and how do I know if it worked properly?

Oh!  I suppose I should probably expand the Readme.txt a bit...  after you drag and drop the WAV file onto the BAT, enter the new sample rate you want, and press enter, you should see the BAT file scroll some stuff and self-close.  After it's finished there should be one or more files named Filename.wav.CHIPIFIED.XX.DMW in the same folder.  There will also be a text file named Filename.wav.CHIPIFIED.txt that contains the decimal string values for all the DMW files the program just made.  It also puts a new WAV file in the folder named Filename.wav.CHIPIFIED.wav, that is the processed, non-normalized WAV file.

Basically, if it spits out one or more DMW files, the TXT file and a WAV file, it should have worked properly lol... i usually just browse through the DMWs it made in Deflemask to see how they look afterwards.

As for how to get the new sample rate you need, you need to first find out how many samples are in the duty cycle of the WAV you're feeding Chipifier.  I just go into my WAV editor of choice, zoom waaaay in, and select the exact duty cycle (one single waveform loop) and see how many samples are in it.  Once I have that, it's rippin' time!  :)

Let's say the duty cycle uses, mmm, 279 samples.  And let's also say the WAV file we're trying to rip it from is 44100Hz.  We need to crunch that 279 sample loop down to 32 samples (what the PC-Engine uses).  So we would use some math...

((32 / 279) x 44100) = 5058 Hz  <-- This is the NEW sample rate you need to input to Chipifier in order to get perfect wavetable rips from source material.

I've also found you can even create ultra-shitty sounding "PSG samples" up to half a second long or so, by resampling to 1920hz and loading the DMW files it makes, one after the other, every 1/60th.  Deflemask only allows 32 wavetables, max, though.  Plus, 1920hz sounds pretty bad.  Especially on the first revision PCE sound hardware.
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Delek on March 09, 2017, 09:52:24 am
I think I will expand the MAX_WAVES from 32 to 128. The issue will be the wave macro (the lines in it will be super tiny)
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: RazerBlue6 on March 09, 2017, 11:03:34 am
This is just an idea, but would it also be a good idea to be able to save/edit wavetables within an instrument, this would make importing other made instrument that uses multiple wavetables a bit easier I guess?

I think it would be hard to implement, like if there already are wavetables loaded in and making them unique and updating that in the instrument.
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: SpoonyBard on March 09, 2017, 12:25:05 pm

Oh!  I suppose I should probably expand the Readme.txt a bit...  after you drag and drop the WAV file onto the BAT, enter the new sample rate you want, and press enter, you should see the BAT file scroll some stuff and self-close.  After it's finished there should be one or more files named Filename.wav.CHIPIFIED.XX.DMW in the same folder.  There will also be a text file named Filename.wav.CHIPIFIED.txt that contains the decimal string values for all the DMW files the program just made.  It also puts a new WAV file in the folder named Filename.wav.CHIPIFIED.wav, that is the processed, non-normalized WAV file.

I tired to use it, but I wouldn't get anything out of the program. I have SoX installed in bin/Release along with the main components of the program, and everything else that came with the download is in my DefleMask wavetables folder. I don't know what I'm missing for it to not be working.
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Fragmare on March 09, 2017, 01:22:03 pm

Oh!  I suppose I should probably expand the Readme.txt a bit...  after you drag and drop the WAV file onto the BAT, enter the new sample rate you want, and press enter, you should see the BAT file scroll some stuff and self-close.  After it's finished there should be one or more files named Filename.wav.CHIPIFIED.XX.DMW in the same folder.  There will also be a text file named Filename.wav.CHIPIFIED.txt that contains the decimal string values for all the DMW files the program just made.  It also puts a new WAV file in the folder named Filename.wav.CHIPIFIED.wav, that is the processed, non-normalized WAV file.

I tired to use it, but I wouldn't get anything out of the program. I have SoX installed in bin/Release along with the main components of the program, and everything else that came with the download is in my DefleMask wavetables folder. I don't know what I'm missing for it to not be working.

Hmm does it give you any kind of error message?  Maybe try doing shift-right click on the folder, then do Open Command Prompt Here, then manually typing chipifiy.bat "filename.wav".  it'll leave the command prompt window open after it finishes, so you can see any errors/problems it had. 

I forgot to mention, this is for Windows... at least that's what I'm running.  Win10.  Ugh.
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Fragmare on March 09, 2017, 06:14:55 pm
I think I will expand the MAX_WAVES from 32 to 128. The issue will be the wave macro (the lines in it will be super tiny)

That will be aweome!  You can always just enter the decimal values manually in the instrument macro, instead of trying to draw it.  Maybe the wavetable values under the instrument wave macro should be in hex format to match how they're listed in the wavetable popup? 00-1F, etc.
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Michirin9801 on March 10, 2017, 01:40:50 am
I think I will expand the MAX_WAVES from 32 to 128. The issue will be the wave macro (the lines in it will be super tiny)
Please do that! Oh and, A scroll-bar like the one used in the arpeggio macro would help with that...
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Pegmode on March 10, 2017, 12:23:57 pm
I think I will expand the MAX_WAVES from 32 to 128. The issue will be the wave macro (the lines in it will be super tiny)
YES PLEASE
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: elmer on March 10, 2017, 03:33:12 pm
I think I will expand the MAX_WAVES from 32 to 128. The issue will be the wave macro (the lines in it will be super tiny)

Excellent, thanks!  ;D

Now, if you're looking at code for the Wave Macro, could you please think about adding the Wave-to-Noise switch in there at the same time ... perhaps as value 127 or 128?

So that a Wave Macro value of 127 (or 128) would act as a Noise On (effect $1101) and a Wave Macro value of less than that would act as a Noise Off (effect $1100), and also change the current wavetable.

Being able to control the switching between Wave and Noise with a 1/60th tick precision is really going to improve the quality of people's PSG drums.

The MML player that's built into the PCE's CD System Card already supports doing that, and so do all of the other old sound drivers that I seen.
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Michirin9801 on April 04, 2017, 03:07:29 am
I think I will expand the MAX_WAVES from 32 to 128. The issue will be the wave macro (the lines in it will be super tiny)

Excellent, thanks!  ;D

Now, if you're looking at code for the Wave Macro, could you please think about adding the Wave-to-Noise switch in there at the same time ... perhaps as value 127 or 128?

So that a Wave Macro value of 127 (or 128) would act as a Noise On (effect $1101) and a Wave Macro value of less than that would act as a Noise Off (effect $1100), and also change the current wavetable.

Being able to control the switching between Wave and Noise with a 1/60th tick precision is really going to improve the quality of people's PSG drums.

The MML player that's built into the PCE's CD System Card already supports doing that, and so do all of the other old sound drivers that I seen.

Yes please do that too!
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: JXC on April 24, 2017, 12:59:07 am
Something's wrong. I am converting waveforms I made in MilkyTracker. They are 32 samples. When I enter 48000 Hz or 41000 Hz, the program closes, and no wavetable is produced. Where do the wavetables go?
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Fragmare on April 25, 2017, 01:31:54 am
Something's wrong. I am converting waveforms I made in MilkyTracker. They are 32 samples. When I enter 48000 Hz or 41000 Hz, the program closes, and no wavetable is produced. Where do the wavetables go?

Is the waveform you are trying to drag onto the .BAT file in the same folder as the .BAT file?  Also, what is the format of the wave file you are dragging/dropping?
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: JXC on April 26, 2017, 10:14:30 pm
Something's wrong. I am converting waveforms I made in MilkyTracker. They are 32 samples. When I enter 48000 Hz or 41000 Hz, the program closes, and no wavetable is produced. Where do the wavetables go?

Is the waveform you are trying to drag onto the .BAT file in the same folder as the .BAT file?  Also, what is the format of the wave file you are dragging/dropping?

Yes, I pasted the waveform into the folder where the BAT file is, and I am using WAV format. Maybe I should try something other than Milkytracker for single cycle waveforms. Please give me the exact procedure so I can make sure I installed chipifier and SoX correctly.
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Fragmare on April 26, 2017, 11:17:11 pm
Something's wrong. I am converting waveforms I made in MilkyTracker. They are 32 samples. When I enter 48000 Hz or 41000 Hz, the program closes, and no wavetable is produced. Where do the wavetables go?

Is the waveform you are trying to drag onto the .BAT file in the same folder as the .BAT file?  Also, what is the format of the wave file you are dragging/dropping?

Yes, I pasted the waveform into the folder where the BAT file is, and I am using WAV format. Maybe I should try something other than Milkytracker for single cycle waveforms. Please give me the exact procedure so I can make sure I installed chipifier and SoX correctly.

Try opening a command prompt in that folder (shift + right click > open command window here).  Then type: chipify.bat "NAME_OF_YOUR_WAV_FILE.WAV" >> error.txt

This should leave the window up as the stuff scrolls by, so you can see what's going on.  It will also output all the command window text to error.txt.  Do that, and paste the contents of error.txt here

I can also tell you that if a wave file is smaller than 32 samples, the app might not like that.  If each of them are really tiny waves, maybe try opening them up in a wave editor and pasting them back to back a few times so it's a slightly bigger file... maybe that might help?
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: ramen_oranges on August 11, 2017, 07:21:37 am
Hey, sorry to bump this old topic, but does anyone think they could make DMW files from Air Zonk? I'd do it, but I unfortunately have no clue how to use this right.
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Michirin9801 on August 13, 2017, 04:03:07 pm
Hey, sorry to bump this old topic, but does anyone think they could make DMW files from Air Zonk? I'd do it, but I unfortunately have no clue how to use this right.
Look for Air Zonk's .hes file on Zophar's Domain, open it with NEZplug++, then click on the CH button to turn on and off channels (you'll want to mess with the HuC6230) and then click the DMP button, select DEV_HuC6230, and click on whatever channel you wanna rip instruments from, but note that whenever you click the channel it will rip whatever wavetable is currently playing on that channel!
You'll get 32 Hex values which form your wavetable, convert those values into Decimal, copy them in order into Deflemask and voila!! You've ripped a Wavetable!
It would be easier if Deflemask supported Hex waves and a "copy/paste wave" function, but as it stands you'll have to copy each value one by one...
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Pegmode on August 17, 2017, 03:47:23 am
It would be easier if Deflemask supported Hex waves and a "copy/paste wave" function, but as it stands you'll have to copy each value one by one...

You have no idea how much pain the process of manually inputting wavetables has caused me. Normally I use keyboard macros to copy values over but Deflemask doesn't use standard MML wavetable strings and gets picky if you don't put a 0 in front of the single digit values.
Also deleting the old default values is a pain because you have to use the arrow key to move the cursor to the last sample then hold backspace to delete the old values, which takes a VERY long time. Having that box where you input the values act more like a normal text box where you can select all the values, delete them then copy a string in would be a life saver.

I've worked with the .dmw format before in my LSDJ Synth mod for deflemask so I might try and write a small tool to convert a text file to .dmw
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Michirin9801 on August 17, 2017, 02:34:41 pm
I've worked with the .dmw format before in my LSDJ Synth mod for deflemask so I might try and write a small too to convert a text file to .dmw
That would be nice
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Delek on August 19, 2017, 01:00:53 pm
It would be easier if Deflemask supported Hex waves and a "copy/paste wave" function, but as it stands you'll have to copy each value one by one...
I'm aware of this and I'm planning to add a standard OS textbox input instead of the current one. Actually the entire text input system of Defle will be replaced for a more standard form.
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Michirin9801 on August 19, 2017, 03:23:49 pm
It would be easier if Deflemask supported Hex waves and a "copy/paste wave" function, but as it stands you'll have to copy each value one by one...
I'm aware of this and I'm planning to add a standard OS textbox input instead of the current one. Actually the entire text input system of Defle will be replaced for a more standard form.
Yaaay~!!
But will it support hex waves too? I mean, couldn't there be a toggle to switch between hex and decimal wavetables?
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Fragmare on August 20, 2017, 10:17:32 pm
It would be easier if Deflemask supported Hex waves and a "copy/paste wave" function, but as it stands you'll have to copy each value one by one...
I'm aware of this and I'm planning to add a standard OS textbox input instead of the current one. Actually the entire text input system of Defle will be replaced for a more standard form.
Yaaay~!!
But will it support hex waves too? I mean, couldn't there be a toggle to switch between hex and decimal wavetables?

Yea, having some stuff in hex and other stuff in decimal is confusing.  Another example is when the wavetables are listed in hex format in the wavetable popup, but if you want to call a particular wavetable in the wave macro, you must specifiy it in... decimal?  O_o
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Michirin9801 on August 20, 2017, 10:58:32 pm
Yea, having some stuff in hex and other stuff in decimal is confusing.  Another example is when the wavetables are listed in hex format in the wavetable popup, but if you want to call a particular wavetable in the wave macro, you must specifiy it in... decimal?  O_o
I mostly just want to input waves in Hex because then it would be easier to rip waves from PCE games using NEZplug...
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Pegmode on August 21, 2017, 11:35:21 pm
I've worked with the .dmw format before in my LSDJ Synth mod for deflemask so I might try and write a small too to convert a text file to .dmw
That would be nice
Done http://www.deflemask.com/forum/general/deflewave-deflemask-wavetable-conversion-tool
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Fragmare on August 22, 2017, 11:37:31 pm
Just a show of hands... does anybody else here besides myself actually USE this Chipifier app to any significant degree?  If so, I'll continue tweaking the .BAT file and uploading new versions.  Maybe it needs some better documentation or something...
Title: Re: Chipifier - A PC-Engine wavetable ripper for Deflemask!
Post by: Michirin9801 on August 24, 2017, 01:23:00 am
You know, I wanted to try it out, but I just never got around to it >w>';
The thing is that I don't really rip my wavetables from samples, I just kind of make my own whenever I'm not using waves ripped from proper PCE games...