Update READMEs with newer syntax
This commit is contained in:
parent
e649ea495e
commit
00812bb3a3
4 changed files with 29 additions and 25 deletions
|
@ -16,17 +16,17 @@ To access the REPL, simply run `cargo run`. You will need the [Rust toolchain in
|
||||||
|
|
||||||
All songs by artist `<artist>` (in your library), sorted by similarity to a random first song by the artist.
|
All songs by artist `<artist>` (in your library), sorted by similarity to a random first song by the artist.
|
||||||
```muss
|
```muss
|
||||||
files().(artist? like "<artist>")~(shuffle)~(advanced bliss_next);
|
files().(.artist? like "<artist>")~(~radio);
|
||||||
```
|
```
|
||||||
|
|
||||||
All songs with a `.flac` file extension (anywhere in their path -- not necessarily at the end).
|
All songs with a `.flac` file extension (anywhere in their path -- not necessarily at the end).
|
||||||
```muss
|
```muss
|
||||||
files().(filename? like ".flac");
|
files().(.filename? like ".flac");
|
||||||
```
|
```
|
||||||
|
|
||||||
All songs by artist `<artist1>` or `<artist2>`, sorted by similarity to a random first song by either artist.
|
All songs by artist `<artist1>` or `<artist2>`, sorted by similarity to a random first song by either artist.
|
||||||
```muss
|
```muss
|
||||||
files().(artist? like "<artist1>" || artist? like "<artist2>")~(shuffle)~(advanced bliss_next);
|
files().(.artist? like "<artist1>" || .artist? like "<artist2>")~(~radio);
|
||||||
```
|
```
|
||||||
|
|
||||||
### Bigger examples
|
### Bigger examples
|
||||||
|
@ -44,7 +44,7 @@ One day I'll add pretty REPL example pictures and some script files...
|
||||||
**I thought it would be fun**. I also wanted to be able to play my music without having to be at the whim of someone else's algorithm (and music), and playing just by album or artist was getting boring. Designing a language specifically for iteration seemed like a cool & novel way of doing it, too (though every approach is a novel approach for me).
|
**I thought it would be fun**. I also wanted to be able to play my music without having to be at the whim of someone else's algorithm (and music), and playing just by album or artist was getting boring. Designing a language specifically for iteration seemed like a cool & novel way of doing it, too (though every approach is a novel approach for me).
|
||||||
|
|
||||||
### What is Muss?
|
### What is Muss?
|
||||||
**Music Set Script (MuSS) is a language for describing a playlist of music.** It uses an (auto-generated) SQLite3 database for SQL queries and can also directly query the filesystem. Queries can be modified by using filters, functions, and sorters built-in to Muss (see interpreter's README.md).
|
**Music Set Script (MuSS) is a language for describing a playlist of music.** It can execute SQLite select clauses or directly query the filesystem. Queries can be modified by using filters, functions, and sorters built-in to Muss (see interpreter's README.md).
|
||||||
|
|
||||||
### Is Muss a scripting language?
|
### Is Muss a scripting language?
|
||||||
**Yes**. It evolved from a simple query language into something that can do arbitrary calculations. Whether it's Turing-complete is still unproven, but it's powerful enough for what I want it to do.
|
**Yes**. It evolved from a simple query language into something that can do arbitrary calculations. Whether it's Turing-complete is still unproven, but it's powerful enough for what I want it to do.
|
||||||
|
|
|
@ -43,23 +43,23 @@ Operations to reduce the items in an iterable: `iterable.(filter);`.
|
||||||
Filters are statements of the format `something.(predicate)`, where "something" is a variable name or another valid statement, and "predicate" is a valid filter predicate (see below).
|
Filters are statements of the format `something.(predicate)`, where "something" is a variable name or another valid statement, and "predicate" is a valid filter predicate (see below).
|
||||||
E.g. `files(folder="~/Music/", recursive=true).(title == "Romantic Traffic");` is valid filter syntax to filter all songs in the Music folder for songs named "Romantic Traffic" (probably just one song).
|
E.g. `files(folder="~/Music/", recursive=true).(title == "Romantic Traffic");` is valid filter syntax to filter all songs in the Music folder for songs named "Romantic Traffic" (probably just one song).
|
||||||
|
|
||||||
#### field == something
|
#### .field == something
|
||||||
|
|
||||||
#### field like something
|
#### .field like something
|
||||||
|
|
||||||
#### field unlike something
|
#### .field unlike something
|
||||||
|
|
||||||
#### field matches some_regex
|
#### .field matches some_regex
|
||||||
|
|
||||||
#### field != something
|
#### .field != something
|
||||||
|
|
||||||
#### field >= something
|
#### .field >= something
|
||||||
|
|
||||||
#### field > something
|
#### .field > something
|
||||||
|
|
||||||
#### field <= something
|
#### .field <= something
|
||||||
|
|
||||||
#### field < something -- e.g. `iterable.(title == "Romantic Traffic");`
|
#### .field < something -- e.g. `iterable.(.title == "Romantic Traffic");`
|
||||||
|
|
||||||
Compare all items, keeping only those that match the condition. Valid field names change depending on what information is available when the Item is populated, but usually title, artist, album, genre, track, filename are valid fields. Optionally, a ? or ! can be added to the end of the field name to skip items whose field is missing/incomparable, or keep all items whose field is missing/incomparable (respectively).
|
Compare all items, keeping only those that match the condition. Valid field names change depending on what information is available when the Item is populated, but usually title, artist, album, genre, track, filename are valid fields. Optionally, a ? or ! can be added to the end of the field name to skip items whose field is missing/incomparable, or keep all items whose field is missing/incomparable (respectively).
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ Matches all items
|
||||||
Replace items matching the filter with operation1 and replace items not matching the filter with operation2. The `else operation2` part may be omitted to preserve items not matching the filter. To perform operations with the current item, use the special variable `item`. The replacement filter may not contain || -- instead, use multiple filters chained together.
|
Replace items matching the filter with operation1 and replace items not matching the filter with operation2. The `else operation2` part may be omitted to preserve items not matching the filter. To perform operations with the current item, use the special variable `item`. The replacement filter may not contain || -- instead, use multiple filters chained together.
|
||||||
|
|
||||||
#### unique
|
#### unique
|
||||||
#### unique field -- e.g. `iterable.(unique title);`
|
#### unique field -- e.g. `iterable.(unique .title);`
|
||||||
|
|
||||||
Keep only items which are do not duplicate another item, or keep only items whoes specified field does not duplicate another item's same field. The first non-duplicated instance of an item is always the one that is kept.
|
Keep only items which are do not duplicate another item, or keep only items whoes specified field does not duplicate another item's same field. The first non-duplicated instance of an item is always the one that is kept.
|
||||||
|
|
||||||
|
@ -168,15 +168,19 @@ Iterate over count empty items. The items in this iterator have no fields (i.e.
|
||||||
### Sorters
|
### Sorters
|
||||||
Operations to sort the items in an iterable: `iterable~(sorter)` OR `iterable.sort(sorter)`.
|
Operations to sort the items in an iterable: `iterable~(sorter)` OR `iterable.sort(sorter)`.
|
||||||
|
|
||||||
#### field -- e.g. `iterable~(filename);`
|
#### .field -- e.g. `iterable~(.filename);`
|
||||||
|
|
||||||
Sort by an Item field. Valid field names change depending on what information is available when the Item is populated, but usually title, artist, album, genre, track, filename are valid fields. Items with a missing/incomparable fields will be sorted to the end.
|
Sort by an Item field. Valid field names change depending on what information is available when the Item is populated, but usually title, artist, album, genre, track, filename are valid fields. Items with a missing/incomparable fields will be sorted to the end.
|
||||||
|
|
||||||
#### shuffle
|
#### ~shuffle
|
||||||
#### random shuffle -- e.g. `iterable~(shuffle);`
|
#### random shuffle -- e.g. `iterable~(~shuffle);`
|
||||||
|
|
||||||
Shuffle the songs in the iterator. This is random for up to 2^16 items, and then the randomness degrades (but at that point you won't notice). The more verbose syntax is allowed in preparation for future randomisation strategies.
|
Shuffle the songs in the iterator. This is random for up to 2^16 items, and then the randomness degrades (but at that point you won't notice). The more verbose syntax is allowed in preparation for future randomisation strategies.
|
||||||
|
|
||||||
|
#### ~radio
|
||||||
|
#### ~radio qualifier -- e.g. `iterable~(~radio)`
|
||||||
|
Sort by musical similarity, starting with a random first song from the iterator. The optional qualifier may be `chroma`, `loudness`, `spectrum`, or `tempo`. When the qualifier is omitted, they are all considered for comparing audio similarity.
|
||||||
|
|
||||||
#### advanced bliss_first -- e.g. `iterable~(advanced bliss_first);`
|
#### advanced bliss_first -- e.g. `iterable~(advanced bliss_first);`
|
||||||
|
|
||||||
Sort by the distance (similarity) from the first song in the iterator. Songs which are more similar (lower distance) to the first song in the iterator will be placed closer to the first song, while less similar songs will be sorted to the end. This uses the [bliss music analyser](https://github.com/polochon-street/bliss-rs), which is a very slow operation and can cause music playback interruptions for large iterators. This requires the `advanced` feature to be enabled (without the feature enabled this is still valid syntax but doesn't change the order).
|
Sort by the distance (similarity) from the first song in the iterator. Songs which are more similar (lower distance) to the first song in the iterator will be placed closer to the first song, while less similar songs will be sorted to the end. This uses the [bliss music analyser](https://github.com/polochon-street/bliss-rs), which is a very slow operation and can cause music playback interruptions for large iterators. This requires the `advanced` feature to be enabled (without the feature enabled this is still valid syntax but doesn't change the order).
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# mps-m3u8
|
# muss-m3u8
|
||||||
|
|
||||||
Minimal CLI tool to generate a m3u8 playlist from a MPS file.
|
Minimal CLI tool to generate a m3u8 playlist from a Muss script.
|
||||||
This does not support playback, so it can run on any platform with a filesystem.
|
This does not support playback, so it can run on any platform with a filesystem.
|
||||||
Use `mps-m3u8 --help` for usage instructions.
|
Use `muss-m3u8 --help` for usage instructions.
|
||||||
|
|
||||||
|
|
||||||
License: LGPL-2.1-only OR GPL-2.0-or-later
|
License: LGPL-2.1-only OR GPL-3.0-only
|
||||||
|
|
|
@ -12,17 +12,17 @@
|
||||||
//!
|
//!
|
||||||
//! All songs by artist `<artist>` (in your library), sorted by similarity to a random first song by the artist.
|
//! All songs by artist `<artist>` (in your library), sorted by similarity to a random first song by the artist.
|
||||||
//! ```muss
|
//! ```muss
|
||||||
//! files().(artist? like "<artist>")~(shuffle)~(advanced bliss_next);
|
//! files().(.artist? like "<artist>")~(~radio);
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! All songs with a `.flac` file extension (anywhere in their path -- not necessarily at the end).
|
//! All songs with a `.flac` file extension (anywhere in their path -- not necessarily at the end).
|
||||||
//! ```muss
|
//! ```muss
|
||||||
//! files().(filename? like ".flac");
|
//! files().(.filename? like ".flac");
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! All songs by artist `<artist1>` or `<artist2>`, sorted by similarity to a random first song by either artist.
|
//! All songs by artist `<artist1>` or `<artist2>`, sorted by similarity to a random first song by either artist.
|
||||||
//! ```muss
|
//! ```muss
|
||||||
//! files().(artist? like "<artist1>" || artist? like "<artist2>")~(shuffle)~(advanced bliss_next);
|
//! files().(.artist? like "<artist1>" || .artist? like "<artist2>")~(~radio);
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! ## Bigger examples
|
//! ## Bigger examples
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
//! **I thought it would be fun**. I also wanted to be able to play my music without having to be at the whim of someone else's algorithm (and music), and playing just by album or artist was getting boring. Designing a language specifically for iteration seemed like a cool & novel way of doing it, too (though every approach is a novel approach for me).
|
//! **I thought it would be fun**. I also wanted to be able to play my music without having to be at the whim of someone else's algorithm (and music), and playing just by album or artist was getting boring. Designing a language specifically for iteration seemed like a cool & novel way of doing it, too (though every approach is a novel approach for me).
|
||||||
//!
|
//!
|
||||||
//! ## What is Muss?
|
//! ## What is Muss?
|
||||||
//! **Music Set Script (MuSS) is a language for describing a playlist of music.** It uses an (auto-generated) SQLite3 database for SQL queries and can also directly query the filesystem. Queries can be modified by using filters, functions, and sorters built-in to Muss (see interpreter's README.md).
|
//! **Music Set Script (MuSS) is a language for describing a playlist of music.** It can execute SQLite select clauses or directly query the filesystem. Queries can be modified by using filters, functions, and sorters built-in to Muss (see interpreter's README.md).
|
||||||
//!
|
//!
|
||||||
//! ## Is Muss a scripting language?
|
//! ## Is Muss a scripting language?
|
||||||
//! **Yes**. It evolved from a simple query language into something that can do arbitrary calculations. Whether it's Turing-complete is still unproven, but it's powerful enough for what I want it to do.
|
//! **Yes**. It evolved from a simple query language into something that can do arbitrary calculations. Whether it's Turing-complete is still unproven, but it's powerful enough for what I want it to do.
|
||||||
|
|
Loading…
Reference in a new issue