sclass PianoSampler { double sampleRate = 48000; double currentSample; persistable sclass Oscillator extends HasKey { double currentPeriodStart; // all recorded intensities new TreeMap intensities; *(Frequency f) { super(f); } Frequency frequency() { ret key(); } double interval() { ret frequency().interval(); } void record(DoubleRange r, Complex c) { intensities.put(r, c); } O phase90() { ret currentPeriodStart + interval()*.5; } O phase180() { ret currentPeriodStart + interval(); } O phase270() { ret currentPeriodStart + interval()*1.5; } O phase360() { ret currentPeriodStart + interval()*2; } } HasKeyMap oscillators = new(map(f -> new Oscillator(f), pianoFrequencies88())); new TreeMultiMap actionsForSample; *(double *currentSample) {} void init { for (o : oscillators) { o.currentPeriodStart = currentSample; actionsForSample.put(cu } }