From owner-freebsd-questions@FreeBSD.ORG Tue Jan 4 08:57:57 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4D29106566B for ; Tue, 4 Jan 2011 08:57:57 +0000 (UTC) (envelope-from peter@vereshagin.org) Received: from mx1.skyriver.ru (ns1.skyriver.ru [89.108.118.221]) by mx1.freebsd.org (Postfix) with ESMTP id 9AFF18FC16 for ; Tue, 4 Jan 2011 08:57:57 +0000 (UTC) Received: from localhost (unknown [199.48.147.42]) by mx1.skyriver.ru (Postfix) with ESMTPSA id A2DCF5A83 for ; Tue, 4 Jan 2011 11:39:59 +0300 (MSK) Date: Tue, 4 Jan 2011 11:57:35 +0300 From: Peter Vereshagin To: freebsd-questions@freebsd.org Message-ID: <20110104085734.GC5302@external.screwed.box> References: <20101226170930.GA68817@orange.esperance-linux.co.uk> <20110104042338.GA29930@shell.eskimo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20110104042338.GA29930@shell.eskimo.com> Organization: ' X-Face: 8T>{1owI$Byj]]a; ^G]kRf*dkq>E-3':F>4ODP[#X4s"dr?^b&2G@'3lukno]A1wvJ_L(~u 6>I2ra/<,j1%@C[LN=>p#_}RIV+#:KTszp-X$bQOj,K Subject: Re: randomising tracks: scripting question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 08:57:58 -0000 You know St. Peter won't call my name, freebsd-questions! 2011/01/03 20:23:38 -0800 Joseph Olatt => To Frank Shute : JO> On Sun, Dec 26, 2010 at 05:09:30PM +0000, Frank Shute wrote: JO> > JO> > I generally play my tracks of an album like so: JO> > JO> > for track in $(cat trombone_shorty-backatown.m3u); do JO> > mplayer $track JO> > done JO> > JO> > They then play in the correct order. JO> > JO> > How would I go about randomising the order of play using JO> > sh (preferably) or perl? I have several tens of thousands of MIDI files from 90s. They are too many for 'random play' feature of the Timidity++ which is used with 'eawpats', the GUS patches. Here is my bash script to play them in random order: === #!/usr/local/bin/bash IFS=' ' fns=(`find ~/mid/ -iname '*.mid'`) while :; do timidity -a -OdS -in -j -t 1251 -E t -p a -R 500 -EFreverb=127 -EFns=4 ${fns[$((${#fns[@]}*$RANDOM/32767))]} done === Of course I miss the 'Previous track' functionality. 73! Peter pgp: A0E26627 (4A42 6841 2871 5EA7 52AB 12F8 0CE1 4AAC A0E2 6627) -- http://vereshagin.org