Friday, December 03, 2010

Getting HTML code to show up in Blogger

If you want to write something in a blog that happens to be HTML code, you can get it to show up by using alternatives to characters.

In the last post, I was trying to write /<microSD>/ as part of an explanation.  What I posted was just //.  It's because Blogger and the browser interpreted the < > as html code and didn't show it as text.

Why's it showing up here?  Because I didn't actually insert a <.   What I put in is "& l t ; " and "& g t" (without the spaces and quotation marks).  Blogger replaces that set of characters with < and  >.

The alternates are Unicode Alternatives for special characters in HTML.  That link has a long list of them and explains where and how they work.

Really simple directions for making Rockbox playlists

If you're starting to use Rockbox, start with playlists.

Rockbox treats everything it's playing as part of a playlist. If you put a bunch of songs into a folder, then start to play one of them, Rockbox automatically puts all of the songs in that folder into a playlist. You won't necessarily know it unless you decide to save it as a playlist.

This post is about creating playlists using your computer.  You can also create playlists using just your player and Rockbox, but that's a separate discussion.

What's a playlist?
A playlist is really just a list of songs. What makes it into a playlist is that there's a file path connected with each song on the list. When Rockbox reads the next song on the playlist, it uses the file path to find the song. Rockbox knows it's a playlist because of the file name extension: .m3u or .m3u8.

Incidentally, Rockbox creates playlists using .m3u8 as the extension. Most computer-based music managers seem to use .m3u. Rockbox recognizes either one.

A playlist file will look like:
The keys to making your playlists work are:
  • getting the file paths right so Rockbox can find the songs
  • getting the file extension right so Rockbox knows they're playlists
  • getting your playlists in the right folder so they show up in the Playlist Catalog

File Paths
First the file paths.   The file system Rockbox uses is just like the one on your computer.   It's identical if you use Linux.  If you use Windows, there's one significant difference: the Rockbox root directory (the base directly that every other folder and file is a part of) is called "/". That a forward slash without the quotation marks.

In Windows, the root directly is probably something like C:\ or G:\. In Rockbox, it's /.   Rockbox, like Linux, uses a forward slash instead of a backslash, but I've read that it understands both.  Haven't tested that though -- I always use a forward slash.

Rockbox Folders
On my Sansa Fuze, with a micro SD card in it, I have two root folders:
  • /
  • /<microSD>/
My songs are in these two folders:

  • /<microSD>/MUSIC/
  • /MUSIC/

    My songs names look like this:
    • 01 - Suzie Q.mp3
    • 01 - Sympathy For the Devil.mp3
    for no particular reason other than it's convenient for the way I store them on my computer. I use this file structure:
    /Music/"Band"/"Album"/"Track Number" - "Title".mp3
    This isn't significant; you can name your songs anything you want.  If I'd designed it with the portable player in mind, I might have left off the track number for simplicity.

    A playlist looks like this:
    /<microSD>/MUSIC/01 - Suzie Q.mp3
    /<microSD>/MUSIC/01 - Sympathy For the Devil.mp3
    /<microSD>/MUSIC/01 - The Red Rooster.mp3
    /MUSIC/1 - I Can't Be Satisfied.mp3
    /MUSIC/01 - I'm A Man.mp3
    The songs that begin with "/MUSIC/" are on the players' internal storage in the "MUSIC" folder. The songs that begin with "//MUSIC/ are on the micro SD disk in the "MUSIC" folder.

    To show up in the Rockbox Playlist Catalog, playlists have to be in the playlist folder:

    So the name for the example playlist could be:
    and the complete file name (the one you'd use as the file path in a playlist) would be
    Creating a Playlist
    To create a playlist on your computer, you can use a text editor.  Just a simple text editor is easiest.  You can use a word processor like OpenOffice Writer or Microsoft Word, but you have to save it as a text file.  If you save it as the regular .odt or .doc file it will have a lot of formatting information that will confuse Rockbox.

    For me, it's easiest to make a list of the songs first, then add the file paths.  So I start by typing just the file names:

    01 - Suzie Q.mp3
    01 - Sympathy For the Devil.mp3
    01 - The Red Rooster.mp3
    1 - I Can't Be Satisfied.mp3 
    01 - I'm A Man.mp3

    Once that's done I add the paths using copy and paste.  If the first song is in /<microSD>/MUSIC/, I type that in, copy it, and paste it in front of all the songs that are on the microSD card.

    Then I do the same for the songs /MUSIC/.

    Then I save the playlist as playlistname.m3u8 into the /Playlists folder.

    Incidentally, for some reason when I create a playlist using Rockbox itself, the default is for Rockbox to save it in the root directory.  That means it doesn't show up in the Playlist Catalog.  To create it in the /Playlist folder, you have to add /Playlist to the beginning of the name.  That's a real pain when you're using Rockbox's internal keypad.

    It's probably just a setting I have to adjust somewhere, but I haven't figured it out yet.

    Absolute and Relative File Paths
    You can use two different kinds of file paths in Rockbox: Absolute and Relative.

    File paths are just like directions. If you ask someone where the nearest coffee shop is, he can give you directions two ways. One is relative: "go two blocks ahead, then turn left." The other is absolute: "it's on the corner of 3rd and Pine St."

    For the relative directions, you obviously have to know where you are. The wouldn't work in a newspaper ad, for instance.

    File paths in playlists are the same way. The file path for a song can be absolute, meaning it starts with a root directory, or it can be relative, meaning it starts from the directory where the playlist is stored.

    Since the Rockbox Playlist Catalog only lists playlists in the /Playlists directory, it's fairly easy to use either kind of file path. I find it easier to stick with absolute.

    I've read that Rockbox tries to make file paths work even if there missed up. If it doesn't find the song using the filepath on the playlist, it will lop off directories until it finds it. So, for instance, if you the song is in /MUSIC/song.mp3, but you wrote the file path as /NEW/MUSIC/song.mp3, Rockbox would discover that there's no /NEW/ and move on to /MUSIC/.

    I haven't actually tested that, but Rockbox has played a few songs from file paths I messed up.