12345678910111213141516171819202122232425(* Claude Code
*
* Copyright (C) 2026 Yoann Padioleau
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* (LGPL) as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*)(* See Pitch_effect.mli *)typet=|Vibratoof{rate:float;depth:float}|Jumpof{semitones:float;at:float}|Arpeggioof{semitones:floatlist;step:float}letsemitones(k:float):float=2.**(k/.12.)letfactor(p:t)(t:float):float=matchpwith|Vibrato{rate;depth}->semitones(depth*.sin(2.*.Float.pi*.rate*.t))|Jump{semitones=k;at}->ift<atthen1.elsesemitonesk|Arpeggio{semitones=[];_}->1.|Arpeggio{semitones=l;step}->semitones(List.nthl(int_of_float(t/.step)modList.lengthl))