コード例 #1
0
    // Start is called before the first frame update
    protected override void Start()
    {
        base.Start();
        if (cam == null)
        {
            cam = Camera.main;
        }

        playerDodge              = GetComponent <DodgeController>();
        playerTalentController   = GetComponent <PlayerTalentController>();
        playerMovementController = GetComponent <LandMovementController>();
        tonic = GetComponent <Tonic>();

        canCharacterAction = true;
    }
コード例 #2
0
        public CounterpointAnalysis(string path, CounterpointSpecie selectedSpecie, Mode mode, Tonic tonic, int cantusFirmusId)
        {
            MidiFile file = MidiFile.Read(path);

            Piece                   = new Piece(file);
            SelectedSpecie          = selectedSpecie;
            CounterpointCommentsLog = new List <string>();
            Mode           = mode;
            Tonic          = tonic;
            Scale          = GetScale(mode, tonic);
            CantusFirmusId = cantusFirmusId;

            if (CantusFirmusId >= Piece.VoiceLines.Count)
            {
                CounterpointCommentsLog.Add("Detected number of voices: " + Piece.VoiceLines.Count.ToString() + "."
                                            + " Selected Cantus Firmus with smaller voice number.");
                return;
            }

            foreach (var voiceline in Piece.VoiceLines)
            {
                voiceline.PopulateHorizontalIntervals();
            }
            Piece.PopulateVerticalIntervals();

            //Logi do debugowania
            log.WriteLog(SelectedSpecie.ToUserFriendlyString());

            foreach (var a in Piece.VoiceLines[CantusFirmusId].VerticalIntervals)
            {
                log.WriteLog("VoiceVerticalitnerval");
                int i = 0;
                foreach (var b in a)
                {
                    log.WriteLog((b % 12).ToString());
                    log.WriteLog(Piece.VoiceLines[CantusFirmusId].NotesUngrouped[i].ToString());
                    log.WriteLog(Piece.VoiceLines[0].NotesUngrouped[i].ToString());
                    log.WriteLog(GetNamedInterval((b % 12)).ToString());

                    if (i + 1 < Piece.VoiceLines[CantusFirmusId].NotesUngrouped.Count())
                    {
                        i++;
                    }
                }
            }

            RunCounterpointAnalysis(Piece, SelectedSpecie);
        }
コード例 #3
0
        public override string ToString()
        {
            string bass      = string.Empty;
            string addition2 = string.Empty;

            if (Bass != null)
            {
                bass = string.Format("/{0}", Bass.ToString());
            }

            if (Addition2 != Addition.None)
            {
                addition2 = string.Format("({0})", Addition2.Symbol());
            }

            return(Tonic.ToString() + Tonality.Symbol() + Addition1.Symbol() + addition2 + bass);
        }
コード例 #4
0
        public static void Main(string[] args)
        {
            Scale       scale = new Scale();
            Tonic       tonic = new Tonic(scale);
            Subdominant subD  = new Subdominant(scale);
            Dominant    dom   = new Dominant(scale);

            scale.SetDiatonicScale(new string[] { "C", "D", "E", "F", "G", "A", "B" });

            scale.RemoveObserver(tonic);
            scale.RemoveObserver(subD);
            Submediant subM = new Submediant(scale);

            scale.SetDiatonicScale(new string[] { "Ab", "Bb", "C", "Db", "Eb", "F", "G" });

            Console.ReadLine();
        }
コード例 #5
0
        private List <int> GetScale(Mode mode, Tonic tonic)
        {
            //Ionian mode
            List <int> sequence = new List <int> {
                2, 2, 1, 2, 2, 2, 1
            };

            for (int i = 0; i < (int)mode; i++)
            {
                sequence.Add(sequence[0]);
                sequence.RemoveAt(0);
            }

            for (int i = 1; i < sequence.Count; i++)
            {
                sequence[i] += sequence[i - 1];
            }
            return(sequence);
        }
コード例 #6
0
 public KeySignature(Tonic tonic, Scale scale)
 {
     Tonic = tonic;
     Scale = scale;
 }
コード例 #7
0
ファイル: Scale.cs プロジェクト: olejorgensen/midi-dot-net-1
 /// <summary>
 ///     Hash code.
 /// </summary>
 public override int GetHashCode()
 {
     return(Tonic.GetHashCode() + Pattern.GetHashCode());
 }
コード例 #8
0
 // Start is called before the first frame update
 void Start()
 {
     playerHealth = player.GetComponent <Health>();
     playerTonic  = player.GetComponent <Tonic>();
     manaScript   = player.GetComponent <Mana>();
 }