Your Digital Media Has Never Looked So Good

 
mic_hall
Topic Author
Posts: 10
Joined: Wed May 09, 2007 6:40 am

A great idea to speed up searching for music

Wed Apr 30, 2008 12:49 pm

I have an idea and I need some help:

Here is my scenario: I have a large collection of music, all organized by albums. I only keep full albums and I don't like any playlists because this is a pain to the neck. I have simply no time to compose my 'good day'/'bad day'/'rainy day'/'sunny day'/'my best' or whatever day there might be - I just want to find out that very specific album very quickly. However, as most of you have already learned, searching for music is not a simple 'one click' process on our soundbridges. First of all, you only see two lines and still... you need to remember what was the name of album...

So I was thinking about assigning a four digit code (pin style) to each and every album I have and then use the universal remote controller to dial that code into the soundbridge - after dialing the last code the player would automatically start playing the first song from the album. I would then make a printed booklet with a listing of all albums and codes for easy access.

So what do you think? Anybody wants to jump in?
 
mic_hall
Topic Author
Posts: 10
Joined: Wed May 09, 2007 6:40 am

Thu May 01, 2008 6:16 am

>>I have a large collection of music, all organized by albums.
>
>You lost me already. Most of us use a media server that can organize
>music by artist, album, title and genre (plus more) simultaneously.
>What do you mean that your collection is organized by album?

I meant my basic element of organization in my collection is album, as opposed to 'playlist', 'genre' or anything else.

>>I don't like any playlists because this is a pain to the neck.
>
>Not sure what you mean. Have you tried using Smart Playlists.

Smart playlists are generated only once the database file is being created. At least this is the case on my mpdaapd running on my NSLU, but anyway - I really want to find out that very specific album - smart playlists would be of a limited help here.

>>However, as most of you have already learned, searching for
>>music is not a simple 'one click' process on our soundbridges.
>
>I don't find it difficult at all. Granted I only have about 5000 titles,
>but I can locate any title, album or artist in seconds. Even with only
>two lines of display, it's quite simple.

If two lines were perfectly enough, I guess Apple would not bother to invent cover-flow.

>>First of all, you only see two lines and still... you need
>>to remember what was the name of album...
>
>Yes, if you are searching for something, you do have to remember what >it is called.

Well, it's actually only the case since the digital age... In the old days of you would only need to remember where did you put the think you were looking for. That was the case in all the history of mankind (until just recently) and this is why our visual memory is so much more developed. So I want to move back and use that skill of mine. In my proposal I would only need to remember that the album is somewhere in the middle of the third page...
 
Burkhardi
Posts: 1943
Joined: Tue Jun 07, 2005 11:06 am
Location: Austin, Texas ...Y'all

Thu May 01, 2008 9:43 am

If one is in the music library and you want to jam to the album “Moving Picturesâ€
Roku3 and Roku HD1000 [Rev B] on a Samsung HLP5674W DLP in the living room; a Roku2 and two Roku XS and a few SoundBridges.Win7; Kubuntu and XP via RT-N66U, E2000 and a switch or two. I own stock in Roku, it's just all in the form of hardware.Viva la Roku
 
mic_hall
Topic Author
Posts: 10
Joined: Wed May 09, 2007 6:40 am

Thu May 01, 2008 2:10 pm

[quote]If one is in the music library and you want to jam to the album “Moving Picturesâ€
 
mic_hall
Topic Author
Posts: 10
Joined: Wed May 09, 2007 6:40 am

Thu May 01, 2008 4:34 pm

And it actually works: see it for yourself:
http://www.youtube.com/v/y6z7awocaHE
 
mic_hall
Topic Author
Posts: 10
Joined: Wed May 09, 2007 6:40 am

Tue May 06, 2008 3:17 pm

By now I have completed all parts of the system! It just rocks (finally my Roku is a useful device...).

Here is the how I did it:
- on your NSLU install the fantastic perl script for displaying the weather information - follow instructions from here: http://billiatjapan.netfirms.com/Tools4Roku/index.html

- modify the main script by the following code (the while(1) loop):

while (1) { 
   $display->open || die("Could not connect to Roku Soundbridge"); 
   $display->cmd("irman echo");
   #$display->msg(text => "loop...", x => 0, y =>  0, duration => 0, keygrab => 0);

   do
   {
      my ($p, $m ) = $display->{connection}->waitfor(Match => '/irman: .*/',
                                                                               Timeout => $minitimeout);
      if ($m) 
      {
         $m =~ s/^irman: //;
         if (($m eq "CK_SEARCH") and ($display->ison())) {
                $menu = 1;
         };
      };
   }
   until ($menu == 1 );
      
   if ($menu == 1 )
   {
      $display->cmd("irman intercept");
     $display->cmd("irman dispatch CK_EXIT");


          showcode("1");

     $display->close();
     $menu = 0;
   };
};


and put in the same file, somewhere in the section on subs, an additional function:
sub showcode {

   my $from = shift;
   my $position = 0;
   my $myselection = -1;
   my $rc;
   my $myexit;
   my ($p, $m);
   my $digits = 1; # we start from second digit
        my @arrdig = ("_","_","_","_");

        my $i;
        my $j;
   
  $display->clear();

  do
  {
        $rc = $display->msg(text => "Kod: ".$arrdig[1].$arrdig[2].$arrdig[3], font => 2, x=>10, y=> 0, duration =>6, keygrab => 1, clear => 1);
                   # we do not show the first digit (0)

   if($rc eq "CK_PREVIOUS") {$arrdig[$digits] = 1; $digits++; };
   if($rc eq "CK_PLAY") {$arrdig[$digits] = 2; $digits++;};
   if($rc eq "CK_NEXT") {$arrdig[$digits] = 3; $digits++; };
   if($rc eq "CK_PAUSE") {$arrdig[$digits] = 4; $digits++; };
   if($rc eq "CK_VOLUME_UP") {$arrdig[$digits] = 5; $digits++; };
   if($rc eq "CK_SHUFFLE") {$arrdig[$digits] = 6; $digits++; };
   if($rc eq "CK_ADD") {$arrdig[$digits] = 7; $digits++; };
   if($rc eq "CK_VOLUME_DOWN") {$arrdig[$digits] = 8; $digits++; };
   if($rc eq "CK_REPEAT") {$arrdig[$digits] = 9; $digits++; };
   if($rc eq "CK_WEST")
   {
     if($digits>1){ # only move back to second digit
     $digits--;
     $arrdig[$digits] = "_";
     };
   };
   if($rc eq "CK_SOUTH") {$arrdig[$digits] = 0; $digits++; };
   if($rc eq "timeout") {$myexit = 1 };
   if($rc eq "CK_EXIT") {$myexit = 1 };
   
  } until (($myexit == 1) or ($digits == 4));

# Execute the search
  if (not $myexit == 1)
  {
    #$display->msg(text => "Szukam: ".$arrdig[0].$arrdig[1].$arrdig[2].$arrdig[3], x => 0, y =>  0, duration => 0, keygrab => 0);
    $display->close();
    select(undef, undef, undef, 0.25);
    $display->open || die("Could not connect to Roku Soundbridge"); 
   
    #$display->cmd("rcp");
    #$display->cmd("

    #get to entering numbers in albums
    $display->cmd("irman dispatch CK_EXIT");
       select(undef, undef, undef, 0.05);
    $display->cmd("irman dispatch CK_SEARCH");
       select(undef, undef, undef, 0.05);
    $display->cmd("irman dispatch CK_SOUTH");
       select(undef, undef, undef, 0.05);
    $display->cmd("irman dispatch CK_SELECT");
       select(undef, undef, undef, 0.05);
    $display->cmd("irman dispatch CK_NORTH");
       select(undef, undef, undef, 0.05);
    $display->cmd("irman dispatch CK_NORTH");
   
    #process with entering number
    for($i = 0; $i < 4; $i++)
    {
       for($j = 0; $j < $arrdig[$i]; $j++) { $display->cmd("irman dispatch CK_EAST");select(undef, undef, undef, 0.05); };

       #select
       $display->cmd("irman dispatch CK_SELECT");
       select(undef, undef, undef, 0.05);
       
       # then move back
       for($j = 0; $j < $arrdig[$i]; $j++) { $display->cmd("irman dispatch CK_WEST");select(undef, undef, undef, 0.05); };
       
    };
    $display->cmd("irman dispatch CK_SOUTH");
       select(undef, undef, undef, 0.05);
    $display->cmd("irman dispatch CK_SOUTH");
       select(undef, undef, undef, 0.05);
    $display->cmd("irman dispatch CK_SOUTH");
       select(undef, undef, undef, 0.05);
    $display->cmd("irman dispatch CK_SELECT");
    for($j = 0; $j < 30; $j++) {
    select(undef, undef, undef, 0.1);
    $display->cmd("irman dispatch CK_PLAY");
    };
  };
};

(it's a rough code, and could be optimized...)

Then create a separate script to discover the presence of the roku (it kills the main script if the roku is turned off) :

#! /bin/sh

#Set the IP of the controlled Soundbridge
ROKUIP=192.168.2.101

#Set the location of your main weather script
TOOLSDIR=/opt/etc/tools4roku
TOOLSFILE=t4roku.plC

#Set the directory where the PIDs files are stored
PIDDIR=/var/run
PIDFILE=Tools4roku1.pid

while [ 1 ]
do
  #echo "Pinging"
  if ping $ROKUIP -c 1 | grep round -q
  then
    #echo "Found"
    if [ -e $PIDDIR/$PIDFILE ]; then
     #echo "Service already started"
     test 1
    else
      #echo "Starting Service"
      cd $TOOLSDIR
      perl $TOOLSFILE &
      ps | grep perl | grep $TOOLSFILE | sed s/\ \a.*// > $PIDDIR/$PIDFILE
    fi
  else
    #echo "Not found"
    if [ -e /$PIDDIR/$PIDFILE ]; then
         #echo "Killing and removing"
         kill `cat $PIDDIR/$PIDFILE`
         rm -f $PIDDIR/$PIDFILE
    fi
  fi
  sleep 5
done


This scirpt has to be launched by one of your [init.d] scripts

Then you have to arrange your music library. Basically, the system works by searching the album names for series of digits in its name. So somehow you have to rename all of your albums in your music library by adding an unique number to all of them. To achieved this used the following process:

1. Re-arrange the music directory into:
[x]:\music\Album Artist - Album\*.mp3

If you use automatic re-arranging (like with the use of Mp3tag) you have to be careful not to allow to spread your albums across several folders if it happens that not all your tracks in albums have been given with the same album artist.

2. Rename all of the album folders into four digits unique name. For this I used this windows batch script:
 if %1!==! goto end
 if %1!==}{! goto pass2
 dir %1\*. /b /o:n > %temp%\}{.dat
 set count=0
 for /F "tokens=*" %%a in (%temp%\}{.dat) do call %0 }{ "%%a"
 del %temp%\}{.dat
 goto end
 :pass2
 set /a count+=1
 set fname=%count%
 if %count% LSS 10000 set fname=0%count%
 if %count% LSS 1000 set fname=00%count%
 if %count% LSS 100 set fname=000%count%
 if %count% LSS 10 set fname=0000%count%
 rmdir %2 %fname%
 :end


save this code into a new file [give-code.bat] to your [x]:\ directory and run from command line by giving the name of your muisc folder as the parameter:
[code
x:\>give-code.bat music
[/code]
- this is irreversible, so be careful and test before going full scale!

3. Use your favorite mp3 tag editor (I used Mp3tag v.2.39) to import the name of the folder into the album tag. Because of the limits of the software I had to do this in two stages: first import the code into the "comment" tag, then export it again into the name of the folder merged with the name of the album taken from the album tag. Then again import the merged name of the folder (\XXXX - Album name\) into the 'album' tag. Because my music library is located on the network drive connected to the NSLU, the whole process took like ... 6 hours...

4. Reboot everything and enjoy!

MANUAL:
- the roku has to be connected to your music library!
- to enter the code, press the 'search' button and provide the code with the buttons on your remote:

down = 0
|<< = 1
 >  = 2
>>| = 3
 || = 4
vol up  = 5
shuffle = 6
add = 7
vol down = 8
repeat = 9


- searching starts with entering the last digit.

The last stage was a creation of the 'menu'. For this I used the Mp3tag function of exporting of your music collection data to the Excel file. Then I made a pivot table and selected only genre, album and artist. Then I copied to Word and made some fancy looking menu... I only need to get somehow that nice leather folders that they have in the restaurants ;-)

Who is online

Users browsing this forum: No registered users and 1 guest