Skip to content

Conversation

@jhillbht
Copy link

@jhillbht jhillbht commented Jan 5, 2026

Summary

Adds three new genre presets to the PatternGenerator service, each with complete pattern generation, drum patterns, and basslines.


New Genres

🎵 Intelligent DnB (160-175 BPM)

Style: LTJ Bukem, Good Looking Records, early 90s atmospheric DnB

Element Implementation
Breaks Rolling breakbeats using breaks165 from dirt-samples
Bass Deep sine sub (80Hz LPF) with proper ADSR
Chords Jazz voicings - minor 9ths, 7ths (Cm9 → Fm9 → Bbm9 → Ebmaj7)
Atmosphere Rhodes (gm_epiano1), strings (gm_strings)
Effects Heavy reverb (0.5-0.7), dotted eighth delay (0.375s)

Aliases: liquid_dnb, atmospheric_dnb, bukem, intelligent, liquid, atmospheric


🌙 Trip Hop (80-100 BPM)

Style: Portishead, Massive Attack, Flying Lotus

Element Implementation
Drums Slow, heavy half-time feel with TR808 snares
Bass Deep sine with longer release (0.8s)
Keys Dark Rhodes with dotted quarter delay (0.666s)
Atmosphere Filtered saw pads, vinyl crackle texture
Feel Moody, dusty, cinematic

Aliases: triphop, portishead, massive_attack, flying_lotus


💥 Boom Bap (85-100 BPM)

Style: DJ Premier, Alchemist, Daringer, Hit-Boy

Element Implementation
Drums Hard-hitting kicks, crispy snares, swing (0.08)
Bass Punchy sawtooth (180Hz LPF)
Chops Soul sample-style Rhodes
Stabs Cinematic strings, horn accents
Feel Golden era, head-nodding groove

Aliases: boombap, golden_era, premier, alchemist, daringer, hitboy


Changes

src/services/PatternGenerator.ts

  • Added generateIntelligentDnB() method
  • Added generateTripHop() method
  • Added generateBoomBap() method
  • Added interval helper methods (getInterval, getFourth, getFifth, etc.)
  • Updated generateDrumPattern() with new genre patterns (3 complexity levels each)
  • Updated generateBassline() with new genre basslines
  • Updated generateCompletePattern() to route to specialized generators
  • Added alias mappings for all genre variations

patterns/examples/

  • intelligent-dnb.js - Full atmospheric DnB example (170 BPM, C minor)
  • trip-hop.js - Dark trip hop example (90 BPM, D minor)
  • boom-bap.js - Golden era hip hop example (92 BPM, E minor)

README.md

  • Updated genre lists in tools table
  • Added new genres to example patterns section

patterns/examples/README.md

  • Added documentation for all three new genres

Usage Examples

// Intelligent DnB
generateCompletePattern('intelligent_dnb', 'C', 170)
generateCompletePattern('bukem', 'Am', 168)

// Trip Hop
generateCompletePattern('trip_hop', 'D', 90)
generateCompletePattern('portishead', 'Gm', 85)

// Boom Bap
generateCompletePattern('boom_bap', 'E', 92)
generateCompletePattern('premier', 'Am', 94)

Testing

All patterns tested in strudel.cc and produce valid output.

Related

New genres added to PatternGenerator:

## Intelligent DnB (160-175 BPM)
- Style: LTJ Bukem, Good Looking Records
- Rolling breakbeats using dirt-samples (breaks165, amen)
- Deep sine sub bass (80Hz LPF)
- Jazz chord voicings (minor 9ths, 7ths)
- Ethereal Rhodes and string atmospheres
- Aliases: liquid_dnb, atmospheric_dnb, bukem, intelligent, liquid

## Trip Hop (80-100 BPM)
- Style: Portishead, Massive Attack, Flying Lotus
- Slow, heavy half-time drums
- Dusty textures and vinyl crackle vibes
- Dark Rhodes and moody pads
- TR808 snares with room reverb
- Aliases: triphop, portishead, massive_attack, flying_lotus

## Boom Bap (85-100 BPM)
- Style: DJ Premier, Alchemist, Daringer, Hit-Boy
- Hard-hitting kicks and crispy snares
- Soul sample-style chops
- Swing feel (0.08)
- Cinematic string stabs and horn accents
- Aliases: boombap, golden_era, premier, alchemist, daringer, hitboy

Changes:
- src/services/PatternGenerator.ts: Added 3 new genre generators
- patterns/examples/: Added example patterns for each genre
- README.md: Updated genre lists and documentation
- patterns/examples/README.md: Added genre documentation
Copy link
Owner

@williamzujkowski williamzujkowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent Contribution! 🎶

First off, thank you for this substantial contribution. The musical implementation is solid:

  • Intelligent DnB: Rolling breaks with breaks165, jazz chord voicings (minor 9ths), deep sine sub - classic Bukem style ✅
  • Trip Hop: Half-time feel, dusty hats, dark Rhodes with dotted quarter delay - very Portishead ✅
  • Boom Bap: Hard-hitting kicks, swing (0.08), soul sample chops - proper golden era vibes ✅

The code quality is good, the alias mappings are comprehensive, and the example patterns are well-crafted.

One Issue: Missing Tests

The build passes, but our coverage thresholds are not met:

Jest: "global" coverage threshold for statements (80%) not met: 68.86%
Jest: "global" coverage threshold for branches (70%) not met: 63.75%

Per our CLAUDE.md coding standards, we require 80% coverage for services.

What's needed: Tests for the new code in PatternGenerator.test.ts. Following the existing test patterns, you'd add:

// In generateDrumPattern tests - add to the styles array:
const styles = ['techno', 'house', 'dnb', ... 'intelligent_dnb', 'trip_hop', 'boom_bap'];

// In generateBassline tests - add to the styles array:
const styles = ['techno', 'house', ... 'intelligent_dnb', 'trip_hop', 'boom_bap'];

// New tests for generateCompletePattern:
test('should generate intelligent_dnb pattern with correct structure', () => {
  const pattern = generator.generateCompletePattern('intelligent_dnb', 'C', 170);
  expect(pattern).toContain('// Intelligent DnB');
  expect(pattern).toContain('setcps(170/60)');
  expect(pattern).toContain('breaks165');
  expect(pattern).toContain('gm_epiano1');
});

// Similar for trip_hop and boom_bap

// Test alias resolution:
test('should resolve genre aliases correctly', () => {
  const liquidDnb = generator.generateCompletePattern('liquid_dnb', 'C', 170);
  const bukem = generator.generateCompletePattern('bukem', 'C', 170);
  expect(liquidDnb).toContain('// Intelligent DnB');
  expect(bukem).toContain('// Intelligent DnB');
});

The new private helper methods (getInterval, getFourth, etc.) are covered indirectly through the generator tests, so those are fine.

Summary

The musical implementation is excellent. Add the tests and this is ready to merge. If you need any help with the test structure or have questions, just ask!


Looking forward to hearing some intelligent DnB in my Strudel sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants