9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Russ Cox <russcox@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] playing music (was RSA)
Date: Mon, 31 Jan 2005 02:03:33 -0500	[thread overview]
Message-ID: <ee9e417a05013023034c6acaa5@mail.gmail.com> (raw)
In-Reply-To: <ee9e417a0411061456318ef864@mail.gmail.com>

On Sat, 6 Nov 2004 17:56:14 -0500, Russ Cox <russcox@gmail.com> wrote:
> a few weeks ago,
> i wrote an acme equivalent of ken's juke box,
> kind of like acd but driven by a database of
> audio files instead of a single cd.  the whole
> thing is a handful of shell scripts and is pretty
> nice.  after i iron out some more bugs i will
> clean it up and put it somewhere for people
> to play with.

I finished cleaning.  There are C programs now.
http://swtch.com/juke.tar.gz.

The gui instructions and README file are below.

The tgz assumes you're using plan9port on a Unix system
but it should be trivial to move over to real Plan 9.
Juke depends on some recent additions to acme.
They are in CVS in plan9port and also on sources
as of a few minutes ago.

Enjoy.
Russ

--- from jukeget script
jukewelcome='
Welcome to Juke.

This window, /juke/, is the playlist window.
It contains a list of songs to be played, along
with any other text.  Songs are lines that
begin with song/nnn, where nnn is a number.
They might have other text (like the name of
the song) as well.

If you button 2 click on a line in this window,
juke starts playing the first song it finds on
that line or following.  The currently playing
song is marked with a >.  When the song ends,
juke picks up the > and scans forward for the
next song, and then starts that song.  If juke finds
a line beginning "repeat" instead, then it moves
back to the top of the file.  Otherwise, if juke
reaches the end of the window, it stops playing.

If the playlist window contains a line beginning
"shuffle", the playing algorithm changes: when
one song ends, juke chooses the next song at
random from all the songs in the window.  Juke
never stops playing in shuffle mode.

This window's contents *are* the play list.
If you move songs in this window, that changes
the play order.  If you move the >, then juke
will think that was the song being played when
the current song ends.

Juke recognizes some builtin commands, which are
displayed in the tag of this window.  V- and V+
change the volume.

In addition to song tags (song/nnn), there
are album, artist, composer, and genre tags.
Button 3 clicking on any of these opens a new
window named, e.g., /juke/song/nnn, displaying
information about the song, the contents of
the albums, works by the artist or composer,
or songs in the genre.  In the results window,
button 2 clicking on a line appends that line
to the end of the playlist.  Button 3 clicks
behave as just described.

If you button 3 click on text that is not a tag,
then the new window will be named /juke/search,
and it will be filled with a list of tags whose
titles match the clicked text.  The search
windows behave just like the song windows.

Button 3 clicking on the single words song,
album, artist, composer, and genre shows lists
of the given category.

This is an intimidating amount of explanation.
Just try it.  

Enjoy.

'

--- README
This directory contains a collection of tools that
implement a music player for acme(1).  

Install on a plan9port system with

	mk install

Before running Juke, index your song files:

	mkdir -p $HOME/lib/jukedb
	jukeindex *.mp3 *.m4a

(replace the wildcards with real paths to your sound files).

Once you have indexed your songs, run Juke, which will
create an acme window named /juke/ that contains instructions
on using the browser.

There are two shell scripts you may need to customize to
your system: jukeinfo and jukeplay.  Jukeinfo is invoked by
jukeindex for each file name you specify.  It is expected to
print information about the music file, probably by invoking
a helper program like mp3info or m4ainfo.  See those programs
for the output format and field list.  Jukeplay is invoked to 
play the named file.  It must write the decoded audio to 
standard output, *not* to the audio device.  The audio must
be 44100 Hz, 16-bit stereo PCM.  

Jukeinfo and jukeplay can handle MP3 and MP4 files with
extensions .mp3 and .m4a respectively.  Jukeinfo uses two
supplied programs mp3info and m4ainfo.  Jukeplay uses
mpg123 and faad.  It contains a workaround for a faad bug.
If the bug is ever fixed, remove the echo -n xxx.

Note that the programs cannot handle .m4p like you download
from iTunes, though the Windows program iOpener can turn
these into .m4a files.

The juke C programs never actually access the files,
so there's no need for them to be files at all.  You could
imagine changing jukeinfo and jukeplay to take URLs and
access files on a remote web server, and everything should
just work out.  I haven't tried this, but it seems like a 
neat idea.

There is also a standalone program "volume" included
that gives more detailed mixer access than Juke.

Comments and problems to Russ Cox <rsc@swtch.com>.

================================

The pieces of the player you shouldn't need to touch are:

Juke
	Shell script that starts ajuke after sanity-checking environment.

ajuke
	The program that talks to acme.  It manages all the windows
	named /juke/* and uses the following helper programs to
	make the windows useful.

jukeget name
	Print the contents for a new window named name.
	Window names are:

		/juke/ - the playlist
		/juke/song/ - the list of songs
		/juke/song/n - song #n

	And also album, artist, composer, and genre, list in place of song.

jukesearch pattern
	Print the contents for a search window searching for pattern.

jukeput name
	Write standard input to the file for the window named name.
	Only the playlist /juke/ and the sublists /juke/list/* can
	be written.

jukefmt id
	Tab "song/n Title" lines so that they line up using the
	acme font in the window with the given id.

jukesongfile nnn
	Print the name of the song numbered nnn.

The audio back end for volume and ajuke is system-specific,
and only Linux is implemented.  If you add support for another
system, please mail it to me so I can include it.

---


  parent reply	other threads:[~2005-01-31  7:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-06 21:47 [9fans] RSA + OAEP padding Paul Lalonde
2004-11-06 21:58 ` andrey mirtchovski
2004-11-06 22:01   ` boyd, rounin
2004-11-06 22:13     ` andrey mirtchovski
2004-11-06 22:37       ` Axel Belinfante
2004-11-06 22:56         ` Russ Cox
2004-11-06 23:00           ` boyd, rounin
2004-11-06 23:14           ` andrey mirtchovski
2004-11-07  0:35           ` Christopher Nielsen
2005-01-31  7:03           ` Russ Cox [this message]
2005-01-31  7:59             ` [9fans] playing music (was RSA) Kenji Okamoto
2005-01-31  8:05               ` Russ Cox
2005-01-31  8:08                 ` Kenji Okamoto
2005-01-31  8:32                   ` Russ Cox
2005-01-31  8:41                     ` Kenji Okamoto
2005-01-31 11:01                     ` Axel Belinfante
2005-01-31 17:59                       ` Russ Cox
2005-01-31 20:07                         ` Tim Newsham
2005-01-31 20:21                           ` Russ Cox
2005-01-31 20:30                           ` rog
2005-01-31 14:45                     ` Sape Mullender
2005-01-31 10:56             ` Axel Belinfante
2005-02-02  9:18               ` Kenji Okamoto
2005-02-03  7:54                 ` Kenji Okamoto
2005-02-03  8:00                   ` boyd, rounin
2005-02-03  9:06                     ` Kenji Okamoto
2005-02-03  9:16                       ` boyd, rounin
2005-02-03 15:28                   ` Sape Mullender
2005-02-04  1:08                     ` Kenji Okamoto
2005-02-04  1:17                       ` boyd, rounin
2005-02-04  1:20                         ` Kenji Okamoto
2005-02-04  1:24                           ` boyd, rounin
2005-02-04  1:27                             ` Kenji Okamoto
2005-02-04  1:36                               ` boyd, rounin
2005-05-07  8:59                                 ` Ralph Corderoy
2005-05-07 12:57                                   ` Russ Cox
2005-02-04  9:59                             ` Steve Simon
2005-02-04  1:19                       ` boyd, rounin
2005-02-04  1:22                       ` bs
2005-02-04 13:24                       ` Sape Mullender
2005-02-07  2:35                         ` Kenji Okamoto
2005-01-31 16:28             ` rog
2005-01-31 17:18               ` Russ Cox
2004-11-07  2:48 ` [9fans] RSA + OAEP padding William Josephson
2004-11-07  5:17   ` Paul Lalonde
2004-11-07  8:12     ` [9fans] venti httpaddr arisawa
2004-11-07 15:40       ` Russ Cox
2004-11-07 22:58         ` arisawa
2005-02-04  2:01 [9fans] playing music (was RSA) YAMANASHI Takeshi
2005-02-04  9:33 ` C H Forsyth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee9e417a05013023034c6acaa5@mail.gmail.com \
    --to=russcox@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).