PianoKeyEmulator.Note.operator C# (CSharp) Méthode

operator() public static méthode

public static operator ( ) : Note
Résultat Note
        public static Note operator +(Note note, int semitons)
        {
            var octave = (byte) (note.Octave + semitons/12); // 12 полутонов в октаве
            int tmp = (int) note.Tone + semitons%12;
            if (tmp > (int) Tones.B) // Последняя нота в октаве
            {
                ++octave;
                tmp = tmp%12;
            }
            var tone = (Tones) (tmp);

            return new Note(octave, tone);
        }

Same methods

Note::operator ( ) : bool
Note::operator ( ) : int