# binary-to-euclidean

> Returns an Euclidean rhythm pattern from a binary array

Latest version **1.0.1** (published 2023-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install binary-to-euclidean
pnpm add binary-to-euclidean
yarn add binary-to-euclidean
bun add binary-to-euclidean
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-10-11 |
| First published | 2023-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Killian Grant |
| Maintainers | naillik |

## Links

- npm: https://www.npmjs.com/package/binary-to-euclidean
- Repository: git@github.com:nailliK/binary-to-euclidean
- npm.io page: https://npm.io/package/binary-to-euclidean

## Recent versions

- 1.0.1 (latest) — 2023-10-11
- 1.0.0 — 2023-10-11

## README

# Binary Array To Euclidean Rhythm Converter

This library provides utility functions to work with Euclidean Rhythms, specifically converting a binary sequence to its corresponding Euclidean Rhythm representation.

## Features

- Extract the number of steps, triggers, and rotation from a binary sequence.

## Installation

```bash
npm install binary-to-euclidean
yarn install binary-to-euclidean
```

## Usage

```js
import { binaryToEuclidean } from 'your-npm-package-name';

const sequence = [1, 0, 1, 0, 1, 0];
const rhythm = binaryToEuclidean(sequence);

console.log(rhythm);  // { steps: 6, triggers: 3, rotation: 2 }
```

## API
`binaryToEuclidean(sequence: number[]): EuclideanRhythm`

Converts a binary sequence to its corresponding Euclidean Rhythm representation.

### Parameters:
- `sequence`: An array of numbers where 1 represents a trigger, and 0 represents no trigger.

### Returns: 
- An object of type EuclideanRhythm containing:
  - `steps`: Total number of steps in the sequence.
  - `triggers`: Total number of triggers in the sequence.
  - `rotation`: The calculated rotation of the sequence.

## Contributing

If you have suggestions or want to contribute, feel free to open an issue or pull request.

## License

[MIT](https://mit-license.org/)

---
_Source: https://npm.io/package/binary-to-euclidean · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
