Wednesday, August 29, 2012

Progress on Parallel Worlds

Well, in case you haven't seen it (or haven't seen it recently), head over to http://parallelworldsmaps.appspot.com to check out the new visual overhaul I've finally given to my mapping project for the game Legend of Zelda: Parallel Worlds.  For those of you who don't know, Parallel Worlds is a ROM hack of Legend of Zelda: A Link to the Past, resulting in a completely new game, with all an all-new story, fully redone dungeons and maps, and some minor graphical changes to go with all that.  The game is HARD.  Like, Contra hard.  And what's worse is, because the map and dungeons are all new, there aren't any maps to show you where everything is when you inevitably get lost.  I have found a single walkthrough floating around on the internet that has maps, but other than that, you're s.o.l.  So, I took it upon myself to map the entire game, in full, lossless resolution.  After completing the Light World Overworld map (well, I still have some touch-up work to do...), I discovered an awesome piece of software called Worldkit which would allow me to turn my shiny new really-big-picture into a fully interactive map with zoom and pan, as well as geotag annotations for tagging items and important landmarks.  So I got it all loaded up and decided to host it on Google's App Engine framework (which is kind of a weird use of the App Engine framework, but there are plenty of other people hosting static websites on GAE, so whatever...).  As of yet, I can't seem to get annotations working on the web (they work great on the local dev server that comes with the GAE SDK... frustrating), but I have finally gotten around to giving the page itself a facelift from the previous blank-page-with-embedded-flash-object-slapped-into-the-corner.  It is now a presentable web page, with a nice template that will allow me to easily deploy new pages as I finish the maps.  Also, speaking of finishing maps, I managed to map all of Din's Catacombs, which is a pretty nice achievement (if I do say so myself) in that the entire dungeon is normally pitch-black, making mapping via screenshot extremely tedious at best and nearly impossible at worst.  The walkthrough I mentioned earlier with screenshots of all of the dungeons actually doesn't have one for Din's Catacombs.  So I may be the first to have mapped it.  Go me :)  Anyway, the Din's Catacombs page is a bit of a mess right now, I was trying out a different template which really isn't working so well, but I'll fix it up soon.  I've also started work on the Icy World Overworld map, which I currently have about 20% complete, so hopefully that will be online soon as well.

Friday, August 17, 2012

New Zelda: Parallel Worlds Interactive Map

I have discovered a means to make my Zelda Parallel Worlds mapping project much more interesting and useful by creating a fully interactive map with navigation and annotation features using an awesome piece of software called WorldKit.  I am hosting the project using Google's App Engine framework, and have uploaded my current Light World overworld map to test the software and deployment functionality.  I have not yet added any annotations (and I probably won't until I have the Icy World map done), but you can test the zoom and pan features.  Unfortunately, the zoomify software I'm using to generate the zoom tiles only works with JPEG images, so it does get lossy at full zoom, but I suppose that's really the best route to go anyway, then I can offer the full-resolution, lossless PNG for download from a separate link.  I'm still brushing up on my HTML so I can actually have a nice page rather than the current blank page with the embedded map viewer.  It's a work in progress, but check it out at http://parallelworldsmaps.appspot.com/

Tuesday, July 24, 2012

The Legend of Zelda: Parallel Worlds Mapping Project

I've decided to undertake the mapping of the Zelda 3 ROM hack called Parallel Worlds.  Being a hack, not a lot of documentation exists out there other than a few walkthroughs, almost all of which are exclusively text-based, and many of which are incomplete.  I've decided to create a full-resolution map of all areas of the game, starting with the overworld(s) and then moving on to the dungeons.  So far, I have a significant portion of the Light World Overworld completed, and so I've decided to start a page to publish my progress.  You can check it out here.  You can check out the hack's homepage at https://sites.google.com/site/zeldaparallelworlds/

Friday, July 13, 2012

Arduino HID Gamepad, part 1

Note: This post mostly outlines my shield design and a quick test of the hardware using the Mouse example included with the Arduino library.  If you're looking for the actual HID gamepad implementation, have a look at part 2

I have been thinking for quite some time about a project which I hope to shape into a Senior Project for my Embedded Systems and Software Engineering degrees, but I've gotten a bit impatient and have kind of jumped the gun to start working on it.  The first step in this project requires implementing a generic HID gamepad.  The Arduino Leonardo recently launched with USB HID profile support, thanks to the on-chip USB support of the on-board Atmega32U4 microcontroller.  This makes prototyping much simpler, and it actually reduces the cost of the Leonardo compared to the Uno--which is otherwise the most comparable Arduino model out there--due to not needing a separate microcontroller to handle the USB-serial connection.  Now, I know there are a lot of Arduino haters out there, but the fact is, it is fantastic for prototyping.  I get as annoyed as anybody when I see somebody enclose an entire Arduino into a finished product rather than redesigning for the bare microcontroller (which I fully intend to do), but it's a nice prototyping platform with great community support.

Anyway, I got my Leonardo today and immediately loaded up the button mouse example sketch to try it out and lo and behold, it just worked.  Well, it would have just worked if I had built the circuit the way I was supposed to.  As it was, I didn't feel like breadboarding it with pull-down resistors, so I changed the code around to enable the internal pull-up resistors and then changed the logic to be low-triggered rather than high-triggered:


const int upButton = 2;     
const int downButton = 3;        
const int leftButton = 4;
const int rightButton = 5;
const int mouseButton = 6;

int range = 5;     // output range of X or Y movement; affects movement speed
int responseDelay = 10;     // response delay of the mouse, in ms

void setup() {
  // initialize the buttons' inputs:
  pinMode(upButton, INPUT);       
  pinMode(downButton, INPUT);       
  pinMode(leftButton, INPUT);       
  pinMode(rightButton, INPUT);       
  pinMode(mouseButton, INPUT);
  
  digitalWrite(upButton, HIGH);
  digitalWrite(downButton, HIGH);
  digitalWrite(leftButton, HIGH);
  digitalWrite(rightButton, HIGH);
  digitalWrite(mouseButton, HIGH);
  
  // initialize mouse control:
  Mouse.begin();
}

void loop() {
  // read the buttons:
  int upState = digitalRead(upButton);
  int downState = digitalRead(downButton);
  int rightState = digitalRead(rightButton);
  int leftState = digitalRead(leftButton);
  int clickState = digitalRead(mouseButton);

  // calculate the movement distance based on the button states:
  int  xDistance = (leftState - rightState)*range;
  int  yDistance = (upState - downState)*range;

  // if X or Y is zero, move:
  if ((xDistance == 0) || (yDistance == 0)) {
    Mouse.move(xDistance, yDistance, 0);
  }

  // if the mouse button is pressed:
  if (clickState == LOW) {
    // if the mouse is not pressed, press it:
    if (!Mouse.isPressed(MOUSE_LEFT)) {
      Mouse.press(MOUSE_LEFT); 
    }
  } 
  // else the mouse button is not pressed:
  else {
    // if the mouse is pressed, release it:
    if (Mouse.isPressed(MOUSE_LEFT)) {
      Mouse.release(MOUSE_LEFT); 
    }
  }

  // a delay so the mouse doesn't move too fast:
  delay(responseDelay);
}


Anyway, the next thing to do was to build myself a gamepad that I could plug in to the Leonardo for testing.  I plan to use the SNES controller in my final project, but for prototyping, I decided to go with NES instead.  The NES uses the exact same control protocol as the SNES, just with fewer buttons, so that meant fewer parts, as well as fewer IO pins for my debug setup.  I had a few empty protoshields lying around, so I figured that would be perfect for this build.  I also had a CD4021 shift register in my parts drawer from an NES controller I cannibalized awhile back.  If you're looking to build a DIY NES controller, please, for heaven's sake, just go out and buy a 4021 and a few resistors and do it from scratch.  Don't destroy an NES controller just for its IC.  I've seen so many awesome mods that just piss me off because after all that hard work, they have this wiring on the inside.  Seriously, this is all you need (plus a couple of resistors).  Or, if you want to get really fancy, hit me up for one of these (scroll down to my last post for a picture with a size comparison to an SD card.  Anyway, despite that rant, I used the IC from an original controller, because I had already used the rest of the controller for various other stuff, and happened to have the IC left over.  I have a stash of the SMD 4021's, but alas, the protoshield's SOIC footprint is only 14 pins, so I needed the DIP version, and this one was the only one I had.

Ok, now that I'm done with that rant, time for pictures :)

I ran out of solder, so nothing is connected yet.  However, all of the parts are mounted, so I just need to get more solder (and perhaps some finer gauge wire than what I have on hand at the moment would be good too).  Apparently, RadioShack no longer carries through-hole mounted tact switches, but thankfully, the spacing on the SMD feet lined up well enough with the board holes.  The plan is to hook each button up directly to a digital I/O, as well as hooking them up to the 4021 and connecting its latch, clock, and data lines to the remaining digital IO's in order to implement the NES protocol as well.  This way, I can read the buttons either directly or via the NES protocol all from the same shield configuration.


Also, in case you're looking for the correct stacking headers for the Arduino shields, I've managed to track down a manufacturer that makes them.  Unfortunately, the stackable header kits on SparkFun and elsewhere don't actually have the right pin counts.  They sell kits with 2x6-pin headers and 2x8-pin headers.  Arduino shields actually use 1x6, 2x8, and 1x10.  You don't, strictly speaking, need the other four pins, but all of the official shields have them.  Digikey carries these headers, but they don't seem to carry them with tails quite as long as the ones on official shields.  There's not a lot of clearance with the ones I have.  So anyway, here are part numbers for the headers that you'll want, they aren't quite the same as the ones Digikey has (DK carries the -03 variety rather than the -04, which I explain below).


Samtec
1x10 pins: SSQ-110-04-T-S
1x8 pins: SSQ-108-04-T-S
1x6 pins: SSQ-106-04-T-S


Some variations on these part numbers:
-04 is the length of the tail.  -03 or shorter will make for very little clearance above the barrel jack.  On the older boards with full-sized USB-B plugs, you won't be able to clear the USB jack.  However, Digikey doesn't seem to carry anything longer than -03.  If you can find another distributor that stocks the longer tails, let me know in the comments


-T is tin plated pins, replace it with -G for gold plated.
The -110, -108, and -106 are the pin count.  If you want dual row, the numbering is -2XX (i.e. -205 would be 2x5 pins, etc.).

Anyway, that's it for now.  I'm super busy working two jobs this summer, so hopefully I'll get some free time now and then to work on some of this stuff.  Once I get USB HID down, I plan to move on to bluetooth HID (which is just a simple wrapper around the USB HID protocol, so it should be simple enough).  Then I'll be working on building the host module.  Fun times.

Friday, June 22, 2012

Today is a good day.  On Monday, I randomly made an image and posted it on Twitter, @wilw (Wil Wheaton).  He called it "awesome" and reposted it to the world.  "Awesome" is exactly how I feel right now.

Monday, December 26, 2011

Migrating your Droid X to CyanogenMod

I recently migrated from a stock Gingerbread Moto Blur install of Android on my VZW Droid X to CyanogenMod7 (specifically RevNumbers's CM4DX-GB kang, if you happen to care) and found it to be a rather arduous task to carry all of my data and settings to the new ROM.  I was talking to my cousin over Christmas break and she was curious to learn how to go about doing it as she had never installed a custom ROM before and needed step-by-step instructions (as she didn't feel like bricking like I did a good dozen times or so while I was figuring all of this out).  So I figured I would try to compile a step-by-step guide of how to go from stock to CM7 with *almost* everything still intact.

I will start by outlining the process and then going back and filling in the details as I get the chance, so this may be a bit sparse in some steps until I get more time.  I'll probably do a ToC section link block too eventually, but it's late and I'm just throwing this all down before I go to bed.  Also, there are steps in here specific to the Droid X because that's what I have, but some of this information may be useful to other phones as well.

Update your device
NOTE: If you are currently on Froyo and have already rooted your phone, you need to back up your apps and data first, then sbf to a fresh install of Froyo, then continue.  Updating to stock GB from rooted Froyo messes up your ability to root on GB.  If you have never rooted before, these aren't the warnings you're looking for, move along.

To begin with, you want to make sure you are running the most up-to-date version of Android available from Verizon.  The reason for using an official update is that there are some things that cannot be updated (or are more difficult to update) from unofficial sources.  These include the kernel and the baseband (the firmware for your phone's radio), and perhaps other things I don't know about.  You can check what version you are currently running by pressing the Menu key and selecting Settings>About Phone.

As of this posting, the current Android System version available from Verizon for the Droid X is 2.3.3, and the current Baseband version is BP_C_01.09.13P.  If you have these versions, you're set.  Otherwise, hit Check For Updates.  Go ahead and let the update finish and your phone should reboot.

Root your device
Once you're running stock Gingerbread, you can go ahead and root your phone.  Read up on how to do that here (it says it's for the Droid 3, but it works just fine for the Droid X).  NOTE:  DO NOT TRY THIS IF YOU PREVIOUSLY HAD ROOT ON FROYO WHEN YOU UPDATED TO GB.  If this is the case, you will have to sbf before rooting, meaning you won't be able to do a full backup.  Backup what you can, sbf, and then root.

Install useful tools
The 3 most useful applications I have found for dealing with data backup, ROM customization, and other stuff here are ROM Manager, ROM Toolbox, and Titanium Backup.  All 3 of these have free versions and are available in the Android Market.  I suggest purchasing the Pro versions of each, they have additional features and plus you'll be supporting the developers that make this stuff possible.  If you don't want to purchase them all, I would say ROM Toolbox and Titanium Backup are the most worth it.  Regardless, install whichever version you wish but get all 3 apps.

Install ClockworkMod Recovery
Open ROM Manager and click Flash ClockworkMod Recovery. If you're on the Droid X, when it asks you to confirm phone model, you have the choice between Droid X and Droid X (2nd init).  Select the one that says 2nd init.  The other option is currently useless because 2nd-init is required since the bootloader is locked and it won't work without 2nd-init.  If it prompts you for superuser access, say yes and check the box to remember (basically just do this any time you get this prompt as long as you trust the app; the 3 apps I am using in this guide are all trustworthy).

Understanding each type of backup
There are two main backups going on here, a NANDroid backup and a Titanium Backup, then there is the SMS backup.  There is a reason you are doing both of these.  The NANDroid backup is a system image that allows you to restore your entire phone back to the state it was in at the moment you create the backup.  The Titanium backup backs up all of your applications and associated data in a format that you can then reinstall once you have flashed your new ROM.  This allows you to reinstall all of your apps without having to download them all, and also retains all of your data like game saves and such.  Backing up your SMS allows you to keep all of your text messages (but so far there doesn't seem to be a way to back up your MMS, so you'll need to have saved any photos to your SD card manually).  The SMS database in the stock ROM is incompatible with the one that CyanogenMod uses, so you'll have to use a 3rd party backup solution that stores the messages in a separate format.

Create a Nandroid (system image) backup
Note:  The size of a Nandroid backup will vary, but I would suggest having at least 1.5-2GB free on your SD card before attempting this
Once you have flashed ClockworkMod Recovery, click Reboot into Recovery.  Your phone should reboot and you will be in a text based menu.  You navigate the menu with the volume up/down buttons, the camera button to select, and the hardware "back" button to return to the previous menu.  The power button just turns the screen on and off so if you accidentally hit it and the screen goes off, just hit it again and it will come back.  Select backup and restore->backup and then just wait for it to complete.  Once it's done, back out to the main menu and select reboot phone now.

Backup your applications and data
Note:  The size of the backup will vary greatly depending on how many apps you have installed and what you choose to back up.  Again, I suggest having at least 1GB free on your SD card before attempting the backup.
Open Titanium Backup and press the hardware Menu button and select Batch.  At the very least, select Backup all user apps, but you can backup system data if you want too.  You won't be able to restore the system data into an incompatible ROM, but if it gives you peace of mind to have it backed up, go for it.

Backup your text messages
There are many ways to backup SMS messages, but if you use a 3rd party SMS client, it may very likely have the option to back up your messages.  I use GoSMS Pro, and the option is found by pressing the hardware Menu button and going to the Services tab and selecting SMS B&R.

Install CyanogenMod (CM4DX-GB)
Because the Droid X has still not received a stable release of CyanogenMod, you're stuck installing a nightly release.  Also, the mainline CM7 does not support the Gingerbread kernel, so you'll want to install the RevNumbers releases, which do support the GB kernel.  The kernel does not get updated when you install a ROM, so you need to already have the correct kernel installed before you flash the ROM or you will brick your phone.  Open ROM Toolbox (since the RevNumbers Nightlies in ROM Manager are not kept up-to-date) and select ROM Manager (the button inside of ROM Toolbox, not the app named ROM Manager).  Under the ROM list select RevNumbers CM7 Nightlies (you can pick any ROM you want, but I highly suggest CM7, at least for your first ROM).  Pick the newest version and select download.  Wait for the download to finish.  Also download the latest version of Google Apps, or you won't have an Android Market.

Update: For more up-to-date releases of CM4DX-GB, follow this thread, as ROM Toolbox hasn't updated their list in quite awhile.

I'm going to outline how to install the ROM manually, since ROM Toolbox hasn't been working right with automating ClockworkMod Recovery tasks, although they may have fixed that, I don't know...

In the main menu of ROM Toolbox, select Rebooter, then Reboot Recovery, and you should be back to the text menu of ClockworkMod Recovery.  Select Factory Reset/wipe data, then select install update zip.  Choose select zip from sd card and browse to romtoolbox/downloads/RevNumbers and select the zip in that folder (or browse to the location where you downloaded it, if you got an updated release from the forum thread above).  Repeat with romtoolbox/downloads/gapps.  Now reboot your phone and (if all goes well), it should boot into CyanogenMod.  The first boot WILL take a long time, but if it just plain doesn't boot, check out the troubleshooting guide below.

Restore your applications
Install Titanium Backup.  Batch>Restore User Apps (NOT system data)

Restore your text messages
Use the same app you used to back them up in the first place

TROUBLESHOOTING

Unbricking
It's late, I'm getting tired, for now, Google "[your phone model] Gingerbread sbf" to get the files and  probably a guide.  You'll also need an app called RSD Lite, the latest version (AFAIK) is 4.9.  There is a bug in the software resulting in an error, something like invalid file or filename or something I don't remember, but that error is bogus and there is a workaround I'll get around to posting later... bah... should be enough info to get started, so for now goodnight.

Friday, June 3, 2011

Build and install custom Rock Band DLC on an unmodded XBox 360

UPDATE: RB3Maker can do a lot of this automatically, including album art conversion.  I still prefer doing it manually so that I can pack it for RB2 instead, but it's a really nice tool, and if he ever adds support for outputting RB2 .con's then I may convert to that method entirely.  If you want to continue to use this guide, I believe RB3Maker can be used in place of MahoppianGoon's DLC Tools to extract the .rba, and you can also use it to convert the album art for you.

I have been a long-time user of RawkSD for custom Rock Band DLC (user-made songs) on the Wii, but just recently heard that it was possible to install custom DLC on an un-modded XBox 360.  I got really excited about this, since the Wii version of Rock Band 3 is so full of software bugs that it never should have been released in its current state, and because of the way the Wii is, it will most likely (99% certainty) never receive an update to fix these bugs.  With XBox 360 customs possible on an unmodded console, I can enjoy customs, a better engine, and the improvements made in the newest installment of the game, all without wanting to tear my hair out on a regular basis.  Also, since the XBox 360 already supports the internal HD for saving DLC, I also get that particular upgrade over the Wii without any need for additional hacks (which tend to increase the frequency of Rock Band entirely freezing on my Wii).

Anyway, enough random backstory and on to the actual build-and-install.  MahoppianGoon has a great tutorial already, but many of the steps require manually creating files that you could just use Harmonix's official tools to create for you, so this guide will show you step-by-step how to set up and use Magma, Harmonix's official Rock Band Network tool, to create the files necessary for custom DLC and then how to repack and install them.

Note:  This is for Rock Band 2 DLC, not Rock Band 3.  Really the only reason you would need to create RB3 DLC is if you want to chart keyboard or PRO Guitar, as you can play Rock Band 2 DLC in Rock Band 3 as-is.  Also, since this is RB2 DLC, you will need Magma v1, which is no longer available on the RBN download site, so I have mirrored it.

First of all, here are the programs you will need:
Magma v1.20
Audacity 1.3.13 beta
MahoppianGoon's DLC Tools
Le Fluffie
Modio
GH2ImageCon

Now to start building your custom DLC.

Skip to:
Chart/MIDI
Audio
     -Recording a dryvox track (for lipsync animations)
Magma
Extracting the RBA
DTA Editing
Album Art
Building the DLC file
Installing


Chart/MIDI
For the purpose of this tutorial, I am going to assume you already have your .mid file created.  If not, check out the Rock Band section of ScoreHero for tips on charting, or download one from someone else.

Some things to note:
Magma v1.20 introduced the requirement that all difficulties of guitar use all 5 gems.  If your chart does not do this, it won't pass the midi check stage of the compiler.  You can try v1.10 if this is your chart's only issue.

If you absolutely don't want to get your chart up to Magma's specs (which is usually a crash waiting to happen), you can use this .mid in Magma to get your song to compile.  Just be sure to use your real .mid in the final .con file.  Also, if you use that .mid and your song has a vocals track, use this file for your dryvox audio.

If you want lipsync animations, in addition to creating the dryvox audio (described in the audio section), you WILL have to fix your chart to pass Magma's checks, and you will need to have charted vocals.  Otherwise, Magma won't be able to generate lipsync animations.


Audio
UPDATE: I have come up with a method for creating .mogg files longer than Magma's normal 12 minute limit.  Magma still won't allow a MIDI file longer than that, but you can get around that by feeding Magma a dummy MIDI file then swapping it out in the final .con.  However, you lose Magma's validity parsing ability if you don't feed the real .mid to it, so proceed with caution.  The tool is here.

If you somehow happen to possess actual master tracks for the song you're working with, you simply need to mix down each instrument's track into a stereo, 44.1kHz WAV file.  If you're not so lucky and are just using a stereo audio file for your song, you will need to do the same, but most likely it will require a few extra steps.

First, open your audio file in Audacity.

Next, you need to determine whether or not the song requires an audio delay (this will most likely have been indicated on the page where you got the chart).

If your audio needs a delay, make sure the cursor is at the beginning of the song (by pressing the <|<| button while the song is stopped) and select Generate>Silence.  Type in the length of silence (you may have to change the time breakdown in the drop-down menu to allow you to enter milliseconds) and press Ok.

Select File>Export and select WAV under Save As type.

Next, if you don't have master tracks, you're going to need blank audio tracks.  First, delete the current audio tracks by clicking the X in the upper left corner of the track.  Then select Tracks>Add New>Stereo Track.  Then select Generate>Silence and enter 60 seconds.  Export this track as WAV.


Finally, the dryvox track.  If you don't care about lipsync animations, or your chart doesn't have a vocals track, you can skip this part.  If you want lipsync animations, you need to record yourself singing along to the song.  If you can't sing very well, I suggest you get a friend who can to do it for you, or just skip this part.  Also, you MUST HAVE A VOCALS CHART or else you can't generate lipsync animations, so just skip this.

First of all, open the first WAV you exported from Audacity back into Audacity (remove any other tracks that might be there).

Open the Device Toolbar (View>Toolbars>Device Toolbar) and next to the microphone icon, select the input you are going to use (Note: the Logitech universal USB microphone works as a plug-and-play microphone on Windows).

Hit the record button and make some noise into your microphone to test that it's working.  Hit stop to stop recording, then delete the recording you just made.

Make sure that you can actually hear the song playing while you are recording.  If not, select Edit>Preferences>Recording and check the box that says "Overdub: Play other tracks while recording new one"

Now, hit record and sing along to the song and hit stop when the song is done.

Tips:
-Enunciate well.  You actually have to sing the words.  If you just hum along, the animations are going to do the same thing and that defeats the purpos.

-Sing the right notes.  If you don't sing the right notes, the weights compiler will factor that into the scoring for the song

-Use headphones.  That way you won't get the audio from the song itself bleeding into your recording.

Once you have your track recorded, remove the song track from Audacity, leaving only your recording.  Next, select the drop-down box in the lower-left corner of the window labeled "Project Rate (Hz)" and select 16000.

Export as WAV.


Magma
Now, we're going to set up Magma.  Open Magma and under the Information tab fill in all of the fields for Artist, Title, Album, etc.  Don't worry about album art, you won't be able to use it anyway.  Under the Build To field, put it wherever you want, but name it after the song ID that you are going to use for this custom.  A simple song ID is the song title in all lowercase with no spaces or punctuation.  If it's a really long title, you can shorten it for the ID.  The main thing is that every song needs a unique ID, so just make sure it's unique (i.e. "My Cool Song" could have the song ID "mycoolsong").  Remember this ID for later.

Next, under the Audio tab, if you have master tracks, put them in here.  If not, put your song track in as the backing, and the silence track in for every instrument that has a chart.  If you have vocals, you'll need to have the dryvox track made.

Under the Game Data tab, put your .mid in and set the difficulty for each instrument.

Now, save your .rbproj and try to build.  If you get errors with your chart, fix them.  If you get other errors that you don't understand, try the Rock Band section of the ScoreHero forums.  Rinse, lather, and repeat until you successfully generate an .rba file.


Extracting the RBA
Open MahoppianGoon's Rock Band DLC Tools to the RBA Extractor tab.  Open your .rba file and click "Extract All", then close Rock Band DLC Tools.

Rename the extracted files according to the song ID your chose.  The files should be named like this (assuming my song ID is "mycoolsong")

mycoolsong.mid
mycoolsong.milo_xbox
mycoolsong.mogg (it will originally be .ogg, you need to rename the extension as well)
mycoolsong_weights.bin
songs.dta

Now you will need to create an empty .pan file.  Right-click in Windows Explorer and select New>Text File (not any other file type) and rename the file mycoolsong.pan.  Right-click on it and select Properties and the size should be 0 bytes.


Editing the DTA
The songs.dta generated by Magma needs a few changes to make it work for DLC.  Open it in your favorite text editor, it's just a text file.  First of all, at the very top of the file you should see:

(
   'song'

Here, you need to replace 'song' with your song ID:

(
   'mycoolsong'

A bit further down you will find

(
   'song'
   (
      'name'
      "songs/song/song"

Here, you will leave 'song' but change the line after 'name' to reflect your song ID:

(
   'song'
   (
      'name'
      "songs/mycoolsong/mycoolsong"

Scroll down again and find:

(
   'midi_file'
   "songs/song/song.mid"

Again, replace the word song with your song ID:


(
   'midi_file'
   "songs/mycoolsong/mycoolsong.mid"

Now, if you want to fine-tune the difficulty ratings for your song, find the following lines (the numbers will be different):

(
   'rank'
   ('drum' 123)
   ('guitar' 123)
   ('bass' 123)
   ('vocals' 123)
   ('band' 123)
)

Change these to set the exact difficulty you want.  Check out this page for comparison with existing songs.

Finally, find the following line

('ugc' 1)

and delete the line entirely.  Now save and close the file.


Album Art
Update: Technicolor over at ScoreHero has implemented this info into an all-in-one tool that converts an RBA to a CON.  It's only for RB3, but if you just want the album art, it leaves all intermediate files, so you can just grab the artwork from there.  Get RB3Maker here

Album art is possible using Nachyoz's GH2 Image Converter, but the colors are all messed up. I HAVE figured how to fix the colors, but for now it requires manually hex-editing the image so for now I'm going to wait to post here until I can type up a decent explanation or code my own converter. Sorry...

If you are willing to try it, the basic steps (with no explanation yet, you'll have to figure it out yourself) are:

-Save the image as a 256-color, indexed bitmap (also known as 8-bit bitmap)
-Use Nachyoz's GH2ImageCon to convert to .bmp_ps2
-Manually hex-edit the color index in the .bmp_ps2. You need to make 2 changes.
   *.bmp_ps2 images store the color index as RGBA, .png_xbox expects ARGB. Just shuffle the values around.
   *change the alpha channel values to 0xFF (the default value is 0x80)
-Save the file as [songid]_keep.png_xbox (i.e. mycoolsong_keep.png_xbox) and place it in the gen folder

Here is a working example


Building the XBox DLC file
Open Le Fluffie and select File>Package Creation and choose STFS from the drop-down menu and click OK.  Enter the following information:

Package Type (the drop-down menu that says "None" by default): SavedGame
Title ID: 45410869
Description (Be sure to select the radio button for "Description" instead of "Display Title"): "My Cool Song" (Replace this with whatever the song title actually is, include the quotes).
Internal Title: Rock Band 2

Now, right-click on each of the two small white squares to the right of the info pane and click Add Image.  This is where you select the image you'll see in the XBox System Settings menu.  You can use any 64x64 .png image (official DLC uses a scaled down copy of the song's album art), but here's the official RB package icons if you prefer:

RB1 Icon:






RB2 Icon:






RB3 Icon:






A couple of RawkSD icons I made:








Next, in the upper-left pane, right-click on the word "root" and select Add Folder.  Name this folder "songs" (no quotes).  Now click the '+' next to root and right-click on "songs" and Add Folder.  Name the folder your song ID with no quotes.  Click the '+' next to your song ID, and add a folder named "gen" (again, no quotes).  Click the '+', then select "gen".

Right-click in the right-hand pane under where it says "file" and select Add Files.  Select the .milo_xbox and the _weights.bin files.  Next select the song ID folder and add the .mid, .mogg, and .pan.  Select the songs folder and add the .dta.  Your files should be in this hierarchy:

\songs\songs.dta
\songs\mycoolsong\mycoolsong.mid
\songs\mycoolsong\mycoolsong.mogg
\songs\mycoolsong\mycoolsong.pan
\songs\mycoolsong\gen\mycoolsong.milo_xbox
\songs\mycoolsong\gen\mycoolsong_weights.bin

Now click on the Finalization tab.  Select STFS Type 0 in the drop-down box and the radio button for CON (Provided KV) and click Create Package.  Name it whatever you want, but I suggest [song ID].con (i.e. mycoolsong.con).


Installing
The easiest way to install is if you have a spare flash drive at least 1GB in size.  Clear everything off of the flash drive, then format it by going to the XBox 360 System Settings menu>Memory>USB Storage Device>Configure Now (or Customize if you want to manually specify how much of the flash drive to devote to XBox storage).  Note: This will delete everything off of the flash drive.  You have been warned!

Once it is configured, navigate to your data for Rock Band 2 (either on the hard drive or the internal memory) and copy the Rock Band 2 Song Cache to the flash drive you just configured (nothing special about the song cache, you just need SOME file from RB2 on the flash drive in order to create the proper folder on the flash drive)

Unplug the flash drive from the XBox and plug it in to your PC, then open Modio and select Explore a device

In the new window that comes up, select File>Open/Close Drive.

Navigate to Content\Downloads\Rock Band 2\Game Saves.

Right-click in the right-hand pane and select Insert File.  Browse to and select your .con file.

Select File>Open/Close Drive to close the drive, then eject it and insert it into the XBox.  If you did everything correctly, the song should show up on the flash drive and in the Rock Band 2 song list.  If it works, you can copy it off of the flash drive to your hard drive or internal memory if you like.

Have fun :)