SMW Central



Converting with NintSPC

1. What is NintSPC?

NintSPC is a program made by loveemu.

The program converts SPCs in the Nintendo SPC file format to MIDI format as well as logging the song to a HTML page with all commands, effects, notes used by the song. There's also a feature that allows you to create .txt files for Addmusic (not Addmusic 4 series though!). You can download the program here:



2. Using NintSPC

NintSPC is to be used via command prompt or via batch files (recommended).

To simply use the default options you can find the files:

cleanup.bat ← removes all .mid .spc .txt and .html files

convall.bat ← converts your SPC to MIDI

dbzb2.bat ← converts Dragon Ball Z – Super Butouden 2 SPCs to MIDI

logall.bat ← logs your SPC to HTML file format as well as converting to MIDI

Make sure nintspc.exe (found in the bin folder) is in the same directory with the above files (usually within the misc folder).

If you're logging to HTML it is also wise to include nintspc.css and base.css (found in the doc folder).

Once you've logged a file to .html you may see the „ticks“ and all channels being mixed. We want them to be sorted so we can compose our song faster. Open nintspc.css in a text editor of your choice and search for this:

/* mask */

/*

table.dump tr.track1 { display: none; }

table.dump tr.track2 { display: none; }

table.dump tr.track3 { display: none; }

table.dump tr.track4 { display: none; }

table.dump tr.track5 { display: none; }

table.dump tr.track6 { display: none; }

table.dump tr.track7 { display: none; }

table.dump tr.track8 { display: none; }

table.dump tr.sub { display: none; }

*/

And change it to:

/* mask */

table.dump tr.track1 { display: none; } ← remove this line to display #0

table.dump tr.track2 { display: none; } ← remove this line to display #1

table.dump tr.track3 { display: none; } ← remove this line to display #2

table.dump tr.track4 { display: none; } ← remove this line to display #3

table.dump tr.track5 { display: none; } ← remove this line to display #4

table.dump tr.track6 { display: none; } ← remove this line to display #5

table.dump tr.track7 { display: none; } ← remove this line to display #6

table.dump tr.track8 { display: none; } ← remove this line to display #7

table.dump tr.sub { display: none; }

NintSPC also has an option to output .txt files for Addmusic (only Carol's or AddmusicM though!) but we will come back to that later.

3. Commands/Options

The known commands that can be used are:

--help → Simply shows the usage of NintSPC

--count → Converts a set number of songs (format – count )

--song → Sets the song index (format: --song )

--np → Disables reading the song index from APU port

--force → Force the song to convert at unidentified events

--loop → Amount of loops to convert (format – loop )

--linear → Assumes the MIDI volume is linear

--bendrange → Pitch bend sensitivity (0:auto) (format: --bendrage )

--patchfix → Modify patch/transpose (format: --patchfix )

--gs → Insert GS Reset

--xg → Insert XG System

--gm2 → Insert GM2 System

--mml → Output mml log for addmusic (format: --mml )

--mmlabs → Express note length by tick count

--noqf → No 'q' curve conversion for MML

Advanced commands:

--songlist → force set song (list) address (format: --songlist )

--blockptr → specify block pointer address (format: --blockptr )

--durtbl → specify duration table address (format: --durtbl )

--veltbl → specify velocity table address (format: --veltbl )

4. Converting to Addmusic

Like I mentioned earlier, the program is also able to convert SPCs to MML format for AddmusicM and Carol's Addmusic. Here's how to:

In the misc folder, open convall.bat with any text editor of your choice. You should find this:

@for %%a in (*.spc) do nintspc --np --force --loop 2 %%a %%~na.mid

This will just output a MIDI from the SPC you've chosen.

Simply replace it with this:

@echo.>stderr.txt

@for %%a in (*.spc) do nintspc --np --force --mml %%~na.txt %%a %%~na.mid>>stderr.txt

@pause

See the difference? If an error occurs it will output a file called stderr.txt (not that it is important, but won't hurt either) as well as only looping the song once instead of two times and last not least, it outputs your Addmusic text file (MML)!

NOTE: The above method doesn't work with all games though, so we have to create another batch file, just in case!

Again, open convall.bat (the modified version) and remove “--np” from it, then save it to something like convall2.bat. This one will read from the APU index instead, which is required for some games (haven't tested which but you will easily notice it when the file size of your Addmusic text file is around 9~11KB only).

To convert a song you just click on convall.bat/convall2.bat and make sure the SPC file you are trying to convert has no spaces in it, since NintSPC doesn't support them.

5. Overview of the created text file

In this example I will use the song “Super Mario Bros. 3 - Warp Zone”.

Assuming you've already converted a song you'd want to open the MML file with a text editor of your choice.

The first 27 lines consist of labels (all commands available with the exception of the newer AddmusicM commands). Those do not need to be edited in any way.

After that we will find more labels though, this time all instruments from 0-255

PATCH000-PATCH255) as well as drums (PERC000N-PERC021N & PERC000X-PERC021X).

You do not need all of these anyway, so we will find the used instruments and drums in the song (SMB2 – Underground in this case).

Simply scroll down until you see #0 and if you Notepad++ simply highlight all “PATCH”.

#0 contains: PATCH000 & PATCH005

#1 contains: PATCH000 & PATCH005

#2 contains: PATCH005

#3 contains: PATCH005

#5 contains: PATCH005

So in total we have 2 instruments:

PATCH000

PATCH005

Remove all other “PATCH” in the label list above except those (it won't matter in file size but inserting the song will take longer, since Addmusic parses through the whole file). :P

The song doesn't have any “PERC” so you can remove all of them, otherwise the same applies to “PERC” as well.

In this song you will also find a command called “VCMD_PERVOICE_TRANPOSE” after PATCH005 in some channels that uses this instrument. This command is not supported in our Addmusic versions yet so we have to comment it out by replacing all of the VCMD_PERVOICE_TRANPOSE commands with ;VCMD_PERVOICE_TRANPOSE

Just make sure the label of it doesn't have a semicolon in front of it!

Also, since we're at it I will also explain how to keep the note values as close as possible without VCMD_PERVOICE_TRANPOSE.

In channel #0 you will find this:

PATCH005

VCMD_TUNING $00

v130

VCMD_PERVOICE_TRANSPOSE $f4

q6b; q67

o3 c16 q6c; q69

Replace the VCMD_PERVOICE_TRANSPOSE $f4 with ;VCMD_PERVOICE_TRANSPOSE $f4 to comment it out and change the o3 to o2 to keep the note value the same. ;)

Tranposes:

$f4 = one octave down

$e8 = two octaves down

$0c = one octave up

$18 = two octaves up

Basically you go in $0C steps to either lower or higher an octave, if you find a VCMD_PERVOICE_TRANPOSE. Just make sure, if VCMD_PERVOICE_TRANSPOSE is set to $00 again, that you also restore the octave instead of using the octave for $f4 (not the case in this song, just saying).

But note, not all of them go in $0C steps. They can be $02, $0A, basically anything. With those values you have to use the “h-command” to go tune it properly. This is done by trial and error unless you're using samples, then it's a lot easier, since we can use SPC700 Player for that to compare the pitch. I will explain more about that later.

As for the echo parameters, you oftenly find FIR presets higher than $01 e.g.

VCMD_ECHO_PARAM $02 $32 $03 or VCMD_ECHO_PARAM $02 $32 $02 (random values).

For that it's best to change the FIR preset to $01 or $00 (unless you know the actual FIR filter being used then you can use $f5 command from AddmusicM and set the FIR filter as well. Right below the echo commands, obviously.

P.S. Our sample song uses an echo command of:

VCMD_ECHO_ON $2f $3c $3c

VCMD_ECHO_PARAM $02 $32 $00

FIR preset is set to $00, but the filter itself is:

$7F $00 $00 $00 $00 $00 $00 $00

Which is preset $01 in Super Mario World. So you change that to:

VCMD_ECHO_ON $2f $3c $3c

VCMD_ECHO_PARAM $02 $32 $01

Getting the echo values is done via SPC700 player as well, as seen below.

MasterLv: We do not need this in our echo commands.

EchoLv: This is the echo volume for the left and right speaker ($3c $3c)

Delay: Echo delay value of current song ($02)

Feedback: Echo feedback value of current song ($32)

FIR: This is the filter being used in the current song.

So our VCMD_ECHO_ON command is:

VCMD_ECHO_ON $2f $3c $3c ← As you can see, L/R volume is $3c.

Our VCMD_ECHO_PARAM command is:

VCMD_ECHO_PARAM $02 $32 $01 ← $02 Delay, $32 Feedback and FIR preset $01

The only thing missing is the channels affected by echo, but that's not a big deal, really.

That's pretty much all you need to know for now.

6. Instrument setup

You will find out that all instruments are set to @4 with an ADSR of $ed $7f $e0. For that we can use any SPC player of our choice that supports muting channels, unless your ear is good enough to know which instrument you could use.

I suggest using SPC700 player, even though it is in Japanese, it is a real good SPC player with various features that we definetely will need!

So, my instrument now looks like this:

"PATCH000=@4 h0 $ed $7f $e0"

"PATCH005=@4 h0 $ed $7f $e0"

But we want them to sound near the original (using standard SMW samples here).

Simply open SPC700 player and browse to the ADSR page (press left or right on the player to change the page). You should see something like this:

Keep in my mind that the instrument values here are in hex, our “PATCH” values are decimal.

00 and 05 are equal in decimal so it doesn't matter this time, but I'd always check SPC700 player for the actual instrument being played and note the hex value after the instrument's label in your text file e.g.

"PATCH000=@4 h0 $ed $7f $e0" ;00

"PATCH005=@4 h0 $ed $7f $e0" ;05

Anyhow, as we can see on the picture, the ADSR isn't set to $ed $7f $e0 for both instruments, but how do we get the actual ADSR value?

On the first channel you can see SRC, ADSR/Gain and 0X. Src is the instrument number being played and ADSR/Gain is what we want for that instrument. 0X is useless for us.

The ADSR for PATCH000 would be $ed $7e $6a and PATCH005 would be $ed $29 $6a

But how did I get the values? Easy!

You take the first 2 values (E7) and swap them = $7E. The third value is to be multiplied with 20 (in hex). 20x3=$60. And last not least, the fourth value. This one is simply added to your result of the multiplication $60+$0a=$6a

Which now becomes $ed $7e $6a. For you lazy people out there, here's a list of values for the third value:

0 = $00

1 = $20

2 = $40

3 = $60

4 = $80

5 = $a0

6 = $c0

7 = $e0

Simply check for the number and add the fourth value.

Your instruments should now look like this:

"PATCH000=@4 h0 $ed $7e $6a" ;00

"PATCH005=@4 h0 $ed $29 $6a" ;05

Now on to change the @4 to something better.

Listening to #0 only easily tells us it is a flute at the beginning, so we

change the @4 for PATCH000 to @0. After the intro has been played it changes to PATCH005, which is clearly a trumpet. Change the @4 to @6 for PATCH005 and this is our final instrument set up for the song:

"PATCH000=@0 h0 $ed $7e $6a" ;00

"PATCH005=@6 h0 $ed $29 $6a" ;05

Insert your song with AddmusicM or Carol's Addmusic and test it out. If all worked so far it should sound similar to the original. :)

7. Using samples

If you're going to use samples (Sample Tool + Carol's Addmusic or AddmusicM + .brr files) then this part will show you how to tune them close to the original. Assuming you know how to insert and use samples (because I'm not going to explain it here), set up your instruments to use samples first.

For Carol's Addmusic:

"PATCH000=@0 h0 $ed $7e $6a $e5 $xx $yy" ;00

"PATCH005=@6 h0 $ed $29 $6a $e5 $xx $yy" ;05

Where $xx is your sample + $80 being loaded and $yy being the rough pitch of that sample.

For AddmusicM (more complex):

Add this:

s20

_20_21_FF

Above this:

"PATCH000=@0 h0 $ed $7e $6a" ;00

"PATCH005=@6 h0 $ed $29 $6a" ;05

s20 is our PCM set (you can use any number between 10-FF)

_20_21 are our samples from blist.txt. _FF needs to be written to stop loading samples.

Change your instrument list to:

"PATCH000=@0 h0 $ed $7e $6a $f3 $20 $xx" ;00 (sample 20 from blist.txt)

"PATCH005=@6 h0 $ed $29 $6a $f3 $21 $xx" ;05 (sample 21 from blist.txt)

The instruments starts at $20 and increases. $xx is the rough pitch, which is the same value for $e5 as well (Sample Tool).

Let's say you have inserted .brr samples at slot 45, 49 and 6F. Your PCM set and instrument list should look like this:

s20

45_49_6F_FF

"PATCH000=@4 h0 $ed $7f $e0 $f3 $20 $xx" ;sample 45 into slot $20

"PATCH001=@4 h0 $ed $7f $e0 $f3 $21 $xx" ;sample 49 into slot $21

"PATCH002=@4 h0 $ed $7f $e0 $f3 $22 $xx" ;sample 6f into slot $22

I'm not going to port a song but show you another picture of SPC700 player's abilities and include examples for the pitch values.

As we can see in this picture, we have the Src, Level, Pitch and EX. But we only need Pitch!

Looking at #0 we have a pitch of 17A2 at 02.808 seconds for PATCH000 and a pitch of 0354 for PATCH005 at #2.

Now comes a quite annoying part but one that will be worth it!

Insert your song with samples (I'd suggest using a default value of $03 for the rough pitch ($e5 $xx $03 or $f3 $xx $03).

Open your ROM in an emulator, export the SPC and open it with SPC700 player. Compare the pitch values (I'd pick a value that stay for longer or is at least decent enough to compare to the values in your SPC exported from the emulator).

Example: Your PATCH000 has a pitch value of 0925 at 02.808 seconds with a rough pitch of $03 and you need to have $17A2. I'd first higher the rough pitch by approx. $05 so it becomes $08. You can only experiment until you get a close value to 17A2.

"PATCH000=@0 h0 $ed $7e $6a $e5 $xx $08" ;00

"PATCH000=@0 h0 $ed $7e $6a $f3 $xx $08" ;00

If your pitch is like 1750 you should consider using the “h-command” from now on . Since your pitch is obviously 52 lower, you should use h1 first:

"PATCH000=@0 h1 $ed $7e $6a $e5 $xx $08" ;00

"PATCH000=@0 h1 $ed $7e $6a $f3 $xx $08" ;00

All you can do is insert song, save SPC, compare, change pitch values (h-command and rough pitch), reinsert, save SPC again, compare again, until it is equal or close enough.

Keep in mind that the values I have used (except the originals from the picture) are random values and can be anything but those!

8. Advanced Commands

As stated before, there are advanced commands as well, namely:

--songlist

--blockptr

--durtbl

--veltbl

Those are seen in dbzb2.bat

@echo.>stderr.txt

@for %%a in (*.spc) do nintspc --loop 2 --songlist 1e00 --blockptr 4d --durtbl 1d80 --veltbl 0c26 %%a %%~na.mid %%~na.html 2>>stderr.txt

@pause

Why are they used though? Well, my guess is that NintSPC isn't able to read the song index, velocity & duration values for all songs so some songs need to have them added manually. I have tried messing around with the commands in other games but haven't found any other games to work with that method yet, perhaps I was using the wrong indexes/tables, since that's the hardest part..finding them!

The format is SPC offset-$100.

The songlist in Dragon Ball Z – Super Butoden 2 is at $1f00. -$100 = $1e00.

Same applies to durtbl and veltbl.

Blockptr is usually 4d and doesn't need to be changed.

9. Compatible Games

3x3 Eyes - Seima Kourinden

4 Nin Shougi

A Bug's Life

Action Pachio

Actraiser

Air Management - Ozora ni Kakeru

Albert Odyssey

Albert Odyssey 2

Alcahest

American Gladiators

Animaniacs (Super Gameboy)

Arkanoid - Doh it Again

Armor Police Metal Jack

Ashita no Joe

Asterix & Obelix

B.O.B.

BS Busters Digital Magazine

BS Dragon Quest

BS Kirby no Omocha Hako - Baseball

BS Nichibutsu Mahjong

BS Zelda

Barbarossa

Baseball Simulator 1.000

Battle Blaze

Battle Dodgeball

Battle Grand Prix

Battle Tycoon

Bazooka Blitzkrieg

Bebe's Kids

Bishin Densetsu Zoku

Bubsy in Claws Encounters of the Furred Kind

Bulls vs. Blazers

Burai - Hachigyoku no Yuushi Densetsu

Cal Ripken Jr. Baseball

Cameltry

Capcom's MVP Football

Captain Tsubasa 3

Cardmaster

Casper (Japanese)

Choukou Goukami Xardion

Clock Tower

Clock Works

Cosmo Gang the Puzzle

Darius Twin

Daze Before Christmas

Death Brade

Desert Strike

Donald Duck - Mahou no Boushi

Donkey Kong (Super Gameboy)

Doraemon

Doraemon 2

Doukyuusei 2

Dragon Ball Z - Super Butouden

Dragon Ball Z - Super Butouden 2

Dragon Ball Z RPG

Dragon Knight 4

Dragon Slayer

Dragon View

Dragon's Earth

Drakkhen

Dream Maze - Kigurumi Daibouken

Dun Quest

Earthbound

Esparks - Ijikuu kara no Raihousha

F-1 Grand Prix

F-1 Grand Prix II

F-1 Grand Prix III

F-Zero

FIFA Soccer '98 (Super Gameboy)

Fatal Fury

Fatal Fury Special (Garou Densetsu Special)

Fight da Pon!

Fire Emblem 3

Fire Striker

First Samurai

Fishing to Bassing

Football Fury

GD Leen

Galaxy Wars

Gekisou Sentai Car Rangers

Ghost Sweeper Mikami

Ginga Eiyuu Densetsu

Goods Press 3gatsu Gou

Gousou Jinrai Densetsu Musya

Gulliver Boy

Gundam F-91

Gundam Wing - Endless Duel

HAL's Hole in One Golf

Hakunetsu Pro Yakyuu - Ganba League

Hanafuda Ou

Hansei Zarujirou Kun no Daibouken

Harapeko Bakka

Harley's Humongous Adventure

Hashire Hebereke

Hebereke no Popun

Heian Huunden

Heisei Shin Onigashima

Hercules

Hiryu no Ken S - Golden Fighter

Hit the Ice

Hook

Human Grand Prix

Human Grand Prix 2

Human Grand Prix 3

Human Grand Prix 4

Humans

Hunchback of Notre Dame (Super Gameboy)

Hunt for Red October

Hyper Iria

Hyper V-Ball

Hyper Zone

Inspector Gadget

Itou Hatasu Rokudan no Shougi Dojo

Jaleco Rally Big Run - The Supreme 4WD Challenge

Jerry Boy

Joe & Mac

John Madden Football

Jutei Senki

Kablooey

Kabuki-chou Reach Mahjong Tonpuu Sen

Kawasaki Caribbean Challenge

Keiba Eight Special 2

Kid Klown in Crazy Chase

Kiki Kaikai

Kiki Kaikai 3

Kikuni Masahiko no Jantoushi Dora Ou

King Arthur's World

King of the Monsters

Kinnikuman - Dirty Challenger

Kirby Super Star

Kirby no Omochabako - Hoshi Kuzushi

Kirby's Dream Course

Kirby's Dream Land 3

Kirby's Kira Kira Kids

Knights of the Round

Konae-Chan no DokiDoki Pengin Kazoku

Lagoon

Last Fighter Twin

Legend of Zelda - A Link to the Past

Lemmings

Light Fantasy

Little Magic

Lord Monarch

Love Quest

Lucky Luke

Lupin the 3rd

Madden '97 (Super Gameboy)

Magic Sword

Magical Taruruto Kun

Mahjong Hishouden - Naki no Ryuu

Mario Paint

Marvelous

Metal Marines

Mickey's Ultimate Challenge

Mighty Morphin' Power Rangers

Mighty Morphin' Power Rangers - The Fighting Edition

Mighty Morphin' Power Rangers - The Movie

Motoko-chan no Wonder Kitchen

Multi Play Volleyball

Mystery Circle

Naruhodo The World

New Yatterman

Nigel Mansell's World Championship Racing

Ninja Gaiden Triology

Nintendo Power Menu Program

Nolan Ryan's Baseball

O-chan no Oekaki Logic

Oda Nobunaga - Haou no Gundan

Ohmono Black Bass Fishing

Olympic Summer Games (Super Gameboy)

Othello World

Pac-Attack

Pac-Man 2 - The New Adventures

Phalanx

Pilotwings

Pipe Dream

Pirates of Dark Water

Populous

Power Rangers Zeo - Battle Racers

Pro Mahjong Kiwame GB (Super Gameboy)

Pro Sport Hockey

Rap Jam

Road Riot 4WD

Run Saber

Ryuuko no Ken

Ryuuko no Ken 2

S.O.S.

SD Great Battle

SD Gundam Gaiden

SD Gundam Gaiden 2

SD Gundam X - Super Gachapon World

SD Hiryu no Ken

SD Kidou Senshi Gundam V

SNES Burn-in Test Cart

SNES Test Programm

Saibara Rieko no Mahjong Hourouki

Sailor Moon S - Kurukkurin

Sailor Moon Super S - Zenin Sanka!! Shuyaku Soudatsusen

Samurai Shodown

Satellaview BS-X

Secret of the Stars

Shigesato Itoi's Bass Fishing No.1

Shigetaka Kashiwagi's Top Water Bassing

Shijou Saikyou no Quiz Ou Kettei Sen Super

Shiki Eiyuu Den

Shinzui Taikyoku Igo Go Sennin

Shonen Ashibe

Shougi Saikyou

Sim City

Sim Earth

Small Soldiers (Super Gameboy)

Snoopy Concert

Sonic Blastman

Sonic Wings

Soul Blader

Sousa Sentai Wappers

Space Football

Special Tee Shot

Spirou

Star Fox

Star Fox 2

Stunt Race FX

Sugoi Hebereke

Super Adventure Island

Super Baseball 2020

Super Bases Loaded

Super Double Yakuman

Super Double Yakuman 2

Super E.D.F. - Earth Defense Force

Super Famista

Super Famista 2

Super Fire Pro Wrestling

Super Fire Pro Wrestling X

Super Formation Soccer

Super Formation Soccer '94

Super Formation Soccer '95

Super Formation Soccer 2

Super Mahjong

Super Mario All-Stars

Super Mario Kart

Super Mario World

Super Metroid

Super Oozumou Netsusen Daiichiban

Super Play Action Football

Super Professional Baseball 2

Super Scope 6

Super Shougi

Super Shougi 2

Super Slapshot

Super Soccer Champ

Super Stadium

Super Syobo Syobo CG Collection

Super Tennis

Super Tetris 2

Super Ultra Baseball 2

Super Uno

Super Wagan Land

Super Widget

Sutte Hakkun

Syvalion

TKO Super Championship Boxing

Tadaima Yusya Bosyutyu Okawari

Taekwon-Do

Tecmo Super Bowl

Tenchi Muyo

Tetris & Dr. Mario

Tetris Attack

The Mahjong Touhaiden

The Ninja Warriors

The Smurfs

Thunder Spirits

TinTin - Le Temple du Solei

TinTin au Tibet

Tom & Jerry

Top Gear

Tsuppari Oozumo Rissin Shusse Hen

Ultima 6

Ultra Baseball Jitsumeiban

Ultra Baseball Jitsumeiban 2

Ultra Baseball Jitsumeiban 3

Ultra League

Ultraman - Towards the Future

Urban Strike

Ushio & Tora

Utopia

Vegas Stakes

Volleyball Twin

Waialae Country Club

Waku Waku Ski Wonder Shoot

Whirlo

Wild Guns

World Cup '98 (Super Gameboy)

World League Soccer

X-Zone

Yadamon Wonderland Dreams

Yoshi no Kuruppon

Yoshi's Cookie

Yoshi's Islans

Ys 3 - Wanderers From Ys

Yume Maboroshi no Gotoku

Yuu Yuu Hakusho

Yuuyu no Quiz de Go! Go!

Zennihon Pro Wrestling

Zennihon Pro Wrestling 2

Zennihon Pro Wrestling Dash

If you still have questions, feel free to PM me (Ice Man) on SMWCentral.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download