audio-mixer-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +205 -0
- package/dist/choir-mixer-ui.js +1640 -0
- package/dist/choir-mixer-ui.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Choir Practice UI Components
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Audio Mixer UI Components
|
|
2
|
+
|
|
3
|
+
A Vue 3 component library for building audio mixer interfaces with musical navigation and control features.
|
|
4
|
+
Originally developed for a choir practice application, these components provide audio controls with responsive design and accessibility features.
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
|
|
8
|
+
- **Professional Audio Controls**: Custom sliders, buttons, and level meters with haptic feedback
|
|
9
|
+
- **Musical Navigation**: Bar/beat input, practice marks, tempo controls with bidirectional time mapping
|
|
10
|
+
- **Responsive Design**: Optimized layouts for mobile, tablet, and desktop
|
|
11
|
+
- **Event-Driven Architecture**: Clean separation between UI and audio engine
|
|
12
|
+
- **Accessibility Ready**: ARIA labels, keyboard navigation, screen reader support
|
|
13
|
+
- **Lightweight**: No heavy UI framework dependencies, just Vue 3
|
|
14
|
+
- **TypeScript Ready**: Full TypeScript definitions included
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install audio-mixer-ui
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```vue
|
|
25
|
+
<template>
|
|
26
|
+
<div class="app">
|
|
27
|
+
<MixerLayout>
|
|
28
|
+
<template #controls>
|
|
29
|
+
<MixerControls />
|
|
30
|
+
</template>
|
|
31
|
+
<template #parts>
|
|
32
|
+
<PartControl
|
|
33
|
+
v-for="part in parts"
|
|
34
|
+
:key="part.name"
|
|
35
|
+
:name="part.name"
|
|
36
|
+
v-model:volume="part.volume"
|
|
37
|
+
v-model:mute="part.mute"
|
|
38
|
+
v-model:solo="part.solo"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|
|
41
|
+
</MixerLayout>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup>
|
|
46
|
+
import {
|
|
47
|
+
MixerLayout,
|
|
48
|
+
MixerControls,
|
|
49
|
+
PartControl
|
|
50
|
+
} from 'audio-mixer-ui'
|
|
51
|
+
import { ref } from 'vue'
|
|
52
|
+
|
|
53
|
+
const parts = ref([
|
|
54
|
+
{ name: 'Soprano', volume: 0.8, mute: false, solo: false },
|
|
55
|
+
{ name: 'Alto', volume: 0.7, mute: false, solo: false },
|
|
56
|
+
{ name: 'Tenor', volume: 0.75, mute: false, solo: false },
|
|
57
|
+
{ name: 'Bass', volume: 0.8, mute: false, solo: false }
|
|
58
|
+
])
|
|
59
|
+
</script>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Core Components
|
|
63
|
+
|
|
64
|
+
### Layout Components
|
|
65
|
+
- **`MixerLayout`** - Main responsive container with flexible slot system
|
|
66
|
+
- **`MixerControls`** - Transport controls, master volume, and feature toggles
|
|
67
|
+
|
|
68
|
+
### Audio Controls
|
|
69
|
+
- **`AudioSlider`** - Professional audio fader with level indicators
|
|
70
|
+
- **`AudioButton`** - Responsive button with visual feedback
|
|
71
|
+
- **`PartControl`** - Complete part mixer (volume, mute, solo)
|
|
72
|
+
- **`TriState`** - Mute/Solo toggle control
|
|
73
|
+
|
|
74
|
+
### Musical Navigation
|
|
75
|
+
- **`BarInput`** - Bar number input with practice mark navigation
|
|
76
|
+
- **`TimeInput`** - Time position display and input
|
|
77
|
+
- **`SpeedInput`** - Playback speed control with percentage display
|
|
78
|
+
|
|
79
|
+
### Utilities
|
|
80
|
+
- **`BaseNumericInput`** - Foundation for all numeric inputs
|
|
81
|
+
- **`TitleText`** - Responsive title display
|
|
82
|
+
|
|
83
|
+
## State Management
|
|
84
|
+
|
|
85
|
+
The library integrates with Pinia stores for reactive state management:
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
// stores/audioState.js
|
|
89
|
+
export const useAudioStateStore = defineStore('audioState', {
|
|
90
|
+
state: () => ({
|
|
91
|
+
isPlaying: false,
|
|
92
|
+
currentTime: 0,
|
|
93
|
+
currentBar: 1,
|
|
94
|
+
currentBeat: 1,
|
|
95
|
+
masterVolume: 0.8
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Event System
|
|
101
|
+
|
|
102
|
+
Components emit semantic events rather than directly manipulating audio:
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<template>
|
|
106
|
+
<MixerControls @play="handlePlay" @stop="handleStop" @set-bar="handleSetBar" />
|
|
107
|
+
</template>
|
|
108
|
+
|
|
109
|
+
<script setup>
|
|
110
|
+
const handlePlay = () => {
|
|
111
|
+
// Start audio playback
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const handleSetBar = (barNumber) => {
|
|
115
|
+
// Navigate to specific bar
|
|
116
|
+
}
|
|
117
|
+
</script>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Musical Data Structure
|
|
121
|
+
|
|
122
|
+
The components expect musical timing data in this format:
|
|
123
|
+
|
|
124
|
+
```js
|
|
125
|
+
// Beat mapping array
|
|
126
|
+
const beats = [
|
|
127
|
+
{ bar: 1, beat: 1, repeat: 1, tempo: 80, time: 0, timeSig: 4 },
|
|
128
|
+
{ bar: 1, beat: 2, repeat: 1, tempo: 80, time: 0.75, timeSig: 4 },
|
|
129
|
+
// ...
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
// Practice marks object
|
|
133
|
+
const practiceMarks = {
|
|
134
|
+
A: 1, // Mark A at bar 1
|
|
135
|
+
B: 5, // Mark B at bar 5
|
|
136
|
+
C: 13 // Mark C at bar 13
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Parts configuration
|
|
140
|
+
const parts = [
|
|
141
|
+
{ name: 'Soprano', volume: 0.75 },
|
|
142
|
+
{ name: 'Alto', volume: 0.7 },
|
|
143
|
+
// ...
|
|
144
|
+
]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Development
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Install dependencies
|
|
151
|
+
npm install
|
|
152
|
+
|
|
153
|
+
# Run development server with demo
|
|
154
|
+
npm run dev
|
|
155
|
+
|
|
156
|
+
# Build library
|
|
157
|
+
npm run build
|
|
158
|
+
|
|
159
|
+
# Build demo
|
|
160
|
+
npm run build:demo
|
|
161
|
+
|
|
162
|
+
# Run tests
|
|
163
|
+
npm run test
|
|
164
|
+
|
|
165
|
+
# Lint code
|
|
166
|
+
npm run lint
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Architecture
|
|
170
|
+
|
|
171
|
+
The library follows an event-driven layered architecture:
|
|
172
|
+
|
|
173
|
+
1. **Components** - Vue 3 components with composition API
|
|
174
|
+
2. **Composables** - Reusable logic for audio control and state management
|
|
175
|
+
3. **Stores** - Pinia stores for reactive state
|
|
176
|
+
4. **Services** - Audio engine integration layer
|
|
177
|
+
|
|
178
|
+
### Key Design Principles
|
|
179
|
+
|
|
180
|
+
- **Audio Thread Isolation**: Audio processing separated from reactive UI state
|
|
181
|
+
- **Event-Driven Coordination**: Real-time synchronization via event bus
|
|
182
|
+
- **Dynamic Configuration**: Runtime discovery of parts and musical structure
|
|
183
|
+
- **Responsive First**: Mobile-first design with progressive enhancement
|
|
184
|
+
|
|
185
|
+
## Browser Support
|
|
186
|
+
|
|
187
|
+
- Modern browsers with ES2020+ support
|
|
188
|
+
- Vue 3.4+
|
|
189
|
+
- Web Audio API for audio features
|
|
190
|
+
|
|
191
|
+
## Contributing
|
|
192
|
+
|
|
193
|
+
1. Fork the repository
|
|
194
|
+
2. Create a feature branch
|
|
195
|
+
3. Add tests for new functionality
|
|
196
|
+
4. Ensure all tests pass
|
|
197
|
+
5. Submit a pull request
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MIT License - see [LICENSE](./LICENSE) file for details.
|
|
202
|
+
|
|
203
|
+
## Related Projects
|
|
204
|
+
|
|
205
|
+
This component library was extracted from a larger choir practice application.
|