Ejemplo n.º 1
0
 public Harmonic(double amplitude, double frequency, double phase, HarmonicType harmonicKind)
 {
     _amplitude    = amplitude;
     _frequency    = frequency;
     _phase        = phase;
     _harmonicKind = harmonicKind;
 }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 3
0
 public Harmonic()
 {
     _harmonicKind = HarmonicType.Sin;
     _amplitude    = 1;
     _frequency    = 1;
     _phase        = 0;
 }
Ejemplo n.º 4
0
 public Harmonic(HarmonicType type, float amplitude, float frequency, float phase)
 {
     Type      = type;
     Amplitude = amplitude;
     Frequency = frequency;
     Phase     = phase;
 }
Ejemplo n.º 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]);
                }
            }
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 7
0
 public void UpdateSelectedHarmonicType(HarmonicType type)
 {
     if (!_harmonicsContainer.IsEmpty())
     {
         _harmonicsContainer.GetHarmonicByIndex(_harmonicsContainer.ActiveHarmonicIndex).Type = type;
     }
 }
Ejemplo n.º 8
0
 public void SetHarmonicType(HarmonicType harmonicType)
 {
     _harmonicType = harmonicType;
     if (_observerHarmoic != null)
     {
         _observerHarmoic.PropertyChanges();
     }
 }
Ejemplo n.º 9
0
 public void SetHarmonicKind(HarmonicType harmonicKind)
 {
     _harmonicKind = harmonicKind;
     if (_observer != null)
     {
         _observer.HarmonicPropertiesChanged();
     }
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 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 "";
 }
Ejemplo n.º 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("");
        }
Ejemplo n.º 15
0
 public void SetHarmonicKind(HarmonicType kind)
 {
     _harmonic.SetHarmonicKind(kind);
 }
Ejemplo n.º 16
0
 public void SetNewHarmonicKind(int index, HarmonicType value)
 {
     _harmonicContainer.GetAllHarmonic() [index].SetHarmonicKind(value);
 }
Ejemplo n.º 17
0
 public void SetHarmonicType(int index, HarmonicType value)
 {
     _harmonicContainer.GetHarmonics()[index].SetHarmonicType(value);
 }
Ejemplo n.º 18
0
 public void SetHarmonicType(HarmonicType harmonicType)
 {
     _harmonic.SetHarmonicType(harmonicType);
 }
Ejemplo n.º 19
0
 public void ChangeHarmonicType(HarmonicType value)
 {
     _harmonic.Type = value;
 }