Skip to content

Commit

Permalink
add docs and fix copy
Browse files Browse the repository at this point in the history
  • Loading branch information
grindcode committed Dec 4, 2020
1 parent c97abc5 commit e60754a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2018"
authors = ["Isis T. Baulig <[email protected]>"]
license = "MIT/Apache-2.0"
repository = "https://github.com/grindcode/rhythms"
description = "Algorithmic pattern generation"
description = "A rhythmic pattern generation library"
keywords = ["pattern", "music", "euclidean", "rhythm", "no_std"]
readme = "README.md"

Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# rhythms

Rhythmic pattern generation in Rust. This projet is Work In Progress, and the API is subjective to change. Use at your own risk.
A rhythmic pattern generation library in Rust with `no_std` support.

By design, `rhythms` does not depend on `std`.
[Documentation](https://docs.rs/rhythms/)

[Release notes](https://github.com/grindcode/rhythms/releases)

## Work In Progress

This project is under development and the current API is subjective to change. Please use at your own risk.

## Example

```
use rhythms::Pattern;
let pattern = Pattern::new(4, 2, 0);
assert_eq!([true, false, true, false], pattern.as_slice());
// or
let mut pattern = Pattern::with_length(4);
pattern.pulses(2);
pattern.rotate(-1);
assert_eq!([false, true, false, true], pattern.as_slice());
```

## License

Expand Down
22 changes: 20 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
//! A WIP prototype for rhythmic pattern generation with `no_std` support.
//! A rhythmic pattern generation library with `no_std` support.
//!
//! This project is under development and the current API is subjective to change.
//! Please use at your own risk.
//!
//! ## Example
//!
//! ```
//! use rhythms::Pattern;
//!
//! let pattern = Pattern::new(4, 2, 0);
//! assert_eq!([true, false, true, false], pattern.as_slice());
//!
//! // or
//! let mut pattern = Pattern::with_length(4);
//! pattern.pulses(2);
//! pattern.rotate(-1);
//! assert_eq!([false, true, false, true], pattern.as_slice());
//! ```

#![no_std]

use smallvec::SmallVec;

/// The main building block for pattern generation
/// The main pattern building block
#[derive(Debug, Clone)]
pub struct Pattern {
steps: SmallVec<[bool; 64]>,
Expand Down

0 comments on commit e60754a

Please sign in to comment.