re-work appegiator patterns

This commit is contained in:
Armin 2026-08-13 01:15:17 +02:00
commit 56fc80c405
4 changed files with 122 additions and 8 deletions

View file

@ -118,7 +118,7 @@ Osc1 + Osc2 → Amplitude Envelope × Velocity → Filter (cutoff modulated by F
| drive | Drive | 1..5 (log) | 1.5 |
| masterLevel | Master Level | 0..1 | 0.8 |
| arpEnabled | Arp On | Choice(2) Off/On | 0 (Off) |
| arpPattern | Arp Pattern | Choice(7) | 0 (Up) |
| arpPattern | Arp Pattern | Choice(17) | 0 (Up) |
| arpOctaves | Arp Octaves | Choice(3) 1/2/3 | 1 (2) |
| arpDirection | Arp Direction | Choice(2) Up/Down | 0 (Up) |
| arpRate | Arp Rate | Choice(6) 1/16..2 | 1 (1/8) |
@ -200,8 +200,8 @@ ChromaFlockEditor (juce::AudioProcessorEditor)
### Arpeggiator
- New class `DSP/Arpeggiator.h` — tempo-synced, pure note-logic (no audio). Tracks held notes (press order for the As Played pattern), builds a pitch pool from held notes × octave range (13, clamped to MIDI range), and sequences it per pattern.
- Patterns: Up, Down, UpDown, DownUp, Random, As Played, Chord.
- `arpDirection` (Up/Down) controls whether octave copies extend above or below the root; sequential patterns always order by ascending pitch.
- Patterns: Up, Down, UpDown, DownUp, Random, As Played, Chord, Up&Down X, Down&Up X, Random Once, Octave Up, Octave Down, Pinky Up, Pinky Down. X variants are endpoint-exclusive bounces; Random Once shuffles per cycle (no repeat until full pass); Octave Up/Down play each root followed by its ±12 copies spanning the selected OCTAVES count; Pinky Up/Down alternate extremes low/high. Up/Down arpeggiate a minor third + fifth (root, +3, +7) and Up/Down major variants a major third + fifth (root, +4, +7); UpDown/DownUp arpeggiate major (root, +4, +7) plus an UpDown minor variant (root, +3, +7), each as a separate step. Dropdown labels: "Up / Minor", "Down / Minor", "Up & Down / Major", "Down & Up / Major", "Up / Major", "Down / Major", "Up & Down / Minor".
- `arpDirection` (Up/Down) controls whether octave copies extend above or below the root AND inverts the traversal for sequential patterns (Up/Down/UpDown/DownUp) so Direction Down actually steps descending; Random and As Played ignore the inversion.
- `arpRate` step divisions (beats): 1/16, 1/8, 1/4, 1/2, 1, 2 — tick period = `rateBeats * 60 / bpm`.
- Routing (`PluginProcessor.cpp::processBlock`): when `arpEnabled`, MIDI note events feed the arp instead of the synth; the arp drives `synth.noteOn/noteOff` (with transpose) on each tick via `arpSampleCount` accumulation. Piano-roll `noteOn/noteOff` route through the same logic. When disabled, `arp.reset()` stops any sounding arp note and notes play normally.
- UI: bottom-right section at (860, 746) titled ARPEGGIATOR with 5 combos (ON, PATTERN, OCTAVES, DIR, RATE).