README 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  1. README for Plait v 1.6.2
  2. ========================
  3. 0. Introduction
  4. ---------------
  5. Plait (pronounced "play") can do two things for you: find and play
  6. music from your personal music library, and find and play Shoutcast
  7. radio streams. In order to actually play the music it finds, Plait
  8. hands off a play list to one of the supported music players
  9. (Beep Media Player, Xmms, amaroK, mpg123, ogg123, mpg321, XSPF Web
  10. Music Player, or Plaiter). The end result is that you can type, for
  11. example,
  12. plait "miles davis"
  13. and any music by Miles Davis that you own will begin playing in your
  14. music player. More complex commands allow you to play mixes of
  15. several albums or artists, read complex mixes from files, reorder the
  16. play list according to one of several patterns, select a certain
  17. number of tracks, queue tracks, send commands to the music player, and
  18. more.
  19. I wrote Plait because I was looking for an alternative to tedious
  20. point and click digging through my music library, on the one hand, and
  21. tedious typing of long file names, on the other. The solution used by
  22. Plait is based on "hints", which are basically fragments of song
  23. titles, artist's names, or album names. You specify as many hints as
  24. needed to get exactly the music you want. For example, rather than
  25. typing out the complete file name
  26. "/music/Billie Holiday/Ken Burns Jazz/Solitude.wav"
  27. or digging through a file requester to find this file, with Plait one
  28. types
  29. plait billie solitude
  30. When you already know exactly what you want to hear, this is really
  31. the quickest and easiest way to let the computer know (and when you
  32. don't know exactly what you want to hear, Plait has an interactive
  33. mode that allows you to browse tracks, albums, artists, and radio
  34. streams.)
  35. Even though it searches the entire music library every time it creates
  36. a play list, Plait is optimized for these types of queries (it caches
  37. your music directory) and can perform them very quickly. With a
  38. medium sized music collection of about 3,000 tracks, queries take less
  39. than a second.
  40. 0.1 What's new
  41. ---------------
  42. Release 1.6.2 is a security upgrade which cleans up all security flaws
  43. related to temp files.
  44. Release 1.6.1 is a maintenance release to track recent changes in the
  45. Shoutcast.com web site. You will need it if you want to continue
  46. running stream queries.
  47. 1. About that name...
  48. ----------------------
  49. "Plait" is French for "it pleases," because it is so pleasing to use.
  50. It also suggests the soundalike English word "play," which describes
  51. what it actually does. You might say it's a plait on words. At one
  52. point in the misty past, Plait was known as "play," but that name was
  53. taken.
  54. 2. Searching your music library
  55. -------------------------------
  56. Plait doesn't make any assumptions about the layout of your music
  57. library, but the better organized it is, the more useful the searches
  58. you can do. Ideally your file paths contain artists, albums, and song
  59. titles. In that case you can provide a hint about an artist and get
  60. all the material by that artist:
  61. plait mingus
  62. You can provide a hint which matches just one album:
  63. plait "kind of blue"
  64. Or you can match a single song
  65. plait "blue in green"
  66. (Although examples like these will typically "just work," keep in mind
  67. that Plait doesn't actually know that "Kind of Blue" is an album or
  68. Mingus is an artist. If you have a song named "Mingus", it will play
  69. also. Other options were considered, but this method is the easiest
  70. to use, and it seems to work very well. In fact, it is almost always
  71. possible to create a hint that picks exactly the music you want. See
  72. the section on advanced hinting for more information.)
  73. Because Plait scans your entire music library when matching hints, you
  74. are not limited to results from one directory. So if you have a
  75. compilation album that is distributed by artist throughout your
  76. collection, you can play the whole thing by searching for the album
  77. name. Similarly, you can play an entire album series, as in
  78. plait --random "ken burns jazz"
  79. This type of matching is also useful when you want to play several
  80. cover versions of the same song.
  81. Querying the entire music library for songs rather than finding files
  82. by directory also helps resolve some problems of categorization that
  83. come up when ripping a CD collection. If you rip Cecilia Bartoli's
  84. "Vivaldi Album," for example, do you store that as
  85. /music/Vivaldi/The Vivaldi Album feat. Cecilia Bartoli
  86. so that you can play it as Vivaldi music, or
  87. /music/Cecilia Bartoli/The Vivaldi Album
  88. so that you can play it as Cecilia Bartoli music? With Plait, it
  89. doesn't matter because, either way, the album will turn up when you
  90. type `plait cecilia` or `plait vivaldi`.
  91. Sometimes one hint is not enough to say exactly what you mean, so
  92. Plait does not place any limit on the number of hints you can specify.
  93. This comes in handy when you have a song title that is used by more
  94. than one artist. In my music collection, for example, if I type
  95. plait "walk on"
  96. I will hear "Walk On" by Neil Young, "Walk On" by U2, and the album
  97. "Walk On" by John Hiatt (which includes a song named "Walk On").
  98. Additional hints allow me to disambiguate:
  99. plait "walk on" neil # Neil Young's version
  100. plait "walk on" u2 # by u2
  101. plait "walk on/" # the album by John Hiatt
  102. plait "walk on[.]" hiatt # just the song
  103. (The last two examples are a little tricky. They work by matching the
  104. path separator or the dot in ".mp3". See the section on advanced
  105. hinting for more ideas.)
  106. This feature also comes in handy when you want to avoid typing a long
  107. song title, but the short hints available are ambiguous. If I use the
  108. hint "someday" for example, I get "Someday" by the Strokes, and
  109. "Someday We'll All Be Free" by Charlie Hunter. The command
  110. plait charlie someday
  111. gives me exactly what I want. Feel free to use hints that are easy to
  112. remember rather than trying to be efficient. That is one of the
  113. purposes of hinting, beyond just putting you on a first name basis
  114. with your favorite artists (or you could type `plait someday be` and
  115. save a few keystrokes; it's up to you).
  116. There is an implicit logical "and" between the hints in these
  117. commands, although you do not need to think of it that way if you are
  118. a non-programmer. In any case, you get just the songs that match
  119. *all* the hints, rather than any of the hints. (As we will see later,
  120. there is another type of search in which there is an implicit "or" and
  121. you get songs that match *any* of the hints.)
  122. Sometimes positive assertions about the music you want to hear are not
  123. sufficient to say exactly what you mean. For these situations the
  124. `not` keyword, which allows you to exclude songs that match a hint, is
  125. provided. As an example, the following command plays some music by
  126. Herbie Hancock, leaving out one track that I set aside for special
  127. occasions:
  128. plait herbie not rockit
  129. You can use as many "not" hints as you like, but you have to make at
  130. least one positive assertion about the music you want to hear, and it
  131. has to be the first hint on the command line. Therefore
  132. plait not miles
  133. will look for a song named "not" by Miles Davis. This is intentional.
  134. If you really want to hear random selections from almost your entire
  135. collection, you can just use a very broad positive assertion, as in
  136. plait --random ".*" not miles
  137. (".*" is a regular expression that matches anything. See the section
  138. on advanced hinting.)
  139. The features explained so far allow you to pick out a particular
  140. track, artist, album, or series, but sometimes you are interested in
  141. mixing together material from several artists or albums. In that case
  142. you will want the `--mix` option, which picks tracks that match *any*
  143. of your hints rather than all of them. For example
  144. plait --mix metheny hunter "tj kirk" "broun fellinis"
  145. will create a play list with a selection of jazz artists. Because it
  146. allows me to do something that would be totally impractical with CDs,
  147. the ability to make mixes has changed my listening habits more than
  148. any other feature of Plait.
  149. 3. Playing radio streams
  150. -------------------------
  151. Plait can search the Shoutcast web site, find stations matching your
  152. query, and play them in your music player. If you are interested in
  153. hearing trance music, for example, you might try
  154. plait --stream trance
  155. You can use a hint that contains spaces by enclosing it in quote
  156. marks, as in
  157. plait --stream "modern jazz"
  158. As of Plait 0.53, stream queries support multiple hints and the `not`
  159. keyword, just like music library queries. This allows you to search
  160. for radio stations much more selectively than before. The `--mix`
  161. keyword is also supported, but not the `as` keyword or mix files. The
  162. current thinking is that these features would be of limited usefulness
  163. with streams.
  164. Genre hints work well, because the Shoutcast directory includes a
  165. genre in the description of each radio station, but you can try other
  166. types of search, including by station name, call letters, artist or
  167. country.
  168. By default, you get the most popular stations matching your query, but
  169. if you don't like the popular stations in a certain genre, you can mix
  170. things up with the `--random` option (see below). For performance
  171. reasons, Plait limits you to ten streams (because they take a while to
  172. load into the music player), but you can request more with the
  173. `--tracks` option. In interactive mode, the number of streams is
  174. unlimited.
  175. Examples:
  176. plait --stream --random --tracks 5 jazz not smooth
  177. plait --stream 70s
  178. plait --stream bachata
  179. plait --stream NPR -i
  180. 4. Mix Files
  181. -------------
  182. As you make more complex mixes you may begin to use so many hints that
  183. they become inconvenient to type. At this point you will be ready for
  184. mix files. Once you have created an appropriate mix file with a hint
  185. for each jazz artist in your collection, for example, you can type
  186. plait --mixfile jazz --random
  187. to play random selections from your entire jazz collection. Creating
  188. mix files is easy because they are just text files with lists of
  189. hints, but Plait is also capable of creating mix files for you. First
  190. let's look at creating a mix file by hand. Mix files are stored in a
  191. subdirectory of your music directory. Specifically, if your music
  192. directory is /music, the mixfiles are at /music/.plait/mixfiles.
  193. (Storing them here rather than in plait's working directory allows you
  194. to continue using your mix files when you are accessing your music
  195. collection as a guest on someone else's computer.) To create a mix
  196. file for jazz, then, you might type the following into
  197. /music/.plait/mixfiles/jazz:
  198. "billie" "blakey" "brubeck" "coltrane" "dolphy" "getz"
  199. "hunter" "metheny" "miles" "mingus" "ornette" "rollins"
  200. "scofield" "stanton" "surman" "thelonious"
  201. (The hints should be separated by spaces or line feeds. It is only
  202. necessary to enclose a hint in quote marks if it contains a space.)
  203. That's all there is to it.
  204. Plait also has a simple syntax for creating mix files automatically,
  205. using the `as` keyword. For example, the following command creates a
  206. mix file and plays some cuts from it simultaneously:
  207. plait --mix galactic "scott amendola" "oranj symphonette"
  208. as postjazz
  209. The `as` keyword also comes in handy when you need to maintain mix
  210. files. Let's say you have a jazz mix file and you acquire some new
  211. music by Herbie Hancock. You can add him to the jazz mix as follows:
  212. plait --mixfile jazz herbie as jazz
  213. If Herbie Hancock were already in your jazz mix, no harm would be
  214. done--Plait makes sure that each hint occurs exactly once.
  215. You can use more than one mix file with a `plait` command. This allows
  216. you to create a "mix of mixes," for example:
  217. plait --mixfile jazz --mixfile postjazz as alljazz
  218. In general, you can combine mix files and hints freely on the command
  219. line, allowing you to play variations on a given mix depending on your
  220. mood:
  221. plait --mixfile jazz not miles not ornette
  222. Because they are based on hints, mix files have some of the features
  223. of play lists and some of the features of genres. As with play lists,
  224. a given artist can be included in as many mix files as you like. This
  225. allows you to create free form, overlapping categories for artists,
  226. rather than being forced to assign each artist to a single fixed
  227. category. As with genres, on the other hand, once an artist belongs
  228. to a mix, any new music you purchase by that artist is automatically
  229. added to the mix. In this sense mix files are more dynamic than play
  230. lists.
  231. (By the way, nothing said here should be taken to mean that mix files
  232. always have to consist of artist hints. That is probably the typical
  233. case, but there is nothing to prevent you from using album hints or
  234. song hints in your mix files.)
  235. Since you create mix files yourself, they require a little more work
  236. than genres, which can probably be assigned using automated tools.
  237. But it really doesn't take long to create mix files, and you will find
  238. that the added flexibility is worth the effort.
  239. 5. Playlist optimization
  240. -------------------------
  241. When you create a mix featuring two artists, it is most likely that
  242. you would like to hear approximately the same number of tracks from
  243. each artist. But if, for example, you have 6 albums by artist A and
  244. only 2 by artist B, tracks by artist A will dominate the playlist
  245. Plait creates. As of Plait 1.2 there is a playlist optimizer which
  246. addresses this problem by balancing the playlist. It has other nice
  247. features as well.
  248. You need to enable the playlist balancer by setting a track count with
  249. the `--tracks` option; otherwise you get the old behavior where Plait
  250. selects all the tracks that match your hints. There are special
  251. symbolic track counts which control the behavior of the playlist
  252. balancer. Some examples will clarify:
  253. plait -l --mix "miles davis" "charles mingus" --tracks all
  254. This command creates a playlist with all the available tracks from
  255. Miles Davis and Charles Mingus. This is also the default behavior if
  256. you don't specify a track count.
  257. plait -l --mix "miles davis" "charles mingus" --tracks min
  258. This command determines the number of tracks in the smallest hint
  259. group and then creates a balanced playlist by selecting that number of
  260. tracks from each group. Some tracks from larger hint groups will be
  261. skipped.
  262. plait -l --mix "miles davis" "charles mingus" --tracks max
  263. This command determines the number of tracks in the largest hint group
  264. and then creates a balanced playlist by selecting that number of
  265. tracks from each group. Some tracks from smaller hint groups will be
  266. repeated.
  267. plait -l --mix "miles davis" "charles mingus" --tracks avg
  268. This command determines the average number of tracks per group and
  269. then creates a balanced playlist by selecting that number of tracks
  270. from each group. Some tracks may be skipped and some tracks may be
  271. repeated.
  272. plait -l --mix "miles davis" "charles mingus" --tracks 20
  273. This command creates a balanced playlist with approximately 20 tracks.
  274. Tracks may be skipped or repeated depending on the particular count
  275. you specify and the number of tracks in the source playlist.
  276. Because Plait is designed to create unique playlists every time you
  277. run it, there is a lot of random fudge in the algorithm that balances
  278. playlists. The track counts you specify are just goals; they are
  279. translated into a probability that tracks from each group will be
  280. selected and this is combined with a random number to determine
  281. whether each track is selected. As a result, the playlist will
  282. contain a number of tracks close to the goal you specify but not
  283. necessarily exactly the same.
  284. #### Weighting the balance
  285. It's not always the case that you want to hear exactly equal amounts
  286. of music from each artist, and Plait provides a simple way to weight
  287. the balance when you don't, by repeating hints. The following command
  288. creates a mix with more tracks by Miles Davis than John Coltrane:
  289. plait -l --mix davis davis coltrane --tracks 15
  290. This sets a 2:1 ratio between Miles Davis tracks and John Coltrane
  291. tracks as a goal. Depending on the content of the source playlist,
  292. the goal may or may not be achieved exactly. Tracks will not be
  293. repeated in order to achieve the goal; the effect of repeating hints
  294. is just to give each track a "second chance" in the case where it is
  295. not printed the first time it matches a hint.
  296. This technique can be used to generate a playlist with a featured
  297. artist or featured album, for example
  298. plait -l --mixfile jazz 58 58 --tracks 30 --stripe
  299. This command creates a playlist with a variety of Jazz tracks, but
  300. featuring the album "'58 Sessions" by Miles Davis.
  301. #### Patterns
  302. The playlist optimizer also allows you to order the tracks in the
  303. playlist according to one of several patterns:
  304. plait -l --mix "miles davis" "charles mingus" --tracks 15 --sort
  305. The --sort option causes the tracks to appear in sorted order
  306. plait -l --mix "miles davis" "charles mingus" --tracks 15 --stripe
  307. The --stripe option picks one track matching hint a and then one track
  308. matching hint b, in an alternating pattern. Within the stripes, the
  309. tracks appear in sorted order.
  310. plait -l --mix "miles davis" "charles mingus" --tracks 15 --stripe2
  311. --stripe2 is similar to --stripe, but within the stripes the tracks
  312. appear in random order.
  313. plait -l --mix "miles davis" "charles mingus" --tracks 15 --fade
  314. The --fade option arranges the tracks matching each hint according to
  315. a gaussian distribution. The effect is that tracks matching each hint
  316. are clustered around a certain position in the playlist and appear
  317. less frequently as you move away from that position. Thus each
  318. section of the playlist focuses on one artist, but there are no rigid
  319. boundaries between the sections.
  320. plait -l --mix "miles davis" "charles mingus" --tracks 15 --random
  321. In this case tracks are arranged randomly.
  322. plait -l --mix "miles davis" "charles mingus" --tracks 15 --group
  323. The --group option groups the tracks by hint and shuffles randomly
  324. within each group.
  325. #### Target devices
  326. The final new feature of the playlist optimizer is intended to help
  327. people with a mixture of lossy and lossless encodings in their music
  328. libraries. It filters the playlist so that the encoding types you
  329. specify are either preferred or used exclusively, allowing you to
  330. create playlists that are suitable for a variety of target devices,
  331. including Hi-Fi stereos, disk-based portable music players, and
  332. flash-based portable music players. Examples:
  333. plait doors --device hifi
  334. This command selects tracks in both lossless and lossy formats. If a
  335. given track is available in more than one format, the lossless
  336. encoding is preferred. It is suitable for a home stereo with high
  337. quality audio. This is also the default device.
  338. plait doors --device medium
  339. This command selects tracks in both lossless and lossy formats. If a
  340. given track is available in more than one format, the lossy
  341. encoding is preferred. It is suitable for a disk-based portable music
  342. player.
  343. plait doors --device compact
  344. This command selects tracks in the mp3 format only. It is suitable
  345. for a flash-based portable music player like the iPod Shuffle.
  346. You can define your own target devices or change the default device in
  347. the config file. See section 10.
  348. In all cases, two files are considered to be the same track in
  349. different formats if the file paths are identical except for the
  350. extension. Thus the following two files are considered to be the same
  351. track in two different formats:
  352. /music/Miles Davis/Kind of Blue/Blue in Green.wav
  353. /music/Miles Davis/Kind of Blue/Blue in Green.mp3
  354. The following two files are not considered to be the same track in two
  355. different formats:
  356. /music/WAV/Miles Davis/Kind of Blue/Blue in Green.wav
  357. /music/MP3/Miles Davis/Kind of Blue/Blue in Green.mp3
  358. 6. Options
  359. -----------
  360. These options provide finer control over the music you play:
  361. ### --list, -l
  362. Learning to use hints involves trial and error. The `--list` option
  363. facilitates this by allowing you to see what songs a hint will play
  364. without actually playing them. Its use is self-explanatory. If you
  365. like the songs listed, you don't have to run the query again to play
  366. them. Simply typing
  367. plait
  368. without any hints plays the list returned by the last query.
  369. ### --queue, -q
  370. Normally the songs found by a `plait` command will play instantly,
  371. interrupting whatever was playing when you typed the command. If you
  372. want the songs to be added to the play list, use `--queue`. They will
  373. begin playing after the previous play list completes (mpg123 and
  374. mpg321 do not support queuing, but Plaiter, which is a front end to
  375. those programs, supports queuing and several more features.)
  376. ### --random, -r
  377. By default, songs are sorted by file path. If your music library is
  378. organized by artist, album, and title, your playlists will be
  379. organized the same way. If your song names are preceded by track
  380. numbers, they will play in album order. `--random` is for those times
  381. when you want a little variety. It shuffles the play list before
  382. sending it to your music player.
  383. ### --sort
  384. Plays tracks in sorted order. --sort is also the default.
  385. ### --stripe
  386. Arranges tracks in an alternating pattern with one track matching hint
  387. a, followed by one track matching hint b, and so on until all of the
  388. hints have been used; then the pattern repeats. Within the stripes,
  389. tracks appear in sorted order. This option does not apply to stream
  390. queries.
  391. ### --stripe2
  392. Arranges tracks in an alternating pattern with one track matching hint
  393. a, followed by one track matching hint b, and so on until all of the
  394. hints have been used; then the pattern repeats. Within the stripes,
  395. tracks appear in random order. The hints themselves are also
  396. shuffled, so you get a different pattern every time. This option does
  397. not apply to stream queries.
  398. ### --fade
  399. Clusters the tracks matching each hint around a particular position in
  400. the playlist, in a gaussian distribution. Thus each section of the
  401. playlist is focused on tracks matching one hint, but there are no
  402. rigid boundaries between the sections. Within each cluster, tracks
  403. are distributed randomly. This option does not apply to stream
  404. queries.
  405. ### --group
  406. Groups tracks by hint. Within hint groups, tracks appear in random
  407. order. This option does not apply to stream queries.
  408. ### --stream, -s
  409. Plays Shoutcast radio streams (see Section 3). Examples:
  410. plait --stream --random --tracks 5 salsa
  411. plait --stream kplu
  412. plait --stream chinese
  413. plait --stream --random reggaeton
  414. ### --tracks, -t
  415. Normally, Plait plays at most ten radio stations at a time, or an
  416. unlimited number of tracks. More than that and your music player will
  417. freeze for a while, which can seem broken. This option allows you to
  418. override the default values. For example
  419. plait --mix --tracks 10 "nick cave" "nick drake"
  420. plait --stream --tracks 20 industrial
  421. As of Plait 1.2, this option behaves differently depending on whether
  422. or not you are doing a stream query. For stream queries, the track
  423. count must be a number and it is a simple limit on the number of
  424. stations that will be selected.
  425. For library queries, the track count is a goal for the playlist
  426. balancer. In addition to particular numbers, there are symbolic track
  427. counts which control the behavior of the balancer, including min, max,
  428. avg, and all. See Section 5.
  429. ### --mix, -m
  430. This option selects songs which match *any* of the hints you provide
  431. rather than *all* of them. As an example,
  432. plait --mix "broun fellinis" "stanton moore" motherbug
  433. creates a play list with tracks by three bands. This option does not
  434. effect negative assertions.
  435. ### --mixfile, -f
  436. This option causes Plait to read hints from a file. Tracks are then
  437. selected from the music library just as if you had typed the hints on
  438. the command line with the `--mix` option. See Section 4. You can use
  439. this option multiple times to specify more than one mix file:
  440. plait -f punk -f rock
  441. plait --mixfile punk --mixfile rock
  442. Just as `--mixfile` causes Plait to read hints from a file, the `as`
  443. keyword causes Plait to write hints to a file, for example:
  444. plait "neil young" "john hiatt" "nick drake" "john cale" \
  445. as folkrock
  446. In naming mix files, it is best not to use spaces. You can force
  447. Plait to accept a mix file with a space in its name by enclosing the
  448. name in quote marks, but in this case Plait will just replace the
  449. space with a dash. So
  450. plait --mix belafonte strummer as "calypso punk"
  451. will actually create a mix file named "calypso-punk". The same
  452. logic applies to the --mixfile option, so
  453. plait --mixfile "calypso punk"
  454. will correctly find the file you created. The only time you need to
  455. be aware of this rule is when you create mix files by hand--don't use
  456. spaces in their names.
  457. ### --device, -d
  458. This option specifies a target device for the playlist. The target
  459. device determines what kinds of files will be selected or preferred.
  460. There are three predefined target devices: "hifi" accepts all file
  461. types but prefers lossless encodings when a given track is available
  462. in more than one encoding; "medium" accepts all file types but prefers
  463. lossy; and "compact" accepts lossy encodings (mp3) only. It is
  464. possible to define your own target devices; see the section on
  465. customization.
  466. ### --cache, -c
  467. You need to run `plait` with this option whenever the contents of your
  468. music directory changes. Plait will rescan the entire music directory
  469. and find every new piece of music. Keep in mind that each guest
  470. configuration has its own cache. As of Plait 0.53 this option has an
  471. optional directory argument which causes the rescanning to be
  472. restricted to a subdirectory of your music library, useful for doing a
  473. quick update when you have added, renamed, or deleted music by a
  474. single artist. For example, if your music directory is /music,
  475. plait -c "David Kane Quartet"
  476. will rescan only the `/music/David Kane Quartet` directory. It only
  477. takes about a minute to scan a 3,000 track music library, so if you
  478. lose track of which directories you have scanned, you may simply want
  479. to rescan everything.
  480. Important note: if you rename an artist or album, you may have to run
  481. two cache commands to register the change correctly. If, for example,
  482. you moved music by the band R.E.M from the directory R.E.M to the
  483. directory REM, you would run the commands
  484. plait -c R.E.M
  485. plait -c REM
  486. The first command will delete old cache entries that point to songs
  487. which no longer exist. The second command will register the songs in
  488. their new location.
  489. ### --guest, -g
  490. This option provides support for multiple, named configurations. The
  491. main reason you would want this is that each configuration can have a
  492. different music directory. So if a friend has a music collection that
  493. is accessible on your LAN, he will be able to play his music from your
  494. computer. To use this feature, just provide a guest name, for example
  495. plait --guest mypal "einsturzende neubauten"
  496. The first time you use a new guest name, Plait will ask for the
  497. location of that guest's music directory. Subsequently, the location
  498. will be remembered. It is up to you to mount the guest music
  499. directory, if that is necessary. This feature should be particularly
  500. useful if you have a VPN set up, but I have not had a chance to test
  501. that.
  502. When you use a guest configuration you also get the guest's mix files
  503. (and lose your own mix files temporarily). It is done this way
  504. because mix files tend to be compatible with the collection for which
  505. they were created.
  506. ### --platform
  507. This option allows you to temporarily override the default platform.
  508. The single argument can be any of the values allowed for the variable
  509. PLATFORM.
  510. ### --coverart
  511. This option allows you to temporarily override the cover art setting.
  512. "--coverart 1" causes cover art to be located on the Amazon.com web
  513. site when creating XSPF playlists. "--coverart 0" turns off this
  514. feature.
  515. ### --interactive, -i
  516. This option selects interactive mode, in which each track or station
  517. in the playlist is presented for you to vote yes or no on. When
  518. editing tracks, the available responses are:
  519. * y or yes: play this track
  520. * n or no: don't play this track
  521. * Y or Yes: play this track and all remaining tracks
  522. * N or No: don't play this track or any of the remaining tracks
  523. * u or up: move up one level in the hierarchy (from tracks
  524. to albums, for example).
  525. * d or down: move down one level in the hierarchy
  526. * /: search forward
  527. By moving up one or two levels you can vote on albums or artists all
  528. at once. When searching, you may enter a search term immediately
  529. after the slash. A slash by itself repeats the prior search. If
  530. there was no prior search you will be prompted for a search term.
  531. For the purpose of moving through the hierarchy, the character "/" is
  532. used to separate the levels. If your music library is laid out
  533. differently, you can set this to something else in the config file,
  534. for example,
  535. LEVELSEP=" - "
  536. In more complex cases, you may want to use a regular expression, for
  537. example,
  538. LEVELSEP="(/| - )"
  539. For display purposes, the "/" character will be used as the separator,
  540. but the regular expression will be used internally.
  541. When editing radio streams, the available responses are:
  542. * y or yes: play this stream
  543. * n or no: don't play this stream
  544. * Y or Yes: play this stream and all remaining streams
  545. * N or No: don't play this stream or any of the remaining streams
  546. * /: search forward
  547. Plait does its best to present a helpful description of each stream,
  548. but sometimes the Shoutcast web page will outwit Plait's regular
  549. expression-fu and you will see HTML gunk in the description.
  550. ### --play
  551. This option forwards the command "play" to the music player.
  552. ### --pause
  553. This option forwards the command "pause" to the music player.
  554. ### --stop
  555. This option forwards the command "stop" to the music player.
  556. ### --next
  557. This option forwards the command "next track" to the music player.
  558. ### --prev
  559. This option forwards the command "previous track" to the music player.
  560. ### --install
  561. This option installs Plait. You will normally need to do this only
  562. once, but it may also come in handy if Plait stops working because an
  563. important file is deleted. To do a complete reinstall, run this
  564. command from the install directory. You should run this option as
  565. root, using the `su` or `sudo` command.
  566. ### --uninstall
  567. This option uninstalls Plait. It is up to you to uninstall any
  568. prerequisites you had to install to make it work, if you don't want
  569. them anymore. If you installed Plait as root, you should run this
  570. option as root, using the `su` or `sudo` command.
  571. ### --help
  572. Shows brief help text.
  573. ### --version
  574. Shows information about the version of `plait` you are using, the
  575. license, and the author.
  576. 7. Advanced hinting
  577. --------------------
  578. Plait hints are actually extended regular expressions that will be
  579. executed by a `grep` command, which fact enables certain advanced
  580. queries. If you are familiar with regular expressions, some examples
  581. have probably occurred to you already. This section provides some
  582. ideas for the uninitiated.
  583. Simplicity is one of Plait's goals and as a result a division is drawn
  584. between simple queries, which include several hints that must all be
  585. matched, usually narrowing the results to a song or an album, and mix
  586. queries, which match any of their hints. But sometimes you would like
  587. a query which combines a little of both. For example, what if you
  588. want to hear "Solitude" by Billie Holiday (but not by Marc Ribot) and
  589. "Walk On" by Neil Young (but not by U2). One solution is to use two
  590. queries:
  591. plait billie solitude
  592. plait -q "walk on" neil
  593. However, there is a one line solution which depends on the fact that
  594. in regular expressions, the string ".*" matches anything. By
  595. exploiting this fact we can combine two hints into one complex hint.
  596. The resulting command is
  597. plait --mix "billie.*solitude" "neil.*walk on"
  598. In this way the "and" part of each query is built into a single hint
  599. and then the two complex hints are "or"-ed together with the `--mix`
  600. option. A variation on this idea is to combine the "or" parts of a
  601. query into a complex hint and then "and" it with another hint. For
  602. example, the following query plays three of my favorite tracks by
  603. Charlie Hunter:
  604. plait charlie "flau|dersu|revo"
  605. The fact that ".*" means "anything" is also useful if you are simply
  606. looking for a way to play a little of everything from your
  607. collection. For example, the following query plays 17 random tracks:
  608. plait --tracks 17 ".*" --random
  609. Some of the more interesting regular expressions will rely on the
  610. naming conventions you use in your music library. Here's one that
  611. works if your tracks are numbered. It will play the first two tracks
  612. of each John Coltrane album in a collection:
  613. plait coltrane "0[1-2]"
  614. #### Eponyms
  615. The fact that Plait uses whole path matching occasionally results in
  616. ambiguous hints when albums and songs are named eponymously. However,
  617. it is generally easy to come up with a precise hint with a little
  618. thought. The following suggestions assume that your music library is
  619. organized by Artist/Album/Song, but similar techniques would apply to
  620. other layouts. An example of an album and song with the same title is
  621. "Walk On" by John Hiatt. Here the trick is to match the path
  622. separator, in order to pick the album, or the dot before the file
  623. type, in order to pick the song:
  624. plait "walk on/" # the album
  625. plait "walk on[.]" # the song
  626. The brackets are necessary around the dot because dot is a regular
  627. expression matching any single character. The brackets tell Plait
  628. that we really mean a literal dot.
  629. Distinguishing an eponymous album from the artist is a little trickier
  630. because they will both end with the path separator. For example,
  631. Charlie Hunter has a self-titled album which appears in my music
  632. collection as
  633. /music/Charlie Hunter/Charlie Hunter/
  634. Typing `plait "charlie hunter"` will give me everything by that
  635. artist, not just the album I am interested in. In this case the
  636. secret is to match a combination of artist and title which is unique
  637. to the album "Charlie Hunter," for example
  638. plait "Charlie Hunter/Charlie Hunter"
  639. or just
  640. plait "Hunter/Charlie"
  641. (or `plait ter/cha` for the terse-minded).
  642. #### Using precise hints
  643. Many of the examples in this document use a relaxed form of hinting
  644. which is convenient and easy. Most of the time hints like these will
  645. "just work". Every once in a while, though, this approach breaks
  646. down. For example,
  647. plait miles
  648. may get you
  649. /music/Byrds/Eight Miles High
  650. /music/Who/I Can See for Miles
  651. rather than the Miles Davis music you might have been looking for.
  652. Likewise,
  653. plait rem
  654. may get you
  655. /music/Talking Heads/Remain in Light
  656. rather than music by the band R.E.M. In cases like this you should
  657. just use a more precise hint, ie
  658. plait "/miles davis/"
  659. or
  660. plait /rem/
  661. 8. Installation
  662. ----------------
  663. Since Plait is glue ware, it has several dependencies. Follow these
  664. instructions to make it all work.
  665. ### Uninstallation
  666. As of Plait 1.5.2, it is possible to install Plait to a directory of
  667. your choice. Since this could lead to a situation where you have
  668. multiple versions of Plait installed in different directories, it's a
  669. good idea to uninstall any old versions of Plait prior to upgrading.
  670. But if you know you are installing to the same directory as the old
  671. version of Plait, this isn't really necessary.
  672. ### GNU/Linux prerequisites
  673. On GNU/Linux, Plait works with ogg123, mpg123, mpg321, Xmms, Beep
  674. Media Player, or amaroK. If you are using Xmms, xmms-shell is also
  675. required. Installation varies depending on your distro. Be sure to
  676. install the package esound if you want to play via esd.
  677. Xmms, Beep Media Player, or amaroK will be used if they are present.
  678. If not, Plaiter will be used as a front end to any command line
  679. players that are present. Otherwise Plait will work in "list only"
  680. mode unless you configure your own player.
  681. ### Finishing up (all operating systems)
  682. You now have all the prerequisites to run Plait. The last step is
  683. installing Plait itself:
  684. * Untar the package:
  685. tar xvzf plait-x.xx.tar.gz
  686. cd plait
  687. * Tell `plait` to install itself. You may run this command as a
  688. non-root user, in which case Plait will default to installing in
  689. your home directory; you may run it as root, in which case Plait
  690. will default to installing in /usr/local; or you may set the install
  691. directory to anything you like by providing an argument. Examples:
  692. su -c "./plait --install"
  693. or
  694. sudo ./plait --install
  695. or
  696. ./plait --install
  697. or
  698. sudo ./plait --install /usr
  699. If you install Plait as a non-root user, you may have to add ~/bin to
  700. your path.
  701. Plait is now ready to run. The first time you run it, Plait will do
  702. some additional self-installation which involves asking for the
  703. location of your music directory. You only have to do this once.
  704. ### Setting up for XSPF
  705. If you want to use the XSPF web publishing feature, you will need to
  706. install the XSPF Web Music Player
  707. (http://musicplayer.sourceforge.net). Download and unpack the player
  708. from that address and then copy the file xspf_player.swf to
  709. ~/.plait/xspf.
  710. If your music library is located on a web server, you also need to set
  711. the variable BASEURL, for example:
  712. BASEURL=http://www.example.com/mp3/
  713. Otherwise, leave BASEURL set to the empty string.
  714. If your music directory is laid out as Artist/Album/Song, you're all
  715. set. Otherwise, you may need to set the three variables ARTISTIDX,
  716. ALBUMIDX, and SONGIDX in the config file. For Example, if your music
  717. directory is laid out as Artist/Year/Album/Song, set
  718. ARTISTIDX=1
  719. ALBUMIDX=3
  720. SONGIDX=4
  721. If your music directory is laid out as Artist/Artist - Album - Song,
  722. set
  723. LEVELSEP="(/| - )"
  724. ARTISTIDX=1
  725. ALBUMIDX=3
  726. SONGIDX=4
  727. 9. Uninstallation
  728. ------------------
  729. If you installed Plait as root, you must be root to uninstall it;
  730. otherwise you must be the same user as you were during installation.
  731. Type
  732. su -c "plait --uninstall"
  733. or
  734. sudo plait --uninstall
  735. or just
  736. plait --uninstall
  737. to uninstall Plait. See the instructions that came with gen_com if
  738. you want to remove that plugin. To remove wget, gawk or findutils,
  739. follow the package removal technique for Fink, as appropriate. If
  740. you are updating Plait, and you decide to install it into a different
  741. directory this time, uninstall the old version before installing the
  742. new one. Otherwise two versions of Plait will be installed and you
  743. can't be installed and you can't be sure which one will run.
  744. 10. Customization
  745. ------------------
  746. There are a few changes you can make to ~/.plait/config to customize
  747. the behavior of Plait.
  748. #### File types
  749. By default Plait looks for files of type mp3, wav, aif, ogg and flac.
  750. You can change this by setting the variable TYPES, for example:
  751. TYPES=".ogg .mp3 .flac"
  752. You may need to run `plait --cache` to rebuild the cache after
  753. changing the file types.
  754. As of Plait 1.2, you are advised to set the variable TYPES once to a
  755. very broad set of file types, and then use target devices to customize
  756. your playlists for different devices. You can either redefine one of
  757. the built-in target devices, or define a new one. For example, to
  758. define a target device that supports the same file types as an iPod,
  759. add the following line to the config file:
  760. ipod="m4a M4A mp3 MP3 wav WAV"
  761. In contrast to the TYPES variable, with devices you don't include the
  762. dot in the file extension, and you must repeat each extension twice,
  763. in upper and lower case. In this list, order is important; thus the
  764. ipod device will prefer mp3 files to wav files.
  765. To use this device to build a playlist, select it on the command line:
  766. plait britney --device ipod
  767. You can also set the default device in the config file:
  768. DEVICE="$ipod"
  769. Important note: if you redefine the default device (hifi), you should
  770. then reassign DEVICE to it in the config file, ie:
  771. hifi="wav WAV flac FLAC"
  772. DEVICE="$hifi"
  773. Otherwise DEVICE will continue to have the old value of hifi from
  774. before it was redefined.
  775. #### Alternate players
  776. Although there is a default player on each operating system, some OSs
  777. support several players. You can pick something besides the default
  778. by setting the variable PLATFORM, for example:
  779. PLATFORM=linux-plaiter
  780. The currently supported platforms are: linux-xmms,
  781. linux-beep-media-player, linux-amarok, linux-mpg123, linux-mpg123-esd,
  782. linux-amarok, linux-mpg123, linux-mpg123-esd, linux-mpg321,
  783. linux-mpg321, linux-mpg321-esd, linux-ogg123, linux-ogg123-esd,
  784. linux-plaiter, any-xspf and any-xspf-copy. In the interest of
  785. accuracy, there are also "unix-" synonyms for all the "linux-"
  786. players. The "esd" platforms play via the Enlightened Sound Daemon,
  787. which can stream audio across the network to an esd server. You
  788. specify which server by setting ESPEAKER, for example:
  789. ESPEAKER=192.168.1.2:16001
  790. See README.plaiter for information on Plaiter, which is the ideal
  791. platform choice if you currently use a command line player like
  792. mpg123.
  793. 11. XSPF Playlists
  794. -------------------
  795. Plait can generate a complete web site with an embedded MP3 playlist,
  796. including an XSPF playlist, a web page that embeds the XSPF Web Music
  797. Player (http://musicplayer.sourceforge.net), and MP3 files.
  798. The steps are as follows:
  799. 1. Download and unpack the web music player from the site above. Copy
  800. the file xspf_player.swf to ~/.plait/xspf.
  801. 2. Customize the file /usr/share/plait/playlist.html, if you like. It
  802. is a template file in which the special text string "%TITLE%" will
  803. be replaced by the playlist title generated automatically by Plait.
  804. 3. Set the variable BASEURL appropriately in the config file (see
  805. below). You may also need to set the variables ARTISTIDX,
  806. ALBUMIDX, and SONGIDX. See the section on installation.
  807. 4. Run an appropriate Plait command to generate a playlist (see
  808. below).
  809. 5. Upload the directory ~/.plait/xspf to a new directory on your web
  810. server.
  811. 6. Test the playlist by loading the file playlist.html from the upload
  812. directory into your browser.
  813. The Plait command you run depends on where your music library is
  814. located: if it is located on your web server where MP3 files can be
  815. loaded via a URL, the MP3s can be accessed in place. In this case,
  816. set the variable BASEURL in the Plait config file to the base address
  817. of your MP3 directory, for example
  818. BASEURL=http://www.example.com/mp3/
  819. Then generate a playlist with a command like the following:
  820. plait "Dire Straits" --tracks 7 --platform any-xspf --device compact --coverart 1
  821. and upload the directory ~/.plait/xspf to your web server. The flag
  822. "--coverart 1" is optional and causes Plait to look up album cover art
  823. on Amazon. You can turn this feature on permanently by setting
  824. COVERART=1
  825. in the config file (in which case you can turn it off temporarily with
  826. the flag "--coverart 0").
  827. If your music library is not on a web server, you will need to upload
  828. the MP3 files in the playlist to your server as well. In that case,
  829. leave BASEURL set to the empty string. Then generate a playlist with
  830. a command like the following:
  831. plait "Dire Straits" --tracks 7 --platform any-xspf-copy --device compact
  832. This form of the command actually copies MP3 files into the directory
  833. ~/.plait/xspf, which you then upload. You may want to clean old MP3
  834. files out of this directory periodically to avoid unnecessary
  835. uploads.
  836. Of course, you can always pick and choose which files to upload
  837. depending upon your application. The file playlist.html can be used
  838. as an example if you prefer to embed the playlist in a preexisting web
  839. page.
  840. 12. Bugs
  841. ---------
  842. Plait does a poor job of handling file names with various accent
  843. characters. On some platforms you should be able to play these files,
  844. but it is still difficult to search for them, because Plait doesn't know
  845. how to ignore accent marks when making string comparisons. The problem
  846. does not just involve comparing characters that could be considered
  847. equivalent in the current locale, which would be resolved by equivalence
  848. classes; here the problem is to compare characters which could be considered
  849. equivalent in any locale. There is a version of `agrep` for OS/2 and
  850. Windows which can do this type of accent-insensitive comparison, so if
  851. you are interested in this problem, bug the authors of `agrep` about
  852. back-porting this feature to UNIX.
  853. 13. What's next
  854. ----------------
  855. Who knows?
  856. Copyright (c) 2005-2008 by Stephen Jungels
  857. Copyright (c) 2017 by orbea