An open API service indexing awesome lists of open source software.

https://github.com/darnfish/use-tx-6

React hooks for accessing teenage engineering TX-6 inputs
https://github.com/darnfish/use-tx-6

react react-hooks teenage-engineering tx-6

Last synced: about 1 month ago
JSON representation

React hooks for accessing teenage engineering TX-6 inputs

Awesome Lists containing this project

README

          

# useTX6
A set of React hooks for interacting with teenage engineering TX-6 over BLE MIDI

## Installation
```
yarn add use-tx-6
```

## Usage
The following demo will let you adjust the font size of the text using the slider for channel 1:
```tsx
import useTX6, { useTX6Attribute } from 'use-tx-6'

export default function App() {
const { connect, status, error } = useTX6()

const { progress } = useTX6Attribute('input1.slider')

switch(status) {
case 'disconnected':
return (
<>
connect to TX-6
{error && (

error connecting to TX-6: {error.toString()}


)}
>
)
case 'connecting':
return (

connecting to TX-6...


)
}

return (
connected to TX-6
)
}
```

If you want to access multiple attributes at the same time, use `useTX6Attributes`—this is useful for the EQ knobs:
```tsx
const [{ progress: eq1 }, { progress: eq2 }, { progress: eq3 }] = useTX6Attributes(['input1.eq1', 'input1.eq2', 'input1.eq3'])
```

## Thanks
Inspired by [this demo](https://twitter.com/hturan/status/1523702486258782208) by [@hturan@twitter.com](https://twitter.com/hturan).

## License
MIT