예제 #1
0
        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");
                }
            }
        }
예제 #2
0
        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");
                }
            }
        }