Skip to content

Commit

Permalink
Update Readme and CLI (#760)
Browse files Browse the repository at this point in the history
* forgot to install publisher
* update readme, demo, and new
* clippy
  • Loading branch information
xasopheno committed Nov 4, 2022
1 parent 65315ee commit acd8798
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 38 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ jobs:
matrix:
job:
- { os: macos-latest, target: x86_64-apple-darwin, use-cross: false }
# - { os: ubuntu-latest, target: x86_64-unknown-linux-musl, use-cross: true }
# - { os: ubuntu-latest, target: i686-unknown-linux-gnu, use-cross: true }
# - { os: ubuntu-latest, target: arm-unknown-linux-gnueabihf, use-cross: true }
# - { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, use-cross: true }

steps:
- name: 🔍 GH_TOKEN
Expand Down
57 changes: 35 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ A language for binaural, microtonal composition built in Rust.

<em>Make cool sounds. Impress your friends/pets/plants.</em>

![WereSoCool](../main/imgs/application.png)
**WereSoCool** is a programming language for composing microtonal music geometrically. This language doesn't assume familiarity with either microtonal music or computer programming, but experience with either will certainly help.

## Listen:
Watch/Listen to some examples from the language [here](https://www.weresocool.org/play/arcs).
**WereSoCool** is a programming language for composing microtonal music geometrically. This language doesn't require familiarity with either microtonal music or computer programming, but experience with either will certainly help.

## Installation:
### Macos:

`brew install macos`
`brew install weresocool`

### Arch Linux:

Availabe on the AUR here.
Available on the AUR [here](https://aur.archlinux.org/packages/weresocool).

### Cargo:

Expand All @@ -27,13 +23,40 @@ WereSoCool can be installed via on any unix system via cargo
`cargo install weresocool`

### Windows
This does not currently work on Windows...<em>sad panda</em>. If you're interested in using this software on a Windows machine, reach out and I'll work on it.

This does not currently work on Windows 😔. If you're interested in using this software on a Windows machine, reach out and I'll work on it.

### WereSoCool CLI
```
USAGE:
weresocool [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
new new [filename.socool]
play play [filename.socool]
watch watch [filename.socool]
demo hear a cool sound
print print [filename.socool] [flags]
-a, --all print all file types
--csv print csv file
--json print csv file
--mp3 print mp3 file
--oggvorbis print oggvorbis file
-s, --sound print sound file
--stems print stems as a zip file
--wav print wav file
help help of the given subcommand(s)
```

## Development:

### Setup
You'll need Rust. Rust is a great language. Install it with [Rustup](https://www.rust-lang.org/en-US/install.html).
Rust: Rust is a great language. Install it with [Rustup](https://www.rust-lang.org/en-US/install.html).

Just: Commands are issued via [Just](https://github.com/casey/just).

You'll need also need to install the following packages:

Expand All @@ -47,20 +70,10 @@ You'll need also need to install the following packages:
`sudo apt-get portaudio pkg-config lame libmp3lame-dev rpm libasound2-dev vorbis-tools`

### Build
`make package`

## Run:
#### Linux
`make run`

#### Macos
`make run_osx`

#### Run with Dev Server
`make dev`
`just build`

## Run Tests:
`make test`
`just test`

## Special Thanks:
This wouldn't exist in a million years if it wasn't for Antonis Stampoulis'
Expand Down
4 changes: 2 additions & 2 deletions ast/src/generator/substitute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use weresocool_error::Error;
impl Substitute<Term> for GenOp {
fn substitute(
&self,
normal_form: &mut NormalForm,
_normal_form: &mut NormalForm,
defs: &mut Defs<Term>,
) -> Result<Term, Error> {
match self {
Expand All @@ -21,7 +21,7 @@ impl Substitute<Term> for GenOp {
}
GenOp::Const { .. } => Ok(Term::Gen(self.to_owned())),
GenOp::Taken { n, gen, seed } => {
let term = gen.substitute(normal_form, defs)?;
let term = gen.substitute(_normal_form, defs)?;
match term {
Term::Gen(gen) => Ok(Term::Gen(GenOp::Taken {
n: *n,
Expand Down
2 changes: 1 addition & 1 deletion demo.socool
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ f: 311.127, l: 1, g: 1, p: 0 }
{ f: 311.127, l: 1, g: 1/3, p: 0 }

thing1 = {
O[
Expand Down
4 changes: 2 additions & 2 deletions opmap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ where
if self.map.contains_key(k) {
self.map
.entry(k.to_owned())
.or_insert(vec![])
.or_default()
.extend(v.to_owned());
} else {
self.map.insert(k.to_owned(), v.to_owned());
Expand All @@ -28,7 +28,7 @@ where
}

pub fn insert(&mut self, k: &str, v: T) {
self.map.entry(k.to_owned()).or_insert(vec![]).push(v);
self.map.entry(k.to_owned()).or_default().push(v);
}

pub fn set(&mut self, k: &str, v: Vec<T>) {
Expand Down
13 changes: 7 additions & 6 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
use clap::{App, AppSettings, Arg, SubCommand};
const VERSION: &str = env!("CARGO_PKG_VERSION");

pub fn app() -> clap::App<'static, 'static> {
App::new("WereSoCool CLI")
.version("1.0")
.version(VERSION)
.author("Danny Meyer")
.about("Make cool sounds and impress your friends/pets/plants.")
.setting(AppSettings::ColoredHelp)
.subcommand(
SubCommand::with_name("new")
.help("new [filename.socool]")
.about("new [filename.socool]")
.arg(
Arg::with_name("file")
.multiple(false)
Expand All @@ -19,7 +20,7 @@ pub fn app() -> clap::App<'static, 'static> {
)
.subcommand(
SubCommand::with_name("play")
.help("play [filename.socool]")
.about("play [filename.socool]")
.arg(
Arg::with_name("file")
.multiple(false)
Expand All @@ -31,7 +32,7 @@ pub fn app() -> clap::App<'static, 'static> {
.subcommand(
SubCommand::with_name("watch")
.alias("dev")
.help("dev [filename.socool]")
.about("dev [filename.socool]")
.arg(
Arg::with_name("file")
.multiple(false)
Expand All @@ -40,10 +41,10 @@ pub fn app() -> clap::App<'static, 'static> {
.help("filename"),
),
)
.subcommand(SubCommand::with_name("demo").help("hear a cool sound"))
.subcommand(SubCommand::with_name("demo").about("hear a cool sound"))
.subcommand(
SubCommand::with_name("print")
.usage("weresocool print [filename.socool] [flags]")
.about("print [filename.socool] [flags]")
.arg(
Arg::with_name("output_dir")
.long("output_dir")
Expand Down
2 changes: 1 addition & 1 deletion src/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn new_socool_file(filename: String, working_path: PathBuf) -> Result<(), Error>
}

const DEFAULT_SOCOOL: &str = indoc! {"
{ f: 311.127, l: 1, g: 1, p: 0 }
{ f: 311.127, l: 1, g: 1/3, p: 0 }
thing1 = {
O[
Expand Down

0 comments on commit acd8798

Please sign in to comment.