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
- Host: GitHub
- URL: https://github.com/darnfish/use-tx-6
- Owner: darnfish
- Created: 2023-01-09T17:42:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-17T00:11:56.000Z (over 3 years ago)
- Last Synced: 2025-10-21T01:45:45.998Z (8 months ago)
- Topics: react, react-hooks, teenage-engineering, tx-6
- Language: TypeScript
- Homepage:
- Size: 161 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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