Chat

Author Topic: Chipifier - A PC-Engine wavetable ripper for Deflemask!  (Read 1744 times)

Offline Fragmare

  • Jr. Member
  • Posts: 52
  • Delek FTW
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« 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/

Offline SpoonyBard

  • Global Moderator
  • Full Member
  • Posts: 290
  • Music's in my name!
    • Email
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #1 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?
« Last Edit: March 08, 2017, 11:08:57 PM by SpoonyBard »
Music truly is without age.

Offline Fragmare

  • Jr. Member
  • Posts: 52
  • Delek FTW
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #2 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.
« Last Edit: March 09, 2017, 06:16:56 PM by Fragmare »

Offline Delek

  • Salí para ver
  • Administrator
  • Hero Member
  • Posts: 1771
    • Delek's Website
    • Email
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #3 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)

Offline RazerBlue6

  • Newbie
  • Posts: 35
  • PC Engine Masterrace
    • Twitter
    • Email
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #4 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.

Offline SpoonyBard

  • Global Moderator
  • Full Member
  • Posts: 290
  • Music's in my name!
    • Email
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #5 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.
Music truly is without age.

Offline Fragmare

  • Jr. Member
  • Posts: 52
  • Delek FTW
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #6 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.
« Last Edit: March 09, 2017, 02:35:08 PM by Fragmare »

Offline Fragmare

  • Jr. Member
  • Posts: 52
  • Delek FTW
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #7 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.
« Last Edit: March 09, 2017, 06:17:32 PM by Fragmare »

Offline Michirin9801

  • Full Member
  • Posts: 258
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #8 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...

Offline Pegmode

  • Member
  • Posts: 128
  • Allergic to FM
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #9 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

Offline elmer

  • Newbie
  • Posts: 31
  • Delek FTW
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #10 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.

Offline Michirin9801

  • Full Member
  • Posts: 258
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #11 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!

Offline JXC

  • Newbie
  • Posts: 10
  • Delek FTW
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #12 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?
« Last Edit: April 24, 2017, 01:02:53 AM by JXC »

Offline Fragmare

  • Jr. Member
  • Posts: 52
  • Delek FTW
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #13 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?
« Last Edit: April 25, 2017, 01:33:39 AM by Fragmare »

Offline JXC

  • Newbie
  • Posts: 10
  • Delek FTW
Chipifier - A PC-Engine wavetable ripper for Deflemask!
« Reply #14 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.
« Last Edit: April 26, 2017, 10:22:29 PM by JXC »