Cleaning the codebase
This commit is contained in:
@ -24,7 +24,7 @@ const customWaveform = generateWaveform({
|
||||
splits: 32,
|
||||
interpolation: 'cubic',
|
||||
randomness: 'smooth',
|
||||
lineWidth: 3
|
||||
lineWidth: 3,
|
||||
})
|
||||
```
|
||||
|
||||
@ -33,27 +33,30 @@ const customWaveform = generateWaveform({
|
||||
### Main Functions
|
||||
|
||||
#### `generateWaveform(config?)`
|
||||
|
||||
Generate a waveform with optional configuration override.
|
||||
|
||||
#### `generateRandomWaveform()`
|
||||
|
||||
Generate a waveform with randomized parameters for maximum variety.
|
||||
|
||||
#### `generateWaveformBatch(count)`
|
||||
|
||||
Generate multiple random waveforms efficiently.
|
||||
|
||||
### Configuration
|
||||
|
||||
```typescript
|
||||
interface WaveformConfig {
|
||||
width: number // Canvas width (default: 256)
|
||||
height: number // Canvas height (default: 256)
|
||||
splits: number // Number of control points (8-64)
|
||||
interpolation: InterpolationType // Curve type
|
||||
randomness: RandomnessStrategy // Distribution strategy
|
||||
lineWidth: number // Stroke width (1-4)
|
||||
backgroundColor: string // Background color
|
||||
lineColor: string // Line color
|
||||
smoothness: number // Curve smoothness (0-1)
|
||||
width: number // Canvas width (default: 256)
|
||||
height: number // Canvas height (default: 256)
|
||||
splits: number // Number of control points (8-64)
|
||||
interpolation: InterpolationType // Curve type
|
||||
randomness: RandomnessStrategy // Distribution strategy
|
||||
lineWidth: number // Stroke width (1-4)
|
||||
backgroundColor: string // Background color
|
||||
lineColor: string // Line color
|
||||
smoothness: number // Curve smoothness (0-1)
|
||||
}
|
||||
```
|
||||
|
||||
@ -95,31 +98,34 @@ waveform-generator/
|
||||
## Examples
|
||||
|
||||
### Basic Waveform
|
||||
|
||||
```typescript
|
||||
const simple = generateWaveform({
|
||||
splits: 16,
|
||||
interpolation: 'linear'
|
||||
interpolation: 'linear',
|
||||
})
|
||||
```
|
||||
|
||||
### Smooth Organic Curves
|
||||
|
||||
```typescript
|
||||
const organic = generateWaveform({
|
||||
splits: 24,
|
||||
interpolation: 'cubic',
|
||||
randomness: 'smooth',
|
||||
smoothness: 0.7
|
||||
smoothness: 0.7,
|
||||
})
|
||||
```
|
||||
|
||||
### Sharp Electronic Waveform
|
||||
|
||||
```typescript
|
||||
const electronic = generateWaveform({
|
||||
splits: 32,
|
||||
interpolation: 'exponential',
|
||||
randomness: 'uniform',
|
||||
lineWidth: 1
|
||||
lineWidth: 1,
|
||||
})
|
||||
```
|
||||
|
||||
The generated waveforms are perfect for audio visualization and spectral synthesis applications.
|
||||
The generated waveforms are perfect for audio visualization and spectral synthesis applications.
|
||||
|
||||
Reference in New Issue
Block a user