TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker or making a Paypal contribution here: paypal.me/SupportTMC

Seeking 6 beta testers for TeslaShuffle project (shuffling/randomizing USB music)

Discussion in 'Model S: User Interface' started by ccbldg, Oct 30, 2013.

  1. ccbldg

    ccbldg Member

    Joined:
    Jun 20, 2013
    Messages:
    32
    Location:
    bldg
    The lack of a simple shuffle/random feature on USB music playback has prompted me to code a small Windows application to hack my own no-repeat random playback in the Model S.

    I'm seeking 6 beta testers for evaluation.

    This program will require the following:

    - mp3 or flac files only
    - all files on root drive of USB device (no folder structure)
    - existing files are properly tagged
    - filenames are <artist> <title> only (i.e. "The Beatles - I Want to Hold Your Hand.flac")

    Please Note: The are many programs available to accomplish <artist> <title> naming convention. I'd highly recommend Media Monkey: http://www.mediamonkey.com

    What this program does:

    - Counts the number of media files (i.e. 750)
    - Randomizes 001 thru 750 and assigns each file a number
    - Retrieves file "Title" tag and changes to the assigned random number + Title (i.e. Title tag "Help" becomes "045 Help")
    - Retrieves file "Track Number" tag & eliminates it (Tesla keys on track # and Album tags to correctly title song thus defeating shuffling)
    - Renames file itself (i.e. "The Beatles - Help.flac" is renamed to "The Beatles - 045 Help.flac"
    - With playback, proper artist/album/image appears
    - Will play all 750 files in randomized non-repeating order.

    After all music has played thru once, it will repeat from 001 or you can reshuffle with TeslaShuffle program again.

    Please click my username to send a private message with your email address if you're interested in evaluating.
     
  2. brianman

    brianman Burrito Founder

    Joined:
    Nov 10, 2011
    Messages:
    15,487
    I'm surely missing something so bear with me.

    Why isn't it as simple as:
    1. input: all files in the root directory of the USB with unique names
    2. count the files
    3. strip "[#] " prefix from each filename if present
    4. add "[#] " prefix to each filename

    Why does it matter what the file extension or format is?

    (In case it's not obvious, step 3 allows you to rerun the tool with the same content to get a different order.)
     
  3. AnOutsider

    AnOutsider S532 # XS27

    Joined:
    Apr 3, 2009
    Messages:
    11,923
    That's what I was thinking too. I tried messing around with some other solutions, but unfortunately FAT32 doesn't support symlinks. Wonder if you could format a USB stick to something else and have the on board media player recognize it? You could have something generate files like 001.mp3 002.mp3 etc and have those symlinked (or shortcutted) so that the actual track played is a random track from your library
     
  4. ccbldg

    ccbldg Member

    Joined:
    Jun 20, 2013
    Messages:
    32
    Location:
    bldg
    Brianman

    Tesla code appears to access all tags (title,track,album,artist,etc) within the file & the filename itself in trying to determine the song actually playing. Tesla then displays best guess Title, Artist, Album info plus image. Excellent coding on their part because of the numerous naming/tagging conventions and erroneous auto-tagging tags. Difficult if you simply wish to numerically rename your file & play in numerical as opposed to alphabetical order. Do a simple test yourself & you'll see what I mean.
     
  5. brianman

    brianman Burrito Founder

    Joined:
    Nov 10, 2011
    Messages:
    15,487
    Understood. Thanks.
     
  6. yobigd20

    yobigd20 Well-Known Member

    Joined:
    Oct 28, 2012
    Messages:
    5,793
    Location:
    Skaneateles, NY
    lets not run random binaries and give the NSA a backdoor to our driving habits now, capeesh? lol :p

    well actually they already have that from the ez-pass rfid tags and insurance driving habit devices.... oh well
     
  7. brianman

    brianman Burrito Founder

    Joined:
    Nov 10, 2011
    Messages:
    15,487
    @ccbldg regarding yobigd20's comment:

    Consider writing your tool in a "plain to read" script language rather than a compiled binary, if you want to avoid drama here. :)
     
  8. Jason S

    Jason S Model S Sig Perf (P85)

    Joined:
    Apr 20, 2012
    Messages:
    1,350
    Location:
    Rocklin, CA
    Huh? How does a windows app help playback on a linux mounted drive? AFAIK the OS for the model S appears to be some variation on the nVidia linux for Tegra dev.
     
  9. gbdesai

    gbdesai Member

    Joined:
    Oct 28, 2012
    Messages:
    152
    Location:
    California
    I assume you have to put the USB back in your windows machine every time you want to shuffle right?
     
  10. Jason S

    Jason S Model S Sig Perf (P85)

    Joined:
    Apr 20, 2012
    Messages:
    1,350
    Location:
    Rocklin, CA
    Oh, lol. Do that in perl!

    I should've read closer. Of course that's what the program does! Hmmm... seems like could do same thing with a batch file or shell script into a folder within the USB and then just play from the random folder. With large flash drives and compressed files you could have some fun with this.
     
  11. Todd Burch

    Todd Burch Electron Pilot

    Joined:
    Nov 3, 2009
    Messages:
    4,731
    Location:
    Smithfield, VA
    Incidentally, based on my testing, the car caches album artwork based on filename. This means that if you have 1000 songs, and they're renamed each time through, then each time through your playlist the album artwork will need to be redownloaded and recached. Not sure how big the cache can get before the system purges it.

    Either way...Tesla...are you listening? This should be trivial to implement once the energy saving issues are in order!
     
  12. ckessel

    ckessel Active Member

    Joined:
    Jan 15, 2011
    Messages:
    4,266
    Appreciate the attempt to hack around the limitation :)

    I understand Tesla has priorities, but seriously, how hard can it be to build in this functionality?
    Collections.shuffle( USBUtil.readAllSongs() )
     
  13. yobigd20

    yobigd20 Well-Known Member

    Joined:
    Oct 28, 2012
    Messages:
    5,793
    Location:
    Skaneateles, NY
    Yes but is it cached locally or on the drive itself? I never checked to see if there was any type of index file written to after plugging in. (From experience I know that other media players do this...but it guess that's because they don't have any internal storage of their own).
     

Share This Page