/* Presets.jsx — sample×preset matrix for the A/B player.
   Audio path: live/audio/samples/{sample.folder}/{preset.file}
   Dry path:   live/audio/samples/{sample.folder}/dry.mp3 */

const MV_SAMPLES = [
  { id: 'female-solo', label: 'Female · Solo',        folder: 'female-solo' },
  { id: 'female-mix',  label: 'Female · In the Mix',  folder: 'female-mix' },
  { id: 'male-solo',   label: 'Male · Solo',          folder: 'male-solo' },
  { id: 'male-mix',    label: 'Male · In the Mix',    folder: 'male-mix' },
];

// Hero A/B player chip strip — the seven North-America "hit-makers"
// from the 58-preset library. State values mirror MVPresets.json
// exactly; the audio engine falls back to dry.mp3 for any voice ×
// preset combo that has no rendered wet sample yet, so dropping new
// stems into live/audio/samples/{voice}/{preset.file} as they get
// produced is additive — no code changes needed.
const MV_PRESETS = [
  {
    id: 'pop-chorus', name: 'Pop Chorus', file: 'pop-chorus.mp3', color: '#ff7ca8', genre: 'Pop',
    real: {},
    state: { power: 0.70, focus: 0.55, fat: 0.30, doubler: 0.45, reverb: 0.40, delay: 0.25, clarity: 0.45, deess: 0.40, voice: 'female', input: 0.5, output: 0.5, autoGain: 1 },
  },
  {
    id: 'modern-hiphop', name: 'Modern Hip-Hop', file: 'modern-hiphop.mp3', color: '#a7a5ff', genre: 'Hip-Hop',
    real: {},
    state: { power: 0.55, focus: 0.50, fat: 0.30, doubler: 0.10, reverb: 0.20, delay: 0.10, clarity: 0.50, deess: 0.40, voice: 'off', input: 0.5, output: 0.5, autoGain: 1 },
  },
  {
    id: 'trap', name: 'Trap', file: 'trap.mp3', color: '#bb44ff', genre: 'Trap',
    real: {},
    state: { power: 0.75, focus: 0.55, fat: 0.35, doubler: 0.20, reverb: 0.30, delay: 0.35, clarity: 0.45, deess: 0.40, voice: 'off', input: 0.5, output: 0.5, autoGain: 1 },
  },
  {
    id: 'smooth-rnb', name: 'Smooth R&B', file: 'smooth-rnb.mp3', color: '#f5c518', genre: 'R&B',
    real: {},
    state: { power: 0.45, focus: 0.40, fat: 0.45, doubler: 0.35, reverb: 0.55, delay: 0.20, clarity: 0.30, deess: 0.30, voice: 'off', input: 0.5, output: 0.5, autoGain: 1 },
  },
  {
    id: 'modern-pop', name: 'Modern Pop', file: 'modern-pop.mp3', color: '#7dd3fc', genre: 'Pop',
    real: {},
    state: { power: 0.65, focus: 0.55, fat: 0.25, doubler: 0.15, reverb: 0.25, delay: 0.20, clarity: 0.50, deess: 0.40, voice: 'off', input: 0.5, output: 0.5, autoGain: 1 },
  },
  {
    id: 'indie-rock', name: 'Indie Rock', file: 'indie-rock.mp3', color: '#38d07a', genre: 'Indie',
    real: {},
    state: { power: 0.30, focus: 0.40, fat: 0.50, doubler: 0.40, reverb: 0.55, delay: 0.45, clarity: 0.30, deess: 0.30, voice: 'off', input: 0.5, output: 0.5, autoGain: 0 },
  },
  {
    id: 'lofi-hiphop', name: 'Lo-Fi Hip-Hop', file: 'lofi-hiphop.mp3', color: '#c69c6d', genre: 'Lo-Fi',
    real: {},
    state: { power: 0.45, focus: 0.35, fat: 0.40, doubler: 0.20, reverb: 0.35, delay: 0.20, clarity: 0.25, deess: 0.30, voice: 'off', input: 0.5, output: 0.5, autoGain: 1 },
  },
];

// Helper: get audio URL for a sample+preset combo
const getAudioUrl = (sampleId, presetFile) => {
  const sample = MV_SAMPLES.find(s => s.id === sampleId);
  if (!sample) return null;
  return `live/audio/samples/${sample.folder}/${presetFile}`;
};
const getDryUrl = (sampleId) => {
  const sample = MV_SAMPLES.find(s => s.id === sampleId);
  if (!sample) return null;
  return `live/audio/samples/${sample.folder}/dry.mp3`;
};

// Effects story — kept for the playground section
const MV_EFFECTS_STORY = [
  { key: 'focus',   label: 'FOCUS',   color: '#ff7ca8',
    headline: 'Cut the mud. Push the presence.',
    body: 'FOCUS sweeps out everything below the voice \u2014 the room rumble, the proximity bloom, the cable hum \u2014 then lifts the 3\u20135k band that makes a vocal sit where the listener\u2019s attention lives.',
    soloValue: 0.95 },
  { key: 'fat',     label: 'FAT',     color: '#ff7ca8',
    headline: 'Weight without mud.',
    body: 'FAT adds body around 150\u2013250 Hz \u2014 the chest of the voice. Controlled shelf, not a bass boost. On a thin take, it\u2019s the difference between tiny and in the room.',
    soloValue: 0.85 },
  { key: 'doubler', label: 'DOUBLER', color: '#f5c518',
    headline: 'Two voices from one take.',
    body: 'Stereo micro-delay with detuned returns. Makes the lead wider and fuller without killing the mono collapse. Turn it up on hooks, leave it down on verses.',
    soloValue: 0.8 },
  { key: 'reverb',  label: 'REVERB',  color: '#f5c518',
    headline: 'Depth, tuned per genre.',
    body: 'A plate-style tail voiced for contemporary vocal production \u2014 short and tight on rap, long and lush on R&B.',
    soloValue: 0.85 },
  { key: 'delay',   label: 'DELAY',   color: '#f5c518',
    headline: 'Space between the words.',
    body: 'A short musical delay tuned to sit behind the vocal instead of crowding it. Use it for a subtle throw on the ends of lines \u2014 or push it for an 80s pad.',
    soloValue: 0.85 },
  { key: 'clarity', label: 'CLARITY', color: '#a7a5ff',
    headline: 'Air, not harshness.',
    body: 'A high-shelf you can actually push. Most air bands turn a great take into a sibilance machine \u2014 CLARITY is voiced around 8\u201312k so you get sparkle without the pain.',
    soloValue: 0.95 },
  { key: 'deess',   label: 'DE-ESS',  color: '#a7a5ff',
    headline: 'Tame the esses. Keep the air.',
    body: 'Frequency-dependent gain riding around the sibilant band. Works with CLARITY \u2014 push air all you want, the esses stay in their lane.',
    soloValue: 0.95 },
  { key: 'power',   label: 'POWER',   color: '#ef4444',
    headline: 'The master drive.',
    body: 'POWER feeds the whole chain harder \u2014 the character knob. At low settings it\u2019s transparent; past noon it pushes saturation and density into the lead.',
    soloValue: 0.85 },
];

Object.assign(window, { MV_SAMPLES, MV_PRESETS, MV_EFFECTS_STORY, getAudioUrl, getDryUrl });
