News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Metroid Tuner

Started by snarfblam, January 29, 2012, 08:21:38 PM

Previous topic - Next topic

Stinktier

#25
Is there a way Editroid can recognize the selection of music? Seeing that it can switch between normal / item room music. I'd be happy with any in-editor workaround, if there currently is one, but for a future update it would be cool if music data within the current bank could be toggled in a cyclic manner just like enemy types etc.

I know the current behaviour reflects the pointers/variables in zero page flipping item music on/off, but i'm guessing that isn't what's happening when tourian music is changed into mother brain music, no? (is it the mother brain in room flag which triggers this)? If that's the case that would mean the game already is catering for us to facilitate the extra music data in each level, right?

Also, i wanted to discuss som musical-technical aspects to clear some question marks over my head. Quoting some stuff from Snarfblam's very helpful blog post:
Quote[TriangleLength] affects how long notes play on the Triangle song track. 00, 0F, and F0 are the only meaningful values here. I wish I could tell you exactly what they mean. [Sq1VolumeTable] and [Sq2VolumeTable] specify which "volume table" each of the Square song tracks use. This affects the sound of the track's "instrument."

-Does triangleLength actually refer to the triangle channel's decay/release slope?

It seems a bit odd that volume would have something to do with the square wave's timbre, or "instrument"? Is VolumeTable simply refering to a table which defines both amplitude AND the duty-cycle of the square (normally where the change of timbre comes in play)?

Thanks for this awesome tool.  :^_^:

snarfblam

Quote from: Stinktier on July 06, 2014, 04:44:17 PM
Is there a way Editroid can recognize the selection of music?
The engine has a built in feature to change music for item rooms, but that's the extent of that feature.

Mother Brain's room actually uses special doors that trigger the music change. These work by setting the music depending on which way you go through the door. You would have to design the level layout to suit the mechanics of the doors.

It wouldn't be too hard to code in some screen-load ASM to change the music when you enter a room. The game would revert back to normal music again after you get an item or go through an item room (this applies to the doors in Tourian as well); another problem to be solved by ASM. I can look into this at some point down the road.

Quote from: Stinktier on July 06, 2014, 04:44:17 PM
-Does triangleLength actually refer to the triangle channel's decay/release slope?
One value specifies that the tone will sound for the duration of the note, another specifies that the tone will sound briefly, and I forget what the third specifies. The triangle channel has no volume control, so there is no decay.

Quote from: Stinktier on July 06, 2014, 04:44:17 PM
Is VolumeTable simply refering to a table which defines both amplitude AND the duty-cycle of the square (normally where the change of timbre comes in play)?
"VolumeTable" is the volume envelope. I don't think the utility can edit the duty-cycle, but it's not hard to do by hand in a hex editor with the disassembly for reference.

Stinktier

Thanks for the clarification! Actually the door mechanic is perfect for me; i tried it out last night. However, the change of music didn't revert when passing through another special door in the other direction. I haven't had the time to see if this holds true in vanilla tourian aswell. My initial thought is that since there is no alternate music in brinstar on an expanded rom (right?), there is no "end-of-music-data message" either, which might be needed for the game to switch. This is just ideas from a lunch break without looking at the disassembly, though. Will try to insert some music soon enough and see if that changes things.

Grimlock

How would I go about silencing the various tracks so I can work on each of them individually?

Square1
Square2
Triangle
Noise

Would you recommend I use several "-" until I'm ready to work with them?

Something along these lines:

5 { // --------------
:0C
- - - - - - - - -
} //   --------------


And then to silence a track I have already set up would I simply do this:
(and maybe add some temporary rests in order to have something in the track? (or do I have to have anything in the track at all?)

//5 { // --------------
// :0C
// A3 B3 C3 D3 E3 F3
// :0C
// E3 D3 C3 B3
//} //   --------------


Over all the editor isn't that difficult to work with.  I'm using a virtual keyboard to help aid in the process:

http://www.bgfl.org/bgfl/custom/resources_ftp/client_ftp/ks2/music/piano/

It works but I'm going to try and find one with a wider range of keys.

Tip to anyone interested in using Metroid Tuner:  I keep the test rom open in Editroid, when the music data is inserted Editroid detects the change and gives you the option to reload the file, select "Reload File".  Then you can Ctrl+Click a screen to hear the music you just inserted, Simple! 

snarfblam

#29
I think I used the rests trick a few times. Unfortunately, while the sound engine has provisions to disable a channel, Metroid Tuner does not make this feature accessible (beyond reporting that a disabled track could not be dumped). For the most part it never became an issue for me because I worked out one section of the song at a time, inserting data for all tracks at the same time. Obviously, not everyone works the same way. Inserting rests at the beginning is your best bet.

As far as a virtual keyboard, Virtual Media Piano Keyboard is both simple and handy. Supports midi input, computer keyboard, and clicking keys with the mouse.

The Monster of Surrealton

*See something about changing music in Metroid*

*Gets hyped at the idea of inserting Journey to Silius and Batman: Return of the Joker music into Metroid*

*Sees coding*

*Sees that it's not as simple as I thought*

*Comes back to reality*

*Still thinks this is awesome*

crazyal02

Quote from: The Monster of Surrealton on September 16, 2014, 08:03:43 PM
*See something about changing music in Metroid*

*Gets hyped at the idea of inserting Journey to Silius and Batman: Return of the Joker music into Metroid*

*Sees coding*

*Sees that it's not as simple as I thought*

*Comes back to reality*

*Still thinks this is awesome*
Well, you could still do it if you had the patience

Grimlock

#32
My initial idea was to work with one track, tinker with it until I like it then build up the next track with it until I work my way through all of them.  I think your idea of putting it together outside of the program and inserting as one is a better approach.  I'm going to put together a spreadsheet to help wrap my mind around the note length limitations and generally organize myself.

The work arounds to silence all but one track will be good to get a feel for what each of them sound like.  I'll continue to use it for that.

EDIT: I forgot to ask, is there a good way to keep track of how much memory I have used in each track?  It definitely lets me know when I have exceeded it.  Do I count the notes and note lengths?  How much memory do they each represent?  I can work in a formula in my spreadsheet to count up and display used and remaining memory.

Grimlock

#33
The biggest challenge I'm encountering using this utility is working within the limits of the original memory.  Its tricky, kind of like a puzzle.  You have to figure out what limitations your working with in each area and then see if you can make something interesting with it.  Converting over music from other games or sources would be very challenging.

The text format is actually pretty easy, I would encourage anyone on the fence about this app to put a couple hours into it.

This might be useful to those who's brain doesn't work in HEX.  I converted the HEX values in the note length tables to human numbers.  Also fractions of a second:

EDIT: Updated image to include additional values
[spoiler]
[/spoiler]

I used some simple Excel formulas. 

EDIT: Here is a direct copy of the tables from the disassembly:
;The following tables are used to load the music frame count addresses ($0640 thru $0643). The
;larger the number, the longer the music will play a solid note.  The number represents how
;many frames the note will play.  There is a small discrepancy in time length because the
;Nintendo runs at 60 frames pers second and I am using 64 frames per second to make the
;numbers below divide more evenly.

;Used by power up music and Kraid area music.

NoteLengths0Tbl:
LBEF7: .byte $04 ;About    1/16 seconds ($B0)
LBEF8: .byte $08 ;About    1/8  seconds ($B1)
LBEF9: .byte $10 ;About    1/4  seconds ($B2)
LBEFA: .byte $20 ;About    1/2  seconds ($B3)
LBEFB: .byte $40 ;About 1       seconds ($B4)
LBEFC: .byte $18 ;About    3/8  seconds ($B5)
LBEFD: .byte $30 ;About    3/4  seconds ($B6)
LBEFE: .byte $0C ;About    3/16 seconds ($B7)
LBEFF: .byte $0B ;About   11/64 seconds ($B8)
LBF00: .byte $05 ;About    5/64 seconds ($B9)
LBF01: .byte $02 ;About    1/32 seconds ($BA)

;Used by item room, fade in, Brinstar music, Ridley area music, Mother brain music,
;escape music, Norfair music and Tourian music.

NoteLengths1Tbl:
LBF02: .byte $06 ;About    3/32 seconds ($B0)
LBF03: .byte $0C ;About    3/16 seconds ($B1)
LBF04: .byte $18 ;About    3/8  seconds ($B2)
LBF05: .byte $30 ;About    3/4  seconds ($B3)
LBF06: .byte $60 ;About 1  1/2  seconds ($B4)
LBF07: .byte $24 ;About    9/16 seconds ($B5)
LBF08: .byte $48 ;About 1  3/16 seconds ($B6)
LBF09: .byte $12 ;About    9/32 seconds ($B7)
LBF0A: .byte $10 ;About    1/4  seconds ($B8)
LBF0B: .byte $08 ;About    1/8  seconds ($B9)
LBF0C: .byte $03 ;About    3/64 seconds ($BA)

;Used by intro and end game music.

NoteLengths2Tbl:
LBF0D: .byte $10 ;About    1/4  seconds ($B0)
LBF0E: .byte $07 ;About    7/64 seconds ($B1)
LBF0F: .byte $0E ;About    7/32 seconds ($B2)
LBF10: .byte $1C ;About    7/16 seconds ($B3)
LBF11: .byte $38 ;About    7/8  seconds ($B4)
LBF12: .byte $70 ;About 1 13/16 seconds ($B5)
LBF13: .byte $2A ;About   21/32 seconds ($B6)
LBF14: .byte $54 ;About 1  5/16 seconds ($B7)
LBF15: .byte $15 ;About   21/64 seconds ($B8)
LBF16: .byte $12 ;About    9/32 seconds ($B9)
LBF17: .byte $02 ;About    1/32 seconds ($BA)
LBF18: .byte $03 ;About    3/64 seconds ($BB)




Now I just need to get a better idea of how to gauge how many notes and such I can put in a specific memory limitation, specifically how much memory does each note and note length equal (so I can plan my tracks within the limits before inserting them)

EDIT:  For future reference:
1 byte - Track start
2 bytes - Repeat
1 byte - Note length
1 byte - Note or sound
1 byte - "00" Song terminator

Note: It appears that the first byte of a repeat combines with the note length.  So a repeat with a length change is 2 bytes and a length change by itself is 1 byte.  If I find otherwise I'll edit this post to reflect my findings.

(END EDIT)

Also I've been trying to use this app to silence my neighbors dog that continuously barks early in the morning.  You mentioned terminating fuzzy domesticated feline critters as a side feature (in your blog), is there a way to modify it to target canines?  :nod: (if not you should seriously consider expanding this area of your app in future releases  :<_<: )



Quietus

You need to make it so that whenever it's in use, it emits a high pitched, repeated whistle.  Then you can laugh at the owners going crazy at their dogs going nuts for no reason. :^_^:

Grimlock

Ah, yes, a work around! And a fine one at that, thank you Quietus.  I wonder if a C# in octave 999 would do it!

Off to experiment....   :twisted:

snarfblam

Quote from: Grimlock on September 17, 2014, 06:00:33 PM
The biggest challenge I'm encountering using this utility is working within the limits of the original memory.  Its tricky, kind of like a puzzle.  You have to figure out what limitations your working with in each area and then see if you can make something interesting with it.  Converting over music from other games or sources would be very challenging.

In case you aren't aware, each level stores its music in a separate bank. With the exception of Tourian, every level's bank contains at least one unused song. For example, Brinstar's bank contains a copy of the Tourian theme. Kraid's bank contains a copy of the music from both Ridley's area and Tourian.

You're free to overwrite these duplicated songs. The disassembly can help you make sense of where the data is located. If you look at the Brinstar bank at $BE47, you'll see that all three tracks for the (unused copy of the) Tourian theme are stored contiguously, meaning this section of memory could be used for a single track for a longer song if needed.

Grimlock

#37
I'm new to this but I definitely want to try to understand, could you give a brief run down on what this information represents:

(Or am I even looking in the right location (Brinstar Bank - searched "$BE47"))

;Tourian music
LBDC0: .byte $0B, $FF, $03, $00, $00
LBDC5: .word $BE59, $BE47, $BE62, $0000


Here's all the other adjacent code disassembly:


InitMusicTbl:

;Mother brain music(not used this memory page).
LBD31: .byte $0B, $FF, $F5, $00, $00
LBD36: .word $0100, $0300, $0500, $0000

;Escape music(not used this memory page).
LBD3E: .byte $0B, $FF, $00, $02, $02
LBD43: .word $0100, $0300, $0500, $0700

;Norfair music(not used this memory page).
LBD4B: .byte $0B, $FF, $F0, $04, $04
LBD50: .word $0100, $0300, $0500, $0700

;Kraid area music(not used this memory page).
LBD58: .byte $00, $FF, $F0, $00, $00
LBD5D: .word $0100, $0300, $0500, $0000

;Item room music.
LBD65: .byte $0B, $FF, $03, $00, $00
LBD6A: .word $BDDA, $BDDC, $BDCD, $0000

;Ridley area music(not used this memory page).
LBD72: .byte $0B, $FF, $F0, $01, $01
LBD77: .word $0100, $0300, $0500, $0000

;End game music(not used this memory page).
LBD7F: .byte $17, $00, $00, $02, $01
LBD84: .word $0100, $0300, $0500, $0700

;Intro music(not used this memory page).
LBD8C: .byte $17, $00, $F0, $02, $05
LBD91: .word $0100, $0300, $0500, $0700

;Fade in music
LBD99: .byte $0B, $00, $F0, $02, $00
LBD9E: .word $BE3E, $BE1D, $BE36, $0000

;Power up music
LBDA6: .byte $00, $00, $F0, $01, $00
LBDAB: .word $BDF7, $BE0D, $BE08, $0000

;Brinstar music
LBDB3: .byte $0B, $FF, $00, $02, $03
LBDB8: .word $B000, $B057, $B0C1, $B12B

;Tourian music
LBDC0: .byte $0B, $FF, $03, $00, $00
LBDC5: .word $BE59, $BE47, $BE62, $0000



Thanks.


snarfblam

I tend to forget that the disassembly isn't immediately understandable for people who haven't been referring to it for years. What I was referring to is this:

[spoiler=this]TourianSQ2IndexData:
LBE47:   .byte $B4         ;1 1/2 seconds
LBE48:   .byte $12         ;A2
LBE49:   .byte $B3         ;3/4 seconds
LBE4A:   .byte $10         ;Ab1
LBE4B:   .byte $18         ;C2
LBE4C:   .byte $16         ;B2
LBE4D:   .byte $0A         ;F1
LBE4E:   .byte $B4         ;1 1/2 seconds
LBE4F:   .byte $14         ;A#2
LBE50:   .byte $12         ;A2
LBE51:   .byte $B3         ;3/4 seconds
LBE52:   .byte $10         ;Ab1
LBE53:   .byte $06         ;D1
LBE54:   .byte $0E         ;G1
LBE55:   .byte $04         ;C#1
LBE56:   .byte $B4         ;1 1/2 seconds
LBE57:   .byte $0C         ;F#1
LBE58:   .byte $00         ;End Tourian music.

TourianSQ1IndexData:
LBE59:   .byte $E0         ;
LBE5A:   .byte $B0         ;3/32 seconds   +
LBE5B:   .byte $54         ;F#4      |
LBE5C:   .byte $4E         ;D#4      |
LBE5D:   .byte $48         ;C4      | Repeat 32 times
LBE5E:   .byte $42         ;A4      |
LBE5F:   .byte $48         ;C4      |
LBE60:   .byte $4E         ;D#4      +
LBE61:   .byte $FF         ;

TourianTriangleIndexData:
LBE62:   .byte $E0         ;
LBE63:   .byte $B3         ;3/4 seconds   +
LBE64:   .byte $02         ;No sound   |
LBE65:   .byte $B0         ;3/32 seconds   |
LBE66:   .byte $3C         ;F#3      |
LBE67:   .byte $40         ;Ab3      |
LBE68:   .byte $44         ;A#4      |
LBE69:   .byte $4A         ;C#4      |
LBE6A:   .byte $4E         ;D#4      |
LBE6B:   .byte $54         ;F#4      |
LBE6C:   .byte $58         ;Ab4      | Repeat 32 times
LBE6D:   .byte $5C         ;A#5      |
LBE6E:   .byte $62         ;C#5      |
LBE6F:   .byte $66         ;D#5      |
LBE70:   .byte $6C         ;F#5      |
LBE71:   .byte $70         ;Ab5      |
LBE72:   .byte $74         ;A#6      |
LBE73:   .byte $7A         ;C#6      |
LBE74:   .byte $B3         ;3/4 seconds   |
LBE75:   .byte $02         ;No sound   +
LBE76:   .byte $FF
[/spoiler]

Those labels what begin with "L" specify the address the instruction/data is from. This song runs from BE47 to BE76. That's $30 (48) bytes. Admittedly, it's not that much (a lot more than, say, Brinstar's original 10-byte drum track), but I also just noticed this at B135:

[spoiler=this];Unused tile patterns.
LB135:   .byte $E0, $E0, $F0, $00, $00, $00, $00, $00, $00, $00, $00, $21, $80, $40, $02, $05
LB145:   .byte $26, $52, $63, $00, $00, $00, $06, $07, $67, $73, $73, $FF, $AF, $2F, $07, $0B
LB155:   .byte $8D, $A7, $B1, $00, $00, $00, $00, $00, $80, $80, $80, $F8, $B8, $F8, $F8, $F0
LB165:   .byte $F0, $F8, $FC, $00, $00, $00, $00, $00, $00, $00, $00, $07, $07, $07, $07, $07
LB175:   .byte $03, $03, $01, $00, $00, $00, $00, $00, $00, $00, $80, $FF, $C7, $83, $03, $C7
LB185:   .byte $CF, $FE, $EC, $00, $30, $78, $F8, $30, $00, $01, $12, $F5, $EA, $FB, $FD, $F9
LB195:   .byte $1E, $0E, $44, $07, $03, $03, $01, $01, $E0, $10, $48, $2B, $3B, $1B, $5A, $D0
LB1A5:   .byte $D1, $C3, $C3, $3B, $3B, $9B, $DA, $D0, $D0, $C0, $C0, $2C, $23, $20, $20, $30
LB1B5:   .byte $98, $CF, $C7, $00, $00, $00, $00, $00, $00, $00, $30, $1F, $80, $C0, $C0, $60
LB1C5:   .byte $70, $FC, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $01, $00, $00, $00, $00
LB1D5:   .byte $00, $00, $00, $80, $80, $C0, $78, $4C, $C7, $80, $80, $C4, $A5, $45, $0B, $1B
LB1E5:   .byte $03, $03, $00, $3A, $13, $31, $63, $C3, $83, $03, $04, $E6, $E6, $C4, $8E, $1C
LB1F5:   .byte $3C, $18, $30, $E8, $E8, $C8, $90, $60, $00, $00, $00[/spoiler]

That's $CB (203) additional free bytes. Then, there's this:

[spoiler=this];Not used.
LBF56:   .byte $10, $07, $0E, $1C, $38, $70, $2A, $54, $15, $12, $02, $03, $20, $2C, $B4, $AD
LBF66:   .byte $4D, $06, $8D, $8D, $06, $AD, $5E, $06, $A8, $B9, $2A, $BC, $A8, $A2, $00, $B9
LBF76:   .byte $61, $BD, $9D, $2B, $06, $C8, $E8, $8A, $C9, $0D, $D0, $F3, $A9, $01, $8D, $40
LBF86:   .byte $06, $8D, $41, $06, $8D, $42, $06, $8D, $43, $06, $A9, $00, $8D, $38, $06, $8D
LBF96:   .byte $39, $06, $8D, $3A, $06, $8D, $3B, $06, $60, $FF, $00, $00, $00, $00, $00, $00
LBFA6:   .byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
[/spoiler]

That's $5A (90) bytes. There's also this, but if you intend to use it, you might want to double check that this isn't used by Editroid/custom ASM. (You can compare a build of your hack with an original ROM by looking at $8FE5 in a hex editor).

[spoiler=this]
;Not used.
LBFD5:    .byte $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $00, $00, $00, $00, $00
LBFE5:    .byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
LBFF5:   .byte $00, $00, $00, $00, $00
[/spoiler]

This is all for Brinstar, but the process is the same for every level. Everything following LB000 is reserved for the sound engine, and Editroid won't touch it, so unused means unused. You can check the disassembly to find unused songs or data.

Grimlock

Thanks for explaining, maybe someday I'll be able to do something with the unused memory, for now though I'll have to make due within the limits of my abilities, which currently are rather limited.

Editing the NEStroid music really gives me a new appreciation for the originals.  What they did with the limitations is truly remarkable.  I've made several songs for the main areas.  They sound OK, but honesty can't compare to the complexity and in many ways genius of the originals.



snarfblam

#40
Well, I'd hate to see you unnecessarily limited. It's really simple to take advantage of the unused memory. Suppose you want to use the $30 bytes at $BE47 for your Brinstar drum track. You would make these changes:


<Track>
[Song:    A]
[Track:   Noise]
[Address: BE47]    // Changed from B12B
[MaxSize: 30]      // Changed from A


This is slightly more advanced, but you can re-purpose memory from relocated tracks. For example, Brinstar's drum track comes directly after the triangle track. If you move the drum track, you can then change the triangle's MaxSize from $69 to $73 to allow it to expand into the newly freed memory.

Grimlock

Thanks, that actually helps pretty substantially.
I was able to successfully duplicate Metallica's "Call of Ktulu" in Kraid:
(varied to work in the M1 sound engine, the first quarter of the song)

Here's a MIDI example if you aren't familiar with the song:
(It's the 25th Midi down, it has a preview button:)

http://www.midiworld.com/files/1076/

I think I've got a pretty strong grasp of this application now.  I might post some music in the future for others to use since you can just copy paste the code from a text source.

Thanks for the effort you put into creating this app!  It took some effort to learn how to use it effectively but it's starting to pay off.  :cool:

Grimlock

#42
In all of the banks there is unused memory between the area song and the sound engine at LB200.  Can this memory be used to expand the area song memory, basically can I expand into this memory?  I just want to make sure Editroid doesn't use this space for anything.  Also the custom ASM work you're doing for Rogue Dawn, I wouldn't want to eat up memory you were planning on using.

The unused memory addresses have bytes listed to the right, I'm assuming it's just listing what inhabits the next "F" addresses,  even though they aren't used in the game they still listed the contents to have a complete representation of the disassembly.  Am I correct?

snarfblam

[spoiler];Unused tile patterns.
LB135: .byte $E0, $E0, $F0, $00, $00, $00, $00, $00, $00, $00, $00, $21, $80, $40, $02, $05
LB145: .byte $26, $52, $63, $00, $00, $00, $06, $07, $67, $73, $73, $FF, $AF, $2F, $07, $0B
LB155: .byte $8D, $A7, $B1, $00, $00, $00, $00, $00, $80, $80, $80, $F8, $B8, $F8, $F8, $F0
LB165: .byte $F0, $F8, $FC, $00, $00, $00, $00, $00, $00, $00, $00, $07, $07, $07, $07, $07
LB175: .byte $03, $03, $01, $00, $00, $00, $00, $00, $00, $00, $80, $FF, $C7, $83, $03, $C7
LB185: .byte $CF, $FE, $EC, $00, $30, $78, $F8, $30, $00, $01, $12, $F5, $EA, $FB, $FD, $F9
LB195: .byte $1E, $0E, $44, $07, $03, $03, $01, $01, $E0, $10, $48, $2B, $3B, $1B, $5A, $D0
LB1A5: .byte $D1, $C3, $C3, $3B, $3B, $9B, $DA, $D0, $D0, $C0, $C0, $2C, $23, $20, $20, $30
LB1B5: .byte $98, $CF, $C7, $00, $00, $00, $00, $00, $00, $00, $30, $1F, $80, $C0, $C0, $60
LB1C5: .byte $70, $FC, $C0, $00, $00, $00, $00, $00, $00, $00, $00, $01, $00, $00, $00, $00
LB1D5: .byte $00, $00, $00, $80, $80, $C0, $78, $4C, $C7, $80, $80, $C4, $A5, $45, $0B, $1B
LB1E5: .byte $03, $03, $00, $3A, $13, $31, $63, $C3, $83, $03, $04, $E6, $E6, $C4, $8E, $1C
LB1F5: .byte $3C, $18, $30, $E8, $E8, $C8, $90, $60, $00, $00, $00

;------------------------------------------[ Sound Engine ]------------------------------------------

;SFXdata. The top four entries are used by the noise music player for drum beats.
LB200: .byte $00 ;Base for drum beat music data.

DrumBeat00SFXData:
LB201: .byte $10, $01, $18 ;Noise channel music data #$01.
DrumBeat01SFXData:
LB204: .byte $00, $01, $38 ;Noise channel music data #$04.
DrumBeat02SFXData:
LB207: .byte $01, $02, $40 ;Noise channel music data #$07.
DrumBeat03SFXData:
LB20A: .byte $00, $09, $58 ;Noise channel music data #$0A.
[/spoiler]

There is unused data up to LB200. Those bytes at LB200 (";Base for drum beat music data.") onward are data for sound effects.

Grimlock

#44
Quote from: snarfblam on September 23, 2014, 05:23:33 PM
There is unused data up to LB200. Those bytes at LB200 (";Base for drum beat music data.") onward are data for sound effects.

Does that mean the memory between the area music and before LB200 is ok to use?  :?:

Since I wasn't sure if it was ok (Before your response) I experimented and found an interesting work around:

Basically I have SQ1 and TRI channels targeting the same memory, with content in SQ1 only.  SQ2 starts 3 bytes before SQ1 and TRI (Targets the same range of data) with a delay of ":03 -" to create a slight echo effect.  So basically you can use the whole range of memory on all three channels simultaneously!

Metallica - Fade to black - Norfair - Work in Progress

EDIT: revised version, changed a few notes, added some, I might revise it further.

To my fellow Metroid hackers:
Posted as an example for the technique I used, not for use in other hacks, I plan to start a thread in the future for music I wish to release for other hacks (and requests possibly) , you're welcome to paste this in the music editor to try it out.

<Context>
[Bank:            2]
[SongTable:       BD31]
[VolumeTable:     BCB0]
[NoteTable:       BE77]
[NoteLengthTable: BEF7]


<Song>
[Song:            2]
[NoteLengthTable: 0B]
[TriangleLength:  F0]
[Sq1VolumeTable:  4]
[Sq2VolumeTable:  4]
[Repeat:          True]


<Track>
[Song:    2]
[Track:   Square1]
[Address: B003]
[MaxSize: F0]
// Remove or update MaxSize tag to embiggen data (be ever so careful).

// Track length: ~ 33 seconds
// Track size: 240 ($F0) bytes

2 { // --------------intro
    :10
        B2 F#3 G3 F#3 B2 F#3 D3 F#3    A2 F#3 G3 F#3 A2 F#3 D3 F#3

        B2 F#3 G3 F#3 B2 F#3 D3 F#3    C#3 E3 A3 E3 C#3 E3 A3 E3
   
} //   --------------
    //:03 -
2 { // --------------transition TO CHORUS
    :10
        F2 C3 D3 F2 G#2 B3 E4 B3    B3 E4 G#4 B2 E3 G#3 B4 D5
   
} //   --------------
    :03 -
2 { // --------------chorus
    :10
        B3 C4 A3 E3 E4 E3
    :08
        G3 A3 C4
    :10   
        G3 - C4 E3 E4 E3
    :08
         G3 A3 B4
     :10   
         G3 - D4 D3 G4 D3 A3 G3   G3 - E3 B2
    :08
         B3 -  - C4
    :10
         D4 -
   
} //   --------------
1 { // -------------- outro TRANSITION
    :10
        B3 C4 A3 E3 E4 E3
    :08
        G3 A3 C4
    :10   
        G3 - C4 E3 E4 E3
    :08
         G3 A3 B4


     :10   
         G3 -  D4 D3 G4 D3 D4 A4
     :10
         E3 - G4 - B4 - E5 -   
         
} //   --------------
   //:03 -
   
00 // Song terminator


<Track>
[Song:    2]
[Track:   Square2]
[Address: B000]
[MaxSize: 8C]
// Remove or update MaxSize tag to embiggen data (be ever so careful).

// Track length: ~ 33 seconds
// Track size: 49 ($31) bytes
    :03 - 



<Track>
[Song:    2]
[Track:   Triangle]
[Address: BE4F]
[MaxSize: 28]
// Remove or update MaxSize tag to embiggen data (be ever so careful).

// Track length: ~ 33 seconds
// Track size: 40 ($28) bytes

//50 { // --------------
//     :60 -
//} //   --------------
8 { // --------------intro REPEAT 1
    :10
        - //B3     
} //   --------------
8 { // --------------
    :10
        - //A3
} //   --------------
8 { // --------------
    :10
        - //B3
} //   -------------- 
8 { // --------------         
    :10
        - //C#4
} //   -------------- END REPEAT 1
8 { // --------------intro REPEAT 2
    :10
        B3     
} //   --------------
8 { // --------------
    :10
        A3
} //   --------------
8 { // --------------
    :10
        B3
} //   -------------- 
8 { // --------------         
    :10
        C#4
} //   -------------- END REPEAT 2
 
50 { // --------------
     :60 -
} //   --------------

 

<Track>
[Song:    2]
[Track:   Noise]
[Address: BE47]
[MaxSize: 8]
// Remove or update MaxSize tag to embiggen data (be ever so careful).

// Track length: ~ 156 seconds
// Track size: 48 ($30) bytes

50 { // --------------
     :60 $01
} //   --------------







snarfblam

#45
[spoiler=Far too wordy of an answer]
Quote from: Grimlock on September 23, 2014, 06:18:32 PM
Does that mean the memory between the area music and before LB200 is ok to use?  :?:

Yup. You'll have to check for each level independently, since each level's data is organized slightly differently. In the case of Norfair, this is what appears before B200:


;Unused.
B099: .byte $B9, $30, $3A, $3E, $B6, $42, $B9, $42, $3E, $42, $B3, $44, $B2, $3A, $B9, $3A
B0A9: .byte $44, $48, $B4, $4C, $B3, $48, $46, $B6, $48, $B9, $4E, $4C, $48, $B3, $4C, $B2
B0B9: .byte $44, $B9, $44, $4C, $52, $B4, $54, $54, $C4, $B4, $02, $FF, $C3, $B2, $26, $B9
B0C9: .byte $26, $3E, $34, $B2, $26, $B9, $26, $34, $26, $B2, $2C, $B9, $2C, $3A, $2C, $B2
B0D9: .byte $2C, $B9, $2C, $3A, $2C, $FF, $C4, $B2, $26, $B9, $34, $26, $26, $FF, $D0, $B9
B0E9: .byte $18, $26, $18, $B2, $18, $FF, $C2, $B2, $1E, $B9, $1E, $18, $1E, $B2, $1E, $B9
B0F9: .byte $1E, $18, $1E, $B2, $1C, $B9, $1C, $14, $1C, $B2, $1C, $B9, $1C, $14, $1C, $FF
B109: .byte $B2, $26, $12, $16, $18, $1C, $20, $24, $26, $B2, $28, $B9, $28, $1E, $18, $B2
B119: .byte $10, $B9, $30, $2C, $28, $B2, $1E, $1C, $18, $14, $2A, $2A, $2A, $2A, $CC, $B9
B129: .byte $2A, $FF, $E8, $B2, $04, $04, $04, $B9, $04, $04, $04, $FF, $E0, $E0, $F0, $00
B139: .byte $00, $00, $00, $00, $00, $00, $00, $21, $80, $40, $02, $05, $26, $52, $63, $00
B149: .byte $00, $00, $06, $07, $67, $73, $73, $FF, $AF, $2F, $07, $0B, $8D, $A7, $B1, $00
B159: .byte $00, $00, $00, $00, $80, $80, $80, $F8, $B8, $F8, $F8, $F0, $F0, $F8, $FC, $00
B169: .byte $00, $00, $00, $00, $00, $00, $00, $07, $07, $07, $07, $07, $03, $03, $01, $00
B179: .byte $00, $00, $00, $00, $00, $00, $80, $FF, $C7, $83, $03, $C7, $CF, $FE, $EC, $00
B189: .byte $30, $78, $F8, $30, $00, $01, $12, $F5, $EA, $FB, $FD, $F9, $1E, $0E, $44, $07
B199: .byte $03, $03, $01, $01, $E0, $10, $48, $2B, $3B, $1B, $5A, $D0, $D1, $C3, $C3, $3B
B1A9: .byte $3B, $9B, $DA, $D0, $D0, $C0, $C0, $2C, $23, $20, $20, $30, $98, $CF, $C7, $00
B1B9: .byte $00, $00, $00, $00, $00, $00, $30, $1F, $80, $C0, $C0, $60, $70, $FC, $C0, $00
B1C9: .byte $00, $00, $00, $00, $00, $00, $00, $01, $00, $00, $00, $00, $00, $00, $00, $80
B1D9: .byte $80, $C0, $78, $4C, $C7, $80, $80, $C4, $A5, $45, $0B, $1B, $03, $03, $00, $3A
B1E9: .byte $13, $31, $63, $C3, $83, $03, $04, $E6, $E6, $C4, $8E, $1C, $3C, $18, $30, $E8
B1F9: .byte $E8, $C8, $90, $60, $00, $00, $00


;SFXdata. The top four entries are used by the noise music player for drum beats.
LB200: .byte $00 ;Base for drum beat music data.
...


So here, $B099-$B1FF is free, $B200 onward is used. This gives you a total of $167 free bytes ($B200 - $B099 = $167). You can divide that between multiple tracks if necessary. So, for example, if you decided to use $A0 bytes for one track at $B099, the second track would start at $B139 ($B099 + $A0 = $B139) and have a maximum size of $C6 ($167 - $A0 = $C7).

I think you should have plenty of room to work with. If you have trouble finding enough space, though, let me know and I can dig around and find you some more room.[/spoiler]

I just went back and re-read your post. If my answer was a bit strange, that's because I seem to be a bit stupid today and misunderstood exactly what you were asking. The simple answer is yes, you can absolutely use that memory. Editroid doesn't do anything with anything that appears after $B000.

mrrichard999

Anyway to integrate a clickable keyboard into Metroid Tuner to create a new track for each of the sections of music with a counter to show how much remains for space of the song? :)

Grimlock

#47
Now that I've been using this app enough to get a good sense of its strengths and weaknesses I would say adding a keyboard wouldn't be as useful as it may sound.  I think the most useful feature that could be added is a way to create "music projects".  Basically it would save your current song build for future reloading and editing.  As is you have to copy your current song build into a text document outside of the program if you plan on further editing it otherwise if you try to open the song with the app it resets your memory usage and cuts off any free memory you had.  I'd say the easiest add besides projects would be a button that says "Are you sure you want to Exit?".  Countless times I've meant to close my emulator or Editroid and closed metroid tuner before copying my changes.  A minor annoyance, you can always retrieve your changes so it's not an app breaker.  One last feature would be the ability to turn off channels / toggle on/off.

Honestly though my opinion is that it's fine as is.  It's simple and affective.  It's not really a good place for composing original work but it is great for bringing in note arrangements put together externally and tinkering them into something that works in M1.

I plan on creating a tutorial in the near future on how to use guitar and piano tablature as sources for Metroid Tuner.  An easy way to manually compile the notes before inserting and setting up your timing in Tuner.

snarfblam

Quote from: Grimlock on September 24, 2014, 01:14:14 AM
I think the most useful feature that could be added is a way to create "music projects".

That's not a bad plan, really. Maybe I should integrate this tool into Editroid, and make it part of the project system.

Grimlock

Snarfblam, have you had any success modifying the item room music?  SQ1 and SQ2 don't seem to work the same as they do in other areas.  The Triangle track seems off also.