예제 #1
0
 public Harmonic(double amplitude, double frequency, double phase, HarmonicType harmonicKind)
 {
     _amplitude    = amplitude;
     _frequency    = frequency;
     _phase        = phase;
     _harmonicKind = harmonicKind;
 }
예제 #2
0
        public HarmonicsEffectInfo(HarmonicType harmonicType)
        {
            _harmonicType = harmonicType;
            switch (harmonicType)
            {
            case HarmonicType.Natural:
                _effectId = "harmonics-natural";
                break;

            case HarmonicType.Artificial:
                _effectId = "harmonics-artificial";
                break;

            case HarmonicType.Pinch:
                _effectId = "harmonics-pinch";
                break;

            case HarmonicType.Tap:
                _effectId = "harmonics-tap";
                break;

            case HarmonicType.Semi:
                _effectId = "harmonics-semi";
                break;

            case HarmonicType.Feedback:
                _effectId = "harmonics-feedback";
                break;
            }
        }
예제 #3
0
 public Harmonic()
 {
     _harmonicKind = HarmonicType.Sin;
     _amplitude    = 1;
     _frequency    = 1;
     _phase        = 0;
 }
예제 #4
0
 public Harmonic(HarmonicType type, float amplitude, float frequency, float phase)
 {
     Type      = type;
     Amplitude = amplitude;
     Frequency = frequency;
     Phase     = phase;
 }
예제 #5
0
        public Tonality(HarmonicType type, bool[] mask, int shift = 0)
        {
            string[] nameOfNotes = new string[] { "C", "Cs", "D", "Ds", "E", "F",
                                                  "Fs", "G", "Gs", "A", "As", "B" };


            if (type == HarmonicType.Major)
            {
                name = nameOfNotes[shift];
            }
            else
            {
                name = nameOfNotes[shift] + "m";
            }

            notes = new Note[7];

            for (int i = 0, j = shift, notesFound = 0; i < mask.Length; i++, j++)
            {
                if (j + 1 > mask.Length)
                {
                    j = 0;
                }
                if (mask[i])
                {
                    notes[notesFound++] = new Note(nameOfNotes[j]);
                }
            }
        }
예제 #6
0
 public Harmonic(double amplitude = 0, double frequency = 0, double phase = 0, HarmonicType harmonicType = HarmonicType.Sin)
 {
     Amplitude = amplitude;
     Frequency = frequency;
     Phase     = phase;
     Type      = harmonicType;
 }
예제 #7
0
 public void UpdateSelectedHarmonicType(HarmonicType type)
 {
     if (!_harmonicsContainer.IsEmpty())
     {
         _harmonicsContainer.GetHarmonicByIndex(_harmonicsContainer.ActiveHarmonicIndex).Type = type;
     }
 }
예제 #8
0
 public void SetHarmonicType(HarmonicType harmonicType)
 {
     _harmonicType = harmonicType;
     if (_observerHarmoic != null)
     {
         _observerHarmoic.PropertyChanges();
     }
 }
예제 #9
0
 public void SetHarmonicKind(HarmonicType harmonicKind)
 {
     _harmonicKind = harmonicKind;
     if (_observer != null)
     {
         _observer.HarmonicPropertiesChanged();
     }
 }
예제 #10
0
 protected override bool ShouldCreateGlyphForNote(EffectBarRenderer renderer, Note note)
 {
     if (!note.IsHarmonic) return false;
     if (note.Beat != _beat || note.HarmonicType > _beatType)
     {
         _beatType = note.HarmonicType;
     }
     return true;
 }
 protected override bool ShouldCreateGlyphForNote(EffectBarRenderer renderer, Note note)
 {
     if (!note.IsHarmonic)
     {
         return(false);
     }
     if (note.Beat != _beat || note.HarmonicType > _beatType)
     {
         _beatType = note.HarmonicType;
     }
     return(true);
 }
예제 #12
0
        public void GetValueByTime_DifferentTestData_GetExpectedValue(
            double amplitude,
            HarmonicType harmonicType,
            double frequency,
            double t,
            double phase,
            double expected)
        {
            // Arrange
            var harmonic = new Harmonic(amplitude, frequency, phase, harmonicType);

            // Act
            double result = harmonic.GetValueByTime(t);

            // Assert
            Assert.True(DoubleUtils.EqualsDoubles(expected, result));
        }
예제 #13
0
 public static string HarmonicToString(HarmonicType type)
 {
     switch (type)
     {
         case HarmonicType.Natural:
             return "N.H.";
         case HarmonicType.Artificial:
             return "A.H.";
         case HarmonicType.Pinch:
             return "P.H.";
         case HarmonicType.Tap:
             return "T.H.";
         case HarmonicType.Semi:
             return "S.H.";
         case HarmonicType.Feedback:
             return "Fdbk.";
     }
     return "";
 }
예제 #14
0
        public static string HarmonicToString(HarmonicType type)
        {
            switch (type)
            {
            case HarmonicType.Natural:
                return("N.H.");

            case HarmonicType.Artificial:
                return("A.H.");

            case HarmonicType.Pinch:
                return("P.H.");

            case HarmonicType.Tap:
                return("T.H.");

            case HarmonicType.Semi:
                return("S.H.");

            case HarmonicType.Feedback:
                return("Fdbk.");
            }
            return("");
        }
예제 #15
0
 public void SetHarmonicKind(HarmonicType kind)
 {
     _harmonic.SetHarmonicKind(kind);
 }
예제 #16
0
 public void SetNewHarmonicKind(int index, HarmonicType value)
 {
     _harmonicContainer.GetAllHarmonic() [index].SetHarmonicKind(value);
 }
예제 #17
0
 public void SetHarmonicType(int index, HarmonicType value)
 {
     _harmonicContainer.GetHarmonics()[index].SetHarmonicType(value);
 }
예제 #18
0
 public void SetHarmonicType(HarmonicType harmonicType)
 {
     _harmonic.SetHarmonicType(harmonicType);
 }
예제 #19
0
 public void ChangeHarmonicType(HarmonicType value)
 {
     _harmonic.Type = value;
 }