Welcome Guest [Log In] [Register]
Greetings and welcome to SMW Archives~!

This forum is a place for helping each other out and helping those who are new improve. We're just a place to hangout, have some fun and make friends; we accept all hacks despite how evil they are. Our goal is to preserve and archive Super Mario World rom hacks of all kinds indiscriminately to prevent some from being lost forever. Feel free to join our little community to start making new friends and if you've got a rom hack we'll archive it for you~! Registration is fast, simple and doesn't require you sell your soul! ^^

Join now if you'd like, or don't, and just give us your roms to archive~! ;3


If you're already a member log in and get with the posting~! *thumbs up*

Username:   Password:
Post Reply
was this useful?
yes 0 (0%)
could be better 0 (0%)
i can suggest things to make it better (tell me what it is if you pick this) 0 (0%)
no 0 (0%)
Total Votes: 0
Custom Music for Newbs; and maybe some noobs too
Topic Started: Jul 6 2010, 11:37 PM (2,684 Views)
omegazeroINFI
Member Avatar
Arcade Action
Welcome, this tutorial is to help get others to get off their lazy ass and do everything themselves learn how music porting works.
also, please do NOT post anything in this thread till i give the heads up as i may need multiple posts to get this tutorial done
please tell me if theres anything i can add to improve this, the stuff i did leave out is hard to explain and i will get to it when i find a good way to explain it, but for now, the basic bits should be plenty for you all.

SECTION 1

first off, just in case you dont know how to even insert music, you will need addmusic.
there is romis addmusic and carols addmusic please note to never use more then 1 addmusic per rom.

romis addmusic is used to insert music via CMD or command prompt. which looks like this
Posted Image
cmd on xp can be gotton to using run, but your gonna wanna be able to access it in other places, so on an xp, you need to open the start menu and go to My Computer and enter your C: hard drive and in my case, its labeled OS (C:).
afterwards, open your WINDOWS folder and scroll till you find system32, in that folder, scroll down to find cmd.exe and copy it to were your addmusic is, (this is also done with other tools, but for now, romis addmusic)
for vista, and maybe windows 7, you should see a search bar in the start menu, just type cmd and copy the resulting cmd.exe to romis addmusic. (this also can be retrieved the xp way if you cant get it)

Once you got all that done, toinsert with romis addmusic, you first need the ini, so your gonna place your rom in the folder and then in cmd, you type

addmusic.exe romname.smc

then hit enter, dont bother with init, ow or level, the init is useless and level and ow make only those music insert and romis addmusic erases all the info of inserted music in the rom, each use,

after the first time you use addmusic with cmd, it will spit out an ini file which you need for the music to insert, it also gives you an sfx ini for sound effect insertion, (ill cover that later when i actually do it myself for the first time)

the ini when you open it in notepad will look like this.
(i deleted all the numbers in between, youl understand if you look)

[SETTINGS]
Create.msc=1
FreeRAM=7EC100
TitleMusic=01
[OVERWORLD]
0A=
19=
(your actually free to use the numbers in the misc but, i wouldnt, id just use 19 and go down 1 number each time like 19, 18, 17 when picking overworld slots and if you run out, just pick whatever, im sure it will work fine)
[MISC]
09=Mario Died.txt
0A=Game Over.txt
0B=Passed Boss.txt
0C=Passed Level.txt
0D=Have Star.txt
0E=P-switch.txt
10=Into Keyhole.txt
11=Zoom In.txt
13=Welcome.txt
14=Done Bonus Game.txt
15=Rescue Egg.txt
[LEVEL]
20=
9F=

now when picking your music, you enter them in like this
[LEVEL]
20=UN Owen was her.txt
(this example assumes the txt file is named UN Owen was her and please note that it is case sensitive so if you rename it to something shorter, feel free to do so as long as you add the .txt extension)

romis addmusic can also insert more.asm for you if you add -se after

addmusic.exe romname.smc -se

this also inserts sfx, and doesnt make music insert, so do this step for songs needing the n-spc patch
(ill explain how to implement it into ports later)
so to sum it up, place the txt name in the ini and then do the cmd prompt (ill show you how to make a batch file in the advanced bit)


carols addmusic

this version of addmusic is basically perls addmusic but better, trust me as this version doesnt have most of those idiotic bugs 1.02 has.

carols addmusic is used with activeperl though not required, but is needed for other things and a faster music and some commands i think.

you use carols addmusic by double clicking it and just typing the roms name and then enter (you do not need .smc) but theres a catch, you need the txts in the music folder to be named a number

for overworld, 0A-1F
for level 20-FE
for ending ED1-4 (i think you have to use the first 3 at least)

heres some things you can do with the addmusic (theres commands not many would likely know about, i know little about some of them, so ill comment what i do know on each one.

(ignore the [ and ] when using these commands)
[-a]
Insert ADSR command by gocha, 757, homing, ROMI
(an adsr command is the n-spc patch, in this case, i believe this will put in carols more.bin which ill explain later)

[-l listfile name]
Insert music according to list file. An example is shown below:

11 OW1.txt
45 Level23.txt
ED1 Ending1.txt
MISC6 Pswitch.txt
(with this, it appears to allow you to not have to name your txts like so so you can keep track with a list i did in my own way but tracking the way romis did and lastly, you dont need .txt after them all for this list)

[-m]
create msc file.
Write music title in smc file only if title is defined in MML file.
But if you use list file option, write MML file name, even if title is not defined in MML file.
(i honestly have no clue how to work this, but i will tell you later how to handmake an .msc file)

[-b music number]
Change boss music.
You can't do music detal setting to boss room.
This option rewrite music list of Properties in Header setting.
For example, you set -b 21, custom music number 21 is used in boss room.
example: addmusic_e.pl -l list.txt -m -b 21
(this here is basically better off being done as a hex edit, ill leave a list of hex edits later on. if you wish to use this, go ahead as it doesnt seem so hard to do but i think this needs active perl due to the .pl file)
english manuel for carols addmusic
(i used this manuel to help commentate the commands, you may wanna keep this if you use carols addmusic)
i really hope its obvious the txt number is what slot in the music bypass the song got inserted to

a side note before i get to music porting, addmusic revx and gui are ripoffs of romis addmusic, they both are the same but they both have a stupid batch file anyone could make as well as it being more complicated then it needs to be, addmusic gui at the very least might be worth starting out with but i dont think it may be worth the try, if you want it, just pm me. the original addmusic needs an expansion kit to add a good amount of music and a clean rom, and last but not least, addmusicM is a new addmusic that i will have to cover after everything else. i currently do not understand brr sampling and will cover its use when its fully done, addmusicM needs activeperl.
Edited by omegazeroINFI, Jul 7 2010, 02:58 PM.
Offline Profile Quote Post Goto Top
 
omegazeroINFI
Member Avatar
Arcade Action
SECTION 2

ok were gonna make a basic port so i can show you the basic concepts and the limitations, im gonna end up having to tell a short story or 2 and how i started out for this.

starting with how i started out, (this is to teach a gigantic lesson)

When i first started hacking, the first thing i got interested in was the custom music, i began using perls addmusic since i didnt know what a command apt was at the time. i started inserting music like crazy till i hit and found errors i kept trying to work around. from here i wanted to figure out the errors and decided to learn how to port,
(i switched over to romis addmusic shortly before i started porting)

i learned about touhou music through the music section and found touhou midis from touhou 6 and started trying to port
U.N. Owen was her

ok now based on this, alot of people make the mistake of picking songs beyond difficult for even advanced porters to do.
un owen was her has like 10 to 16 tracks meaning your gonna have to do some elimination btw, this is what came out of it. decent for a first port i guess considering its difficulty
the lesson here is DO NOT PICK SONGS YOU TRULY WANT WHEN LEARNING TO PORT, YOU WILL WANT TO QUIT IF YOU DONT LUCK OUT AND MANAGE TO GET IT WORKING! (if you dont want to quit, you will at the least start becoming a little negative about the failiures and will probably try to get it requested and likely never ever get it. thing is that there is barely any music porters out there so learn how everything works and maybe you can pull off the song you want with time. though i guess it is worth mentioning that depending on the song you want depends on whether you should do it or not as you may want something uber easy to do)

ok now heres the snes's limitations in comparison to the kinds of music people always try to choose to port.

MAIN SNES LIMITS TO KEEP IN MIND
(if i dont get this stuff into your head, you will fail epically later on)

the snes uses spc700 as its music system that reads all the information, (this cannot be linked to 65c816 asm due to being separate systems but feel free to load and store to the sound effects which is in both spc700 and 65c816)

the snes only supports up to 8 sound channels
(yea this means a majority of your songs will most likely be hellish to get working properly, though you can make pretty good imitations by removing the lowest volumed bits and hope it overpowers some other bits for an excuse to remove some data and replace it for stuff that wouldnt be overpowered and would make it sound more like the original or something you can accept)

3 channels use sound effects
(channels 5, 7, and 8 use sound effects, a sound effect takes priority in spc700 and will stop the music from playing for the sound effect to play, the main music will come back after the sfx played its course, another thing to note about it, percussion will screw up if unspecified and placed on an sfx channel, anything else will cut its stuff out, so if i were you, id set the not so noticable channels on the sfx if your forced to use it)

each channel can only play 1 note at a time
(this mean chords will have to be split when porting if you want the proper notes playing, if you dont know what a chord is, its a note that plays more then 1 note at the same time)

spc700 can only handle octaves from o1 to o6
(this is another thing making porting hard, not all instruments can handle octaves being very high and some cant handle them being so low)

instruments
instrument list
here, you will find all the instruments in smw, youl need it, if for some reason you skip it, ill supply it again later

STUFF YOU NEED
heres what you will need,

Tinymm
this tool will make the MML file you need to start your port. if you compose, you may or may not need the mml file.

music porting tool
for the time being, your gonna wanna use this as it will make things go faster and let you see what was wrong with the mml if you ever tried to insert that (you need to use crtl c to copy and ctrl v to paste with this tool)

anvil studio
this will let you go into the midis and you can see the instruments they use and even more importantly remove any tracks if you have more then 8 or if you wanna reduce space

and an addmusic of your choice.
for the sake of seeing how i do things, heres my copy of romis addmusic

now heres the most important part about custom music most people dont seem to know, you need a midi of the song you want, a.mid file.
you can try and google for your midi or youtube search for it, you just gotta look. you can try vgmusic to find your midi, or you can look elsewere, to this day i still try to find a midi site other then vg or google and nobody can ever give me an answer

THINGS TO KNOW
now obviously you should know what a note is by now.
but what are the numbers after them? those are the note lengths.
the note lengths are 1, 2, 4, 8, 16, 32, and 64
every octave is a set of notes as the following
a b c d e f and g
each of these notes are higher or lower then each other,
the order is c d e f g a b, so as you see c is the lowest and b is the highest.

q7f this is another method of note lengths, think of it as a time signature? eh maybe not.

#0 this is the absolute most important part of the port. this specifies a channel, #0 goes up to #7 so thats 8 in all, refrain from using #4, #6 and #7 unless you really need to.

@0 now heres the second most important part of a song. the instrument, unless you want a bunch of flutes or a crash, i suggest you change these

y10 this is the panning, from 0 to 20, depends on if you hear it from the left more or the right more, simple as that

v255 this is the volume for a single channel, goes to 0 to 255

w255 this is the global volume, this hits every channel

t45 this is the tempo of the song, tells it how fast to play from 0 to 255, dont go above 100

r this is a rest, it also contains a length like a note does, silence is golden.

^ this is a tie, it ties notes together as well as rests, these will make things not so choppy

> and < these increase or decrease octaves by 1 level so say o3 would become o2 or o4. tinymm also gives you these incorrectly so you will have to flip them

; this in anything will make whatever on the same line after it not be read as code, if you didnt have it, the game would translate it into n-spc code

i just covered the basics, in the next part, we will do a port together using some if not all of what i just covered.
Edited by omegazeroINFI, Jul 7 2010, 01:49 AM.
Offline Profile Quote Post Goto Top
 
omegazeroINFI
Member Avatar
Arcade Action
SECTION 3

alright, for this example of how to port, (yes this time we actually are making a port) we will be using this midi for big blue,
( i dont care if you dont wanna do it, this is only to show the process of a basic port so you actually dont have to follow along as long as you understand what im about to do)

Posted Image
this picture is only small because im stuck with a netbook to take a snapshot of it with so compare it with the midi i gave you with anvil studio,

you will see that this midi is 8 tracks exactly, the first track is empty so it doesnt count.

now if you kept all 8 tracks, the midi uses these 8 instruments.
1. synth bass
2. muted trumpet
3. electric piano
4. muted trumpet
5. muted trumpet
6. rock organ
7. rock organ
8. drawbar organ

now if you looked at the instrument list, you'd probably think how am i supposed to port something if i don't have that instrument?
this is were sample banks would normally have came in, but a song like this has its own backdoor. simply ditch the 2 rock organs and the synth bass and you now have 5 channels which is perfect.
(make sure you delete the tracks before you export, just go to click the track your deleting at the very left to select it, like track 1 says big blue you know the empty one? click it at the left to select it, theres an option to delete the selected track)

we will now export the midi using anvil studios export midi format 0 file
which tinymm requires. to use tinymm, you simply drag the midi over it and it gives you an mml file. the mml wont really help you any as it is, but this is were the music porting tool comes in. (if you cant open mml files, just open it with notepad)

the mml will have stuff like this in it.
{ Ch 02 ===================================== }
r1
<a+4r2a+8g+4
r2^4^8
g+4r2g+8a+4
r2^4^8
a+4r2a+8g+4
r2^4^8
g+4r2g+8a+4
o4a+8f8g+8<c+8c8>g+8a+16^32r32

now clearly this kind of stuff isnt right.
with the music porting tool, you just copy all of the mml and then paste it with ctrl v into the left box.

the tool wants you to type in its bgm which happens to be 217
it also wants you to type in a volume and global volume which i always default at 255 despite what the midi says.

after that, you can convert it. but now we need to copy it from the right box using ctrl c, but you need to highlight it all first so click and hit ctrl a and then ctrl c, then you need to paste it into a blank txt in notepad and save it. from here on, you might need to close the txt and move it into your addmusic, if its romis, you know were to put it, and if its carols, well, lets hope you get the errors actually read to you.

if you done everything as i have done, you will get this for a text file. of course we still have to fix the text file of course, to do that, we need to go over to every #0. (if your first channel #0 doesnt have a t87, add it or it will play super slow, i realized later in this lesson that i didnt have the tempo set)

the first #0 can stay as it is, the rest need to be changed to a number of #1-#7.

since we only have 5 channels, we can change them to
#0
#1
#2
#3
#5

the 3 we didnt use all use sfx channels. understand? we dont want that.

all the @0s are flutes, what we need are 3 trumpets and an electric guitar and maybe a powerset.

yea, remember the drawbar organ? well if you looked in the midi, it said channel 10. no matter what under no circumstances should you ever pick the instrument it says because it will always be a percussion channel. like a gunshot does not sound like a drum set does it?

the channel numbers in the midi is the order we change the @0s from, so the first one would best be set as 6 which is a trumpet.
the next channel should be an electric piano which is 13.
the next 2 should also be trumpets @6.

the last channel, we will likely need to experiment, but it never hurts to pick a snare drum or a powerset first, the snare drum is 10 and the powerset is 29. well try using 29 to see if it works the way we want.

after changing all that, we will try to insert it to test for any bugs which are extremely common no matter what you try to port.

after trying to insert with romis addmusic, we will find its octaves are way beyond what they should be. this looks like a job for the music porting tool,

lets copy the failed to insert txt into the octave fixer and lower it a couple times.

if you did everything the way i said, you should have an octave being to low on 277, 333, and 387 twice each. with notepad, if word wrap is turned off, you can press ctrl g to jump to a line number.

jumping to 277 gives us this line
c32r8^16^32f+32r8^16^32f+32r16^32f+32r16^32<f+32r16^32f32r16^32
now see the < in here? you cant drop below o1 or it fails, so a simple solution here is to copy channel #5 and put that through the octave fixer and bring it up a couple octaves

there is something else we should do as precaution,
we go to replace in notepad which is under edit and were it says find,
we put y10 and in replace, we should put y10 o3 this way it defaults the octaves at o3 unless otherwise said.

the reason behind this is that what ever the octave was in the previous channel when it ends is what the next channel starts at.
sorta like this.

#0o2
a1a1a1a1ao4a1a1a1a1a
#1
b1b1b1b1b11b1b1b1b1b1

look here, channel #0 starts at o2 and raises to o4, so channel #1 starts at o4 rather then what it should be.

with everything we just did together, we will find it inserted.

now after you test the txt, youl find the percussion sounds a bit odd compared to the midi. we can fix that, but putting it back into the octave editor and raise it another or change the instrument or lower it, its all about experimentation. speaking of change octaves, wee need to raise the trumpets up 1 octave, we may as well bring up the electric piano as well so lets copy the entire txt and raise it by 1.

after we raised it, we found it didnt help the percussion any, but it improved the quality of the other 4 channels nicely.

since the percussion doesnt sound very good, we can either set its start octave to 3 or remove the percussion entirely in this port. (on a side note, the cello sounds stronger then the trumpet and possibly nicer, you can try swapping it out, remember to experiment, you may find you like it better or not, infact, this may actually be one of the ports that actually sounds great with the distortion guitar.)

from here on, we have a working port, but just wait till you get better at porting before you pick harder songs, try more basic ones like this one, and compare the midi instruments to the smw instruments, you may find that some instruments make great substitutes.

summing section 3 up,
you need to have a midi with 8 tracks or less before your ready to port. put the mml through music tool, get it converted, set channels and instruments, go through each channel individually and find octave errors, then deal with each channel that has the issue one at a time, test, experiment, test, experiment, youl get it eventually,

in the next section, we will explain some of the more advanced stuff to apply to basic porting.

(i will continue this later, i have been doing this nonstop so if you have any questions, pm me)
Edited by omegazeroINFI, Jul 7 2010, 03:34 AM.
Offline Profile Quote Post Goto Top
 
omegazeroINFI
Member Avatar
Arcade Action
SECTION 4

ok, maybe the last section wasnt the best explained, but as long as you saw how the process worked in a way, i guess i got my point across,

OTHER COMMANDS
please note that any command talked about in section 2 and now except the #0 command can be specified anywere and at anytime in a txt, like you can change instruments mid channel whatever you want, from here on if theres a command that shouldnt be used to change mid channel, ill note it in my descriptions

the first of new commands im gonna talk about is the ADSR command.
this command makes ports require more.asm aka the n-spc patch.
ADSR stands for

Attack
Decay
Sustain
Release

Posted Image

Attack Wait until the tone reaches the maximum volume. (Red)
Decay Then add some sharpness to it. (Blue)
Sustain Delay of the tone. (Green)
Release Fading of the tone. (maximum volume is 1/10 for the specified time)

ok, now to teach how to use this command, it actually varies about how its used as there is a nice amount of combos to use and try as you need to do some math to get a command.
see chart below

Posted Image

the ADSR command is entered into a port by placing

$ED $XX $YY

(1) & (2) are commands in $XX
(3) & (4) are commands in $YY

Let's say you want the length of 0,38 seconds (380 msec).
(1) = 5 from the table.

$XX works as follows:
Format:
(2)(1)

Example:
(1) = 5, (2) = 3 would be $65 in that case.
(3x10 = 30 → 60 + 5 = 65)

All you do is mulitply (2) by 10 and add (1) to it.


$YY works as follows:
Format:
(3)(4)

Example:
(3) = 5, 4 = 1D would be $BD in that case.
(5x2 = A → Ax10 = A0 → A0 + 1D = BD)

so do you see how you find the command now? just use this chart and a calculator.

here is a default command i probably should have mentioned in section 2, but this basic command can lead to advanced things so here it is.

the p command or vibrato as i should say it,

Normally, notes will hold until they either gradually fade out or are replaced with another note or rest. With vibrato, however, each note will waver. It's similar to the way singers will have a slight wavering to a specific note as they sing it.

Vibrato is inserted via p###,### with the first number (0-255) being the wavelength, and the second (0-255) being the amplitude. The higher the wavelength, the longer it'll take for the note to dip up and down, and the higher the amplitude, the higher or lower it will dip down. So, if you wanted very strong, quick vibrato, you'd pick a short wavelength and high amplitude, such as p25,200

the intro command. this command makes a certain part of a song not play again in a channel, THIS MEANS YOU HAVE TO SET IT IN EVERY CHANNEL.
its simple really, you just place a / in the txt to make everything before it not play again after the song finishes playing the first time. to make good use of this command, your gonna either have to
A. count each note till the intros done for each channel so they all have the same amount of note counts passed
(this means like if you place an intro after a1^1, in one channel and another channel has r1r4r4r4r4, you would place the intro in the channel with r1r4r4r4r4 because 4 4th notes or rests equals 1 full note,

B. i know i said this before, EXPERIMENT!
(you have no idea how easy it is to lose patience to find the intro until you have tried it yourself, but ports take time and time is what you should take slowly to make things worth the effort)

heres another example of the intro command in use

;Example Song - Two Channels
; / command used in both channels
#0
b4b4c4c4d4d4r2
/
c2d4c2d1r1

#1
f4e4f4d4e4f2r4
/
c16b16r1e4


new command, the L command,
this little command here can be placed more then once in the same channel, but i dont recommend it, you simply type L (not case sensitive) with a number length next to it,
l1 l2 l4 l8 l16 l32 l64 you name it! (no seriously thats all you have to pick from)

when using this command, whatever length you specify after a note can be removed. like you have a clutter of 8th notes, an l command l8 will allow you to have the notes without the 8 after them. simple right? i didnt mention this before because aside from that and lowering txt file size, it serves no purpose.
it looks like this

#0 l16
abcbab+a-
a1b4
(all the ones without a length are 16)

The ? command within the song code is used to terminate the music completely. This is excellent for things such as sound effects, since if you did not use it, the SFX would loop endlessly.
? is often followed by a 0.
?0
this should be placed at the top of the txt i guess, i never really had to use it.


Triplet brackets are probably the most rarely used command, but they do have a purpose. Some songs, usually ones written in 3/4 time, contain triplets (essentially, three notes played in a steady rhythm. The problem with triplets is that you have to manually insert them - tinymm does not render triplets properly. Here are two examples to properly show the difference between a song that doesn't use triplets, and one that does.

Example 1
;Example Song - One Channel
;Without triplet brackets
#0
a8g8a8g8
c8d8e8c8d8e8c8d8e8
a8g8a8g8

Example 2
;Example Song - One Channel
;With triplet brackets
#0
a8g8a8g8
{c8d8e8} {c8d8e8} {c8d8e8}
a8g8a8g8

Triplet brackets allow a song such as this to flow more smoothly; however, they should only be used when necessary (i.e. if the original track contains triplets).

before i go any further, these next few bits are for making music insert size smaller, this is also required when submitting to smwcentral. you see,
from what i heard, carols addmusic can only insert 7000 bytes per music bank which i will shorten to bpm. im really not sure if carols addmusic really is limited to 7000 bpm but if it is, all more reason to use romis for porting.
romis addmusic has a bpm of around 15000 bytes which is great if you port like me were your ports are over 9000 bytes no joke intended. (im serious, most of my ports insert sizes are humongous)
addmusicM is supposed to have a bpm of around 11000. but dont worry, were using romis.

one last thing to mention about insert size, the text file size has little to do with a txts insert size, so do NOT focus on the txt size but rather what the insert bytes you are told about when inserting your music, you can tell this by inserting 1 song at a time. like a 2gb txt could easily have an insert size of 500 bytes which normally would never happen.
(if you want me to give you a txt like that, pm me :D)

heres the first of few ways to reduce the insert size.
its called looping.

you use looping brackets [ and ], looping is simple,

Looping is one of the most vital techniques when porting or composing music, as it is often the key in reducing the size of the file insertion. Remember, if you are planning on submitting a custom song to SMW Central, your best bet is to make sure you have looped as much as possible.
Looping is quite simple. It requires the use of Loop Brackets [ which contain the data to be looped. The normal syntax is this:

[note data]#

The note data within the brackets is the data you want to loop, and the # directly afterwards is the amount of times to loop the enclosed data. Let's take a look a a simple example.

Example 1a:
;Example Song - One Channel
;An unlooped track
#0
d8d16c8c16
d8d16c8c16
d8d16c8c16
d8d16c8c16

As you can see in the above example, the four notes seems to repeat four times. Because of this, you can place the first four notes within loop brackets, and then type the number 4 directly after in order to call the loop four times. See the following:

Example 1b:
;Example Song - One Channel
;A looped track
#0
[d8d16c8c16]4

There. You have now looped the data, and cut the amount of bytes that the channel uses by a large amount.
Sometimes, however, the loops may be larger and they may have different things besides notes in them. They may also be harder to spot due to awkward spacing from the conversion from MIDI to .MML. See the following unlooped example:

Example 2a:
;Example Song - One Channel
;An unlooped track
#0
c8^16e8^16f4g8a8b16
>c8d4^8<
c8^16e8^16f4g8a8b16
>c8d4^8<
c8^16e8^16f4g8a8b16
>c8d4^8<
c8^16e8^16f4g8a8b16
>c8d4^8<
c8^16e8^16f4g8a8b16
>c8d4^8<

You may notice there are five chunks of the same data here. See the following looped example:

Example 2b:
;Example Song - One Channel
;A looped track
#0
[c8^16e8^16f4g8a8b16
>c8d4^8<]5

A very important thing to note when using loops with <'s and >'s is that the amount of <'s and >'s within the loop MUST be equal, unless a rare circumstance occurs in which the song continues rising/falling in pitch during the loop. See the following for a BAD example of looping.

Example 3a:
;Example Song - One Channel
;An unlooped track
#0
o3
b8>c8d8e8f8g8
<b8>c8d8e8f8g8
<b8>c8d8e8f8g8
<b8>c8d8e8f8g8

Example 3b:
;Example Song - One Channel
;An incorrectly looped track
#0
o3
[b8>c8d8e8f8g8]4

Example 3c:
;Example Song - One Channel
;A correctly looped track
#0
o4
[<b8>c8d8e8f8g8]4

Let's look at Example 3b. The channel starts on o3, and then enters the loop. When it hits the first >, it jumps to o4. That's fine. However, it loops BACK to that point without ever going back down - therefore, it would jump to o5. It would continue to do this until the loop ends, and in most cases, the octave will exceed o6 (or o1, if you were decreasing the octave), thus causing an error. Therefore, this track is looped incorrectly.

Example 3c is done properly. As seen in Example 3a, the bottom three rows all have a < and >, thus evening them out, but the top one only has a >. However, this can be easily fixed by adding a < just before the "b8", which would make the first line match the three below it. You can then safely loop this. However, you may have noticed that the o3 was raised to o4. Why? Simple. If you're adding a < to the beginning of the row, that would be that the original o3 becomes an o2, whereas we want it to stay at o3. By simply bumping the o3 up to an o4, this can be easily fixed.


Relatively new compared to other methods, labels are very handy for music porting. They are far more versatile than the standard brackets, and allow for an even smaller insert size if used correctly.

Labels are represented by a number in parenthesis, such as (9). An amount of music data, assigned by brackets, will be registered under a label, and if that same string of data occurs later in the song, the label can be used instead of the music data repeating.

Example 1a:
;Example Song - One Channel
;song without labels
#0
o3
b16a4b4c8b8r1c8
b16a16
b16a4b4c8b8r1c8
c8b8r4
c16d16r8
b16a4b4c8b8r1c8

Due to the song's layout, the recurring lines can't just be looped. If the first recurring line has a label added before it, as well as the actual data within a bracket with a 1 on the end, a label can be used.

Example 1b:
;Example Song - One Channel
;song with labels
#0
o3
(3)[b16a4b4c8b8r1c8]1
b16a16
(3)
c8b8r4
c16d16r8
(3)

It's important to point out that while there really is no limit to the amount of labels that can be made in a song, the same label number cannot be assigned for more than one piece of music data. For example, if, somewhere else in the song, (3) had been assigned to another bracket of music data, there would've been an error.
Labels can also repeat the designated music data more than once if the number of times it should repeat is added to the end. Labels can be assigned to a bracket that loops more than once, however, the label will disregard the amount of times the data loops inside the bracket. In other words, if a label is assigned to a bracket that loops 4 times, the label will only play the music data once if used later.

Example 2a:
;Example Song - One Channel
;song without labels
#0
o3
[f4e4f4g4f4e4f4d4]4
b16a16r2
f4e4f4g4f4e4f4d4
r16a4b4
[f4e4f4g4f4e4f4d4]2
d2c2a2b4
[f4e4f4g4f4e4f4d4]4

A label can be assigned to the chunk of music data in the first bracket, even though it has a 4 on the end. However, if the label is used later, that data will only play once instead of four times, unless it is designated to loop more with a number at the end

Example 2b:
;Example Song - One Channel
;song with labels
#0
o3
(2)[f4e4f4g4f4e4f4d4]4
b16a16r2
(2)
r16a4b4
(2)2
d2c2a2b4
(2)4

Labels are often used in tandem with standard looping, and when you're able to correctly and efficiently use them both in a song, it makes the file size reduction process far easier.

NOTE: This command is now obsolete with the addition of label looping.
The asterisk was, at one time, a relatively useful command. If a string of data appeared more than once in a channel, but not in a row, you could use the * to call the data. The downside was that it would only call the first loop in the channel.
The asterisk could also be followed by a number (i.e. *3), which would loop the data three times.

Example 1a:
;Example Song - One Channel
;asterisk not used
#0
e8d8c8d8e8
e8d8c8d8e8
f8f8f8f8f8
g8g8g8g8g8
e8d8c8d8e8
e8d8c8d8e8
d1^1
f8f8f8f8f8

Example 1a:
;Example Song - One Channel
;asterisk and loop brackets used
#0
[e8d8c8d8e8]2
[f8]5 [g8]5
*2
d1^1
[f8]5

As stated earlier, you would not be able to use an asterisk on [f8]5 in the above loop since it is the SECOND loop in the channel. The asterisk only works on calling the first.

The period is an interesting command within the music code. It is another method used to reduce the file size of notes that are affected by ties. This command requires more of a visual explanation, so please take a look at the following data:

Example 1a:
;Example Song - Two Channels
;typical data without the period command
#0
d1^2^4^8 c2^4^8^16^32
d4^8 d2^8^16

#1
d4^16d4^16c4^8^16^32c1^4^8

Example 1b:
;Example Song - Two Channels
;data using the period command.
#0
d1..8 c2...32
d4^8 d2^8^16

#1
d4^16d4^16c4..32c1^4^16

Essentially, if a note has a tie which uses note lengths in ORDER from longest to shortest (note: remember, the note lengths are 1,2,4,8,16,32,64), then the period can be used to replace the tie. For instance, d1^2^4^8 can become d1..8 since the three tied lengths after that are in order. However, a note like c1^4^16 could NOT use the period since the order is broken. There would need to be a 2 in between the 1 and 4, and an 8 between the 4 and 16.

this tool addmusic minimizer is not recommended,
i dont remember how to use it entirely, so heres a tutorial on it if you decide to use this thing


(will continue in 5, not sure how much more i can fit here)
Edited by omegazeroINFI, Jul 7 2010, 01:00 PM.
Offline Profile Quote Post Goto Top
 
omegazeroINFI
Member Avatar
Arcade Action
SECTION 5

CONTINUATION
i didnt get to cover everything last section, so lets continue.

now that we covered ways to reduce txt size, lets now cover other commands we can implement into a port.

heres yet another command you can use in ports, the & command.
this command here must always be placed between notes, not rests or anything else (& is for very small pitch bends which is extremely limited)

a1&c1 will make a very slight pitch bend in these 2 notes, try it out if you feel you need a tiny pitch bend in your port.


i guess we will start going over the other hex commands to use in ports, now unlike the $ED command, these will not require you to use more.asm on your rom first.

here is a special tool i have been using hand in hand with the music tool to make ports as well as trying to learn the hex commands, so until i can properly explain them, ill skip ahead and fill this in later.
when using the echo command, do not set the delay past 4 or it will glitch the emulator.

SAMPLES

samples are a way to get sound samples into your ports, and it requires this tool to rip wav samples from snes roms

and this tool to insert the wav samples or rip from an spc file from either another game or another port

to use sample tool, well, have you ever had a dong that had a sample bank in the zip? well, you open your rom in sample tool and then import the sample bank from file. once you do this, all you must do now is select the level to put that sample bank number on which at first is most likely 13. then you insert your music into that level,
its worth the effort if you want it badly,

to make your own sample banks, your gonna want to take thisoptimize bank so you have freespace to insert samples to use.

this is something that a tutorial cant really teach as well, its just way to easy to figure out when it does exactly what the stuff says.
just remember to change the bank your editing and save the bank before changing it again when you got what you wanna keep or you gotta do it again. after saving the bank, go to file and save the rom so you get to keep all this setting and stuff.

the last thing i can really explain for now is how carols more.bin works.
carols more.bin also allows the $ed command, but it has a different tuning value as well, i cant explain this very well.
carols more.bin also allows for the $E5 command which allows for extra samples.

the formula is

$E5 $sample number plus 80 in hex $how much to tune it by
for the first fill in blank bit, use a calculator and you will be fine,
for the second bit, start at 1 and move up till it sounds how you want it.
Offline Profile Quote Post Goto Top
 
omegazeroINFI
Member Avatar
Arcade Action
reserved for future addition
Offline Profile Quote Post Goto Top
 
omegazeroINFI
Member Avatar
Arcade Action
reserved for future addition

also it is now free to post any questions
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Fully Featured & Customizable Free Forums
« Previous Topic · Resources · Next Topic »
Post Reply

SMW Archives created by Goron50, MeccaPrime and MetalBenderJem.

Thank-you for visiting~!