Function - play # uses mplayer random directories


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Function - play # uses mplayer random directories
# 1  
Old 05-18-2013
Function - play # uses mplayer random directories

I have this in my .bashrc and use it to play my music. It is organized by directories and this will play them in random order:

Code:
play(){ ## play directories with mplayer (random)
if [ $# -eq 0 ]
then
    # if no option show music types
    echo -n "
play {directory|style}

Styles:
-------"
    find  ~/music/ -maxdepth 1 -type d -print | cut -d'/' -f5|sort
else
    # create tmp list
    xtitle "mplayer tunes!"
    clear
    [ ! -e $1 ] && cd ~/music
    find -L $1 -type f -name \*.\* >play.$$
    if [ "$1" == "vids" ]
    then
        \mplayer -fs -msgcolor -shuffle -playlist play.$$ 2>/dev/null
    else
        \mplayer -msgcolor -shuffle -playlist play.$$ 2>/dev/null
    fi

    \rm play.* 2>/dev/null
    cd -
fi
}

I have many other tools and such, if folks find them of use I will post them.

bd - Put your hand on a hot stove for a minute and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. That's Relativity. - A.E.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Mplayer fifo.

Hi all, First of all, sorry for the pastebin link. The code tags aren't working for me. #!/bin/bash # while-menu-dialog: a menu driven - Pastebin.com This is a channel "changer" shell script i'm working on. It uses dialog to display the menus. It... (3 Replies)
Discussion started by: ignatius
3 Replies

2. Shell Programming and Scripting

Recurse directories and return random file

I have a nice program to change the background but I want it to operate on subdirectories as well. # Script to randomly set Background from files in a directory while true;do # Directory Containing Pictures DIR="/home/pc/Pictures" # Internal Field Separator set to newline, so file names... (4 Replies)
Discussion started by: triplemaya
4 Replies

3. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies

4. Shell Programming and Scripting

Function to remove the directories from PATH variable

Hello, From the URL https://www.unix.com/shell-programming-scripting/121303-remove-path-path-environment-variable-2.html I got a function to remove the directories from a path. but looks like this isnt quite working.. i am also not able to post the comments in the thread as it is closed. ... (6 Replies)
Discussion started by: satishkumar432
6 Replies

5. Shell Programming and Scripting

Extract function names and directories from php files

I need a script that extracts function names from php files together with their location (path and file in which they are defined). The php files are located in several directories under a base directory. Ideally the output should be something like: "Path/FileName/FunctionName" for a... (2 Replies)
Discussion started by: bamse
2 Replies

6. Shell Programming and Scripting

mplayer problem

I have this problem using a script that uses mplayer. This is the error messages. INFO: Mplayer Log LOG: MPlayer SVN-r1.0~rc3+svn20090426-4.4.3 (C) 2000-2009 MPlayer Team LOG: mplayer: could not connect to socket LOG: mplayer: No such file or directory LOG: Failed to open LIRC support. You... (1 Reply)
Discussion started by: locoroco
1 Replies

7. Ubuntu

expect script for random password and random commands

Hi I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue: I want expect script for random passwords and random commands generation. please can anyone help me? Many Thanks in advance (0 Replies)
Discussion started by: vanid
0 Replies

8. Solaris

mplayer on soalris

Hi all ... I would like to know how to install mplayer on solaris 10 i have been trying to understand it through the docs on their website but didnt get it that well.. So if anyone can give me step by step instructions to install it ..i would much appreciate it!!! Thanks (3 Replies)
Discussion started by: wrapster
3 Replies

9. Shell Programming and Scripting

random function script

hi, I need a command which picks the records randomly from the file. For example. i am having some 10000 entries in a file and need to extract the lines randomly without repeating the numbers. Do anybody have any idea on how to get this out. (4 Replies)
Discussion started by: prash_b
4 Replies

10. UNIX for Dummies Questions & Answers

Help me: Divx with MPlayer

Hi, I'm a beginner in linux :( I wanna play divx with MPlayer. I have mdk8.1 and I can't install MPlayer because I have gcc 2.96 I need upgrade my gcc to 2.95.2 or 2.95.4 Anyone can say me how do i do to uninstall gcc-2.96 and install gcc-2.95.2. Can you give me the exactly url to... (1 Reply)
Discussion started by: mercutio
1 Replies
Login or Register to Ask a Question
PianoBooster(6) 														   PianoBooster(6)

NAME
pianobooster - learn the piano just by playing a game DESCRIPTION
Piano Booster is piano teaching software that can provide piano lessons for beginners as well as for advanced players. It can be used for teaching music theory and is useful for piano practice and learning piano technique. SYNOPSIS
pianobooster [flags] [midifile] OPTIONS
-d Increase the debug level -q Quick start -h, --help Display a help message -v Display the version number and exit USAGE
Piano Booster is a fun way of playing along with a musical accompaniment and at the same time learning the basics of reading musical nota- tion. The difference between playing along to a CD or a standard midi file is that Piano Booster listens and follows what you are playing on a midi piano keyboard. The program has been designed to allow you to play along on a midi piano keyboard with the scrolling notes shown on the screen. The notes you press on the keyboard appear as coloured lines on the musical stave, the colour of which depends whether you have pressed the right or wrong note. A different musical instrument sound is used for your playing depending whether you are playing the right or wrong notes. This feature also allows Piano Booster to be used with printed sheet music so you can hear if you are playing the right notes while at the same time keeping your eyes on the printed score. The music accompaniment will automatically wait for you to find and play the correct notes in the piece. Timing markers show whether you are playing ahead or behind of the beat. They appear as white crosses that are drawn over the note. FEATURES
- Piano Booster follows you when playing along to a musical accompaniment. If you stop, then so does the music. - Play a single hand and Piano Booster will play the other hand, as well as the rest of instruments, in time with you. - Change the speed of playback to match your playing ability. - Transpose +/- 12 semitones without stopping the play back. - Change the Key Signature of the piece. - Plays any standard midi or kar file. - Play along to any instrument in the midi file. - Adjust the volume of the current part or the volume your piano part. - See how accurate you're playing. - Change the start bar to start playing from any bar in the music. The repeat bars allows you to practice just a few difficult bars contin- uously. - Timing markers are white crosses that are drawn over each note and show if you are playing ahead or behind the beat. - A different instrument sound is used for the right and wrong notes that you play. SEE ALSO
You can find more about the game on its homepage: http://pianobooster.sourceforge.net/ AUTHOR
The game has been written by Louis J. Barman <louisjb@users.sourceforge.net>. This manual page was written by Miriam Ruiz <lit- tle_miry@yahoo.es> for the Debian project. PianoBooster(6)