vibelang-std 0.4.0

Standard library of VibeLang sound design files
Documentation
# Vibelang Standard Library

A comprehensive collection of **477 professional-quality sounds** (419 instruments + 58 effects) covering all essential sound categories for music production.

## Overview

This standard library provides a complete set of sounds for getting started with vibelang. Each sound is carefully designed using sound synthesis principles and inspired by classic hardware and software synthesizers.

## Library Components

### 1. Music Theory Library (`theory/`)

A comprehensive music theory toolkit providing functions for scales, chords, progressions, melodies, bass patterns, voice leading, harmony analysis, and counterpoint.

**Key Features:**
- 30+ scales (major, minor, modes, pentatonic, blues, exotic)
- Complete chord library (triads, 7ths, extensions, voicings)
- 20+ common progressions (pop, jazz, blues, EDM, Latin)
- Bass pattern generators (walking bass, house, techno, funk, etc.)
- Melody generation (scale-based, chord-based, motivic development)
- Voice leading tools for smooth chord transitions
- Harmonic analysis and chord identification
- Species counterpoint generation and validation

**See [`theory/README.md`](theory/README.md) for complete documentation and examples.**

### 2. Sound Library

## Library Structure

### Drums (54 sounds)

#### Kicks (12 sounds)
- `kick_808.vibe` - Classic 808, deep sub bass with pitch decay (Hip-hop, Trap)
- `kick_909.vibe` - Classic 909, tight and punchy (House, Techno)
- `kick_techno_deep.vibe` - Deep, sub-heavy, long decay (Techno, Deep House)
- `kick_techno_hard.vibe` - Aggressive, distorted, punchy (Hard Techno, Industrial)
- `kick_dnb.vibe` - Fast, tight, sub-focused (Drum & Bass, Jungle)
- `kick_trap.vibe` - Boomy 808-style with extra low end (Trap, Hip-hop)
- `kick_acoustic.vibe` - Natural-sounding, warm (Jazz, Acoustic)
- `kick_sub.vibe` - Pure sub bass, minimal harmonics (Dubstep, Bass Music)
- `kick_pitched.vibe` - Tonal kick with clear pitch (House, Melodic Techno)
- `kick_fm.vibe` - FM-style harmonics, metallic (Experimental, IDM)
- `kick_distorted.vibe` - Heavy distortion, aggressive (Industrial, Hardcore)
- `kick_soft.vibe` - Soft, gentle, minimal attack (Ambient, Chillout)

#### Snares (12 sounds)
- `snare_808.vibe` - Classic 808 snare, short and snappy (Hip-hop, Trap)
- `snare_909.vibe` - Classic 909, crisp and bright (House, Techno)
- `snare_acoustic.vibe` - Natural acoustic snare with overtones (Jazz, Rock)
- `snare_clap_snare.vibe` - Snare with clap character, layered (Hip-hop, Pop)
- `snare_piccolo.vibe` - High-pitched, tight piccolo snare (Funk, Pop)
- `snare_rimshot.vibe` - Rimshot, sharp and cutting (Latin, Reggaeton)
- `snare_tight_electronic.vibe` - Tight, electronic, punchy (Electro, Techno)
- `snare_loose_acoustic.vibe` - Loose, rattling acoustic snare (Rock, Blues)
- `snare_layered.vibe` - Big, layered snare with depth (EDM, Pop)
- `snare_reverb.vibe` - Snare with built-in reverb tail (Ambient, Chillwave)
- `snare_filtered.vibe` - Heavily filtered, muffled (Lo-fi, Experimental)
- `snare_lofi.vibe` - Dusty, lo-fi character with crackle (Lo-fi Hip-hop)

#### Hihats (10 sounds)
- `hihat_808_closed.vibe` - Classic 808 closed hihat (Hip-hop, Trap)
- `hihat_808_open.vibe` - Classic 808 open hihat (Hip-hop, Trap)
- `hihat_909_closed.vibe` - Classic 909 closed hihat (House, Techno)
- `hihat_909_open.vibe` - Classic 909 open hihat (House, Techno)
- `hihat_metallic.vibe` - Metallic, inharmonic frequencies (Experimental, IDM)
- `hihat_short.vibe` - Very short, click-like (Techno, Minimal)
- `hihat_long.vibe` - Long decay, washy (Ambient, Downtempo)
- `hihat_filtered.vibe` - Filtered, darker hihat (Lo-fi, Experimental)
- `hihat_dusty.vibe` - Dusty, lo-fi texture (Lo-fi Hip-hop)
- `hihat_splash.vibe` - Splash cymbal, bright and long (Rock, Jazz)

#### Claps (10 sounds)
- `clap_808.vibe` - Classic 808 clap (Hip-hop, Trap)
- `clap_short.vibe` - Tight, short clap (Techno, House)
- `clap_reverb.vibe` - Big clap with reverb tail (Pop, EDM)
- `clap_layered.vibe` - Layered, big stadium clap (Pop, EDM)
- `clap_crowd.vibe` - Multiple hands clapping, crowd-like (Pop, Funk)
- `clap_tight.vibe` - Very tight, focused clap (Techno, Minimal)
- `clap_loose.vibe` - Loose, spread out clap (Funk, Soul)
- `clap_filtered.vibe` - Heavily filtered, muffled (Lo-fi, Experimental)
- `clap_lofi.vibe` - Dusty, vintage clap (Lo-fi Hip-hop)
- `clap_handclap.vibe` - Natural hand clap sound (Acoustic, Folk)

#### Percussion (10 sounds)
- `tom_high.vibe` - High tom, resonant (All genres)
- `tom_mid.vibe` - Mid tom, punchy (All genres)
- `tom_low.vibe` - Low tom, deep and resonant (All genres)
- `rim.vibe` - Rim click/shot, sharp and metallic (All genres)
- `cowbell.vibe` - Classic cowbell, bright and cutting (House, Latin)
- `clave.vibe` - Wooden clave, sharp and cutting (Latin, House)
- `woodblock.vibe` - Hollow wooden block (Experimental, World)
- `shaker.vibe` - Shaker, bright and rattling (Pop, Latin)
- `tambourine.vibe` - Tambourine jingle, bright and sustained (Pop, Rock)
- `snap.vibe` - Finger snap, quick and sharp (Pop, R&B)

### Bass (30 sounds)

#### Sub Bass (10 sounds)
- `sub_pure_sine.vibe` - Pure sine wave sub, clean and deep (Dubstep, Bass Music)
- `sub_triangle.vibe` - Triangle wave sub with odd harmonics (House, Techno)
- `sub_filtered.vibe` - Filtered sine with slight movement (House, Techno)
- `sub_octave.vibe` - Layered octaves for massive sub (Dubstep, Drum & Bass)
- `sub_modulated.vibe` - Phase-modulated sub with movement (Techno, Minimal)
- `sub_warm.vibe` - Warm sub with gentle harmonics (House, Deep House)
- `sub_deep.vibe` - Very deep, chest-hitting sub (Dubstep, Bass Music)
- `sub_mono.vibe` - Focused mono sub for club systems (All genres)
- `sub_stereo.vibe` - Wide stereo sub with slight detuning (Ambient, Experimental)
- `sub_harmonic.vibe` - Sub with rich harmonic series (Techno, House)

#### Acid Bass (10 sounds)
- `acid_303_classic.vibe` - Classic 303 with resonant filter sweep (Acid House, Techno)
- `acid_squelchy.vibe` - Squelchy, high resonance (Acid Techno)
- `acid_distorted.vibe` - Distorted, aggressive acid (Industrial, Hard Techno)
- `acid_bubbly.vibe` - Bubbly, playful resonance (Acid House)
- `acid_minimal.vibe` - Subtle, minimal filter movement (Minimal Techno)
- `acid_aggressive.vibe` - Aggressive, fast sweep (Hard Acid, Industrial)
- `acid_modulated.vibe` - Frequency modulated acid (Techno, Experimental)
- `acid_detuned.vibe` - Detuned oscillators for thickness (Acid House, Techno)
- `acid_filtered_square.vibe` - Square wave with resonant filter (Acid Techno)
- `acid_resonant_sweep.vibe` - Extreme resonance sweep (Acid Techno)

#### Pluck Bass (10 sounds)
- `pluck_short.vibe` - Short, tight pluck bass (House, Techno)
- `pluck_long.vibe` - Longer pluck with sustain (Dubstep, Bass Music)
- `pluck_bright.vibe` - Bright, cutting pluck (House, Funk)
- `pluck_dark.vibe` - Dark, muted pluck (Techno, Minimal)
- `pluck_resonant.vibe` - Resonant pluck with filter ring (Techno, House)
- `pluck_muted.vibe` - Muted, soft pluck (Lo-fi, Jazz)
- `pluck_funky.vibe` - Funky, percussive pluck (Funk, Disco)
- `pluck_elastic.vibe` - Elastic, bouncy pluck (Electro, Experimental)
- `pluck_bell.vibe` - Bell-like pluck bass (Ambient, Experimental)
- `pluck_percussive.vibe` - Very percussive, attack-heavy (Techno, Electro)

### Leads (20 sounds)

#### Synth Leads (10 sounds)
- `lead_saw.vibe` - Classic saw lead, bright and cutting (Trance, House)
- `lead_square.vibe` - Square wave lead, hollow and vintage (Electro, Synthwave)
- `lead_supersaw.vibe` - Massive supersaw, wide and powerful (Trance, EDM)
- `lead_detuned.vibe` - Detuned lead with chorus effect (House, Techno)
- `lead_pwm.vibe` - Pulse width modulation lead (Synthwave, Electro)
- `lead_filtered.vibe` - Heavily filtered lead (Techno, Minimal)
- `lead_bright.vibe` - Bright, energetic lead (Trance, Progressive)
- `lead_dark.vibe` - Dark, moody lead (Techno, Industrial)
- `lead_aggressive.vibe` - Aggressive, distorted lead (Hard Techno, Industrial)
- `lead_smooth.vibe` - Smooth, gentle lead (Ambient, Chillout)

#### Pluck Leads (10 sounds)
- `pluck_bright.vibe` - Bright, shimmering pluck lead (House, Pop)
- `pluck_bell.vibe` - Bell-like with inharmonic overtones (Ambient, Experimental)
- `pluck_marimba.vibe` - Marimba-like, wooden timbre (World, Ambient)
- `pluck_kalimba.vibe` - Kalimba/thumb piano sound (World, Ambient)
- `pluck_harp.vibe` - Harp-like pluck (Ambient, Classical)
- `pluck_piano.vibe` - Piano-like pluck (All genres)
- `pluck_short.vibe` - Very short, staccato pluck (Minimal, House)
- `pluck_long.vibe` - Long, sustained pluck (Ambient, Chillout)
- `pluck_resonant.vibe` - Resonant pluck with filter character (Techno, House)
- `pluck_muted.vibe` - Muted, soft pluck (Lo-fi, Jazz)

### Pads (20 sounds)

#### Ambient Pads (10 sounds)
- `pad_dark.vibe` - Dark, brooding pad (Ambient, Dark Ambient)
- `pad_bright.vibe` - Bright, airy pad (Ambient, Chillout)
- `pad_evolving.vibe` - Evolving pad with filter movement (Ambient, Experimental)
- `pad_sparse.vibe` - Sparse, minimal pad (Ambient, Minimal)
- `pad_dense.vibe` - Dense, thick pad (Ambient, Drone)
- `pad_filtered.vibe` - Heavily filtered pad with resonance (Ambient, Techno)
- `pad_shimmer.vibe` - Shimmering pad with high harmonics (Ambient, Post-Rock)
- `pad_warm.vibe` - Warm, comforting pad (Ambient, Chillout)
- `pad_cold.vibe` - Cold, digital pad (Ambient, Drone)
- `pad_space.vibe` - Spacious, atmospheric pad (Ambient, Space Music)

#### Lush Pads (10 sounds)
- `pad_detuned.vibe` - Heavily detuned, wide and lush (Trance, EDM)
- `pad_chorus.vibe` - Chorused pad with movement (Synthwave, Pop)
- `pad_wide.vibe` - Very wide stereo pad (Ambient, Chillout)
- `pad_narrow.vibe` - Narrow, focused lush pad (Minimal, House)
- `pad_string.vibe` - String-like pad (Orchestral, Cinematic)
- `pad_voice.vibe` - Voice-like pad with formants (Ambient, Choral)
- `pad_organ.vibe` - Organ-like pad with drawbars (Gospel, Jazz)
- `pad_soft.vibe` - Soft, gentle lush pad (Ambient, Chillout)
- `pad_aggressive.vibe` - Aggressive, driven pad (Techno, Industrial)
- `pad_morphing.vibe` - Morphing, evolving lush pad (Ambient, Experimental)

### FX (15 sounds)

#### Risers (5 sounds)
- `riser_white_noise.vibe` - White noise riser with filter sweep (EDM, Trap)
- `riser_pink_noise.vibe` - Pink noise riser, warmer than white (House, Techno)
- `riser_filtered.vibe` - Resonant filtered riser (Techno, Trance)
- `riser_pitch.vibe` - Pitch-rising synth (Trance, EDM)
- `riser_reverse.vibe` - Reverse-style riser effect (Experimental, IDM)

#### Impacts (5 sounds)
- `impact_hard.vibe` - Hard, aggressive impact (EDM, Cinematic)
- `impact_soft.vibe` - Soft, subtle impact (Ambient, Cinematic)
- `impact_metallic.vibe` - Metallic, resonant impact (Industrial, Experimental)
- `impact_sub.vibe` - Deep sub impact (Dubstep, Bass Music)
- `impact_noise.vibe` - Noise-based impact, versatile (All genres)

#### Sweeps (5 sounds)
- `sweep_filter_up.vibe` - Upward filter sweep (House, Techno)
- `sweep_filter_down.vibe` - Downward filter sweep (House, Techno)
- `sweep_pitch.vibe` - Pitch sweep effect (EDM, Trance)
- `sweep_whoosh.vibe` - Whoosh/wind sweep (Cinematic, Trailer)
- `sweep_reverse.vibe` - Reverse sweep effect (Experimental, IDM)

### Textures (10 sounds)

#### Ambient Textures (5 sounds)
- `texture_wind.vibe` - Wind-like texture (Ambient, Field Recording)
- `texture_rain.vibe` - Rain-like texture (Ambient, Nature)
- `texture_space.vibe` - Spacious, ethereal texture (Ambient, Sci-Fi)
- `texture_granular.vibe` - Granular-style texture (Ambient, Experimental)
- `texture_field.vibe` - Field recording style ambient (Ambient, Field Recording)

#### Drones (5 sounds)
- `drone_dark.vibe` - Dark, ominous drone (Dark Ambient, Drone)
- `drone_harmonic.vibe` - Harmonic, spectral drone (Ambient, Drone)
- `drone_noise.vibe` - Noise-based drone (Experimental, Noise)
- `drone_evolving.vibe` - Slowly evolving drone (Ambient, Drone)
- `drone_resonant.vibe` - Resonant, metallic drone (Ambient, Experimental)

---

## Realistic Acoustic Instruments (56 sounds)

The following instruments use advanced physical modeling and professional sound design techniques for realistic acoustic sounds.

### Keys (`keys/`)

#### Grand Piano (5 sounds)
- `grand_piano` - Full acoustic piano with hammer mechanics, string resonance, and inharmonicity
- `grand_piano_bright` - Concert hall bright piano with extended harmonics
- `grand_piano_warm` - Intimate, dark piano with emphasis on lower partials
- `upright_piano` - Upright piano with honky-tonk character and cabinet resonance
- `tack_piano` - Prepared piano with tacks on hammers for bright, percussive attack

#### Mallet Instruments (10 sounds)
- `marimba` - Warm wooden bars with inharmonic partials and resonator simulation
- `vibraphone` - Aluminum bars with motor vibrato and long sustain
- `glockenspiel` - Bright steel bars with bell-like overtones
- `xylophone` - Dry wooden bars without resonators
- `tubular_bells` - Orchestral chimes with complex inharmonic partials
- `crotales` - Antique cymbals, very pure and high
- `steel_drum` - Caribbean steel pan with characteristic singing quality
- `kalimba` - African thumb piano with odd harmonics
- `celesta` - Keyboard glockenspiel with wooden resonator warmth
- `music_box` - Classic music box with bright, short tines

### Strings (`strings/`)

#### Acoustic Guitar (6 sounds)
- `acoustic_guitar` - Steel string dreadnought with body resonance and pluck dynamics
- `classical_guitar` - Nylon string guitar with warm, round tone
- `fingerpick_guitar` - Fingerstyle optimized with nail/flesh control
- `twelve_string_guitar` - 12-string with chorus from paired strings
- `guitar_harmonic` - Natural harmonics, pure bell-like tones
- `guitar_muted` - Palm-muted guitar for rhythmic playing

#### Electric Guitar (7 sounds)
- `electric_guitar_clean` - Fender-style single coil, clean amp
- `electric_guitar_crunch` - Edge-of-breakup tube amp tone
- `electric_guitar_distorted` - High-gain metal/rock distortion with multi-stage saturation
- `electric_guitar_jazz` - Warm hollow-body with neck humbucker
- `electric_guitar_funk` - Bright, percussive bridge pickup
- `power_chord` - Thick power chords with root, fifth, and octave
- `electric_guitar_wah` - Auto-wah effect with resonant filter sweep

#### Bass Instruments (10 sounds)
- `upright_bass` - Acoustic double bass pizzicato with body resonance
- `upright_bass_bowed` - Arco double bass with bow noise and vibrato
- `electric_bass` - Precision Bass style with warm pickup
- `jazz_bass` - Jazz Bass style with dual pickup blend
- `fretless_bass` - Fretless with characteristic "mwah" singing quality
- `slap_bass` - Slap and pop techniques with bright attack
- `synth_bass_moog` - Classic Moog-style with ladder filter
- `acid_bass` - 303-style with resonant filter sweep and accent
- `picked_bass` - Rock/metal pick attack with drive

### Woodwinds (`woodwinds/`)

#### Realistic Woodwinds (10 sounds)
- `clarinet_realistic` - Clarinet with odd harmonic emphasis and reed buzz
- `alto_sax_realistic` - Alto saxophone with growl and subtone capabilities
- `tenor_sax_realistic` - Tenor saxophone with warm jazz formants
- `flute_realistic` - Flute with air jet modeling and breath noise
- `oboe_realistic` - Nasal double-reed with rich harmonics
- `english_horn` - Deeper, melancholic cor anglais
- `bassoon_realistic` - Rich bass woodwind with reed character
- `recorder` - Medieval/Renaissance wooden recorder
- `pan_flute` - Breathy, ethereal pan pipes

### Brass (`brass/`)

#### Realistic Brass (11 sounds)
- `trumpet_realistic` - Trumpet with lip buzz attack and bell formants
- `trumpet_harmon_mute` - Harmon (wah-wah) muted trumpet
- `trumpet_cup_mute` - Cup muted trumpet, softer and warmer
- `flugelhorn` - Dark, velvety conical brass
- `trombone_realistic` - Trombone with slide characteristics
- `bass_trombone` - Deeper, more powerful bass trombone
- `french_horn_realistic` - Noble horn with stopped/open options
- `tuba_realistic` - Deep, fundamental bass brass
- `euphonium` - Warm baritone brass
- `brass_section_realistic` - Full brass section ensemble

---

### Sound Design Techniques Used

The realistic instruments use professional synthesis techniques:

- **Inharmonic Partials** - Bars and strings have non-integer partial ratios
- **Formant Filtering** - Multiple resonant filters simulate body resonances
- **Attack Transients** - Noise bursts and envelope shaping for realistic attacks
- **Delayed Vibrato** - Vibrato fades in after attack, like real players
- **Pickup Simulation** - Position-dependent filtering for electric instruments
- **Tube Saturation** - Soft clipping (tanh) for amp modeling
- **Mute Simulations** - Different resonant characteristics for muted brass
- **Body Resonance** - Multiple formant frequencies for acoustic bodies

## Usage

Each synthdef is self-contained in its own `.vibe` file. To use a sound in your composition:

```rhai
// Include the synthdef you want to use
// (Note: You'll need to manually include these files or create an import system)

// Then use it in your music
let kick = voice("kick")
    .synth("kick_808")
    .gain(db(0));

pattern("beat")
    .on(kick)
    .step("x...x...x...x...")
    .len(4.0)
    .start();
```

### Bulk Imports

To speed up prototyping you can now import ready-made indexes instead of referencing every instrument manually:

- `import "stdlib/index.vibe";` – load every instrument category plus the entire effects suite
- `import "stdlib/bass/index.vibe";` – load all bass synthdefs
- `import "stdlib/drums/index.vibe";` – load the complete drum kit
- `import "stdlib/leads/index.vibe";` – load all lead sounds
- `import "stdlib/pads/index.vibe";` – load both ambient and lush pads
- `import "stdlib/textures/index.vibe";` – load textures and drones
- `import "stdlib/fx/index.vibe";` – load risers, impacts, sweeps, and sub drops
- `import "stdlib/effects/index.vibe";` (or the legacy `all_effects.vibe`) – load every standard effect
- `import "stdlib/keys/index.vibe";` – load keyboards, pianos, and mallet instruments
- `import "stdlib/strings/index.vibe";` – load string instruments including guitars and bass
- `import "stdlib/brass/index.vibe";` – load all brass instruments
- `import "stdlib/woodwinds/index.vibe";` – load all woodwind instruments

Use these when you want fast access to the whole arsenal, and fall back to per-file imports if you need finer control over load time.

## Sound Design Principles

All sounds in this library follow professional sound design principles:

- **Kicks**: Pitch envelope on sine oscillators, noise for attack definition
- **Snares**: Filtered noise + tonal components
- **Hihats**: High-passed noise with short envelopes
- **Bass**: Layer oscillators, use filter modulation
- **Leads**: Detuning, filter sweeps, PWM for movement
- **Pads**: Multiple detuned oscillators, slow envelopes
- **FX**: Envelope-controlled filters and pitch
- **Textures**: Slow evolution, layered elements

## License

This standard library is part of the vibelang project and follows the same license.

## Contributing

Feel free to add your own sounds to this library following the established patterns and conventions.