public void ActivateKeyTuning(int bank, int prog, string name, IntPtr pitch, int pitchLength, bool apply) { ThrowIfDisposed(); if (pitchLength != 128) { throw new ArgumentException("pitch span must be of 128 elements."); } unsafe { if (LibFluidsynth.fluid_synth_activate_key_tuning(Handle, bank, prog, name, (double *)pitch, apply) != 0) { OnError("key tuning create operation failed"); } } }
public unsafe void ActivateKeyTuning(int bank, int prog, string name, ReadOnlySpan <double> pitch, bool apply) { ThrowIfDisposed(); if (pitch.Length != 128) { throw new ArgumentException("pitch span must be of 128 elements."); } fixed(double *pPtr = pitch) { if (LibFluidsynth.fluid_synth_activate_key_tuning(Handle, bank, prog, name, pPtr, apply) != 0) { OnError("key tuning create operation failed"); } } }