private void button11_Click(object sender, EventArgs e)
        {
            noteA_Long[1].Play();
               sp.AddNote(4); if (CheckSong(0) > 0) { noteA_Short[1].PlaySync(); }

               {

               }
               if (CheckSong(0) > 0)
               {
               silence.PlaySync();songForm = new SongForm(CheckSong());songForm.Show();
               PlaySong();sp = new Song();
               }
        }
        private void button123_Click(object sender, EventArgs e)
        {
            noteD_Med[0].Play();
            sp.AddNote(8); if (CheckSong(0) > 0) { noteD_Med[0].PlaySync(); }

            if (CheckSong(0) > 0)
            {

                silence.PlaySync();songForm = new SongForm(CheckSong());songForm.Show();
                PlaySong();sp = new Song();
            }
        }
        private void WiimoteListener()
        {
            pullNunchukJoystick(p1);
            if (Home_Pressed(p1))
            {
                if (About.ActiveForm.Equals(null) == false)
                    About.ActiveForm.Close();
                else if (SongForm.ActiveForm.Equals(null) == false)
                    SongForm.ActiveForm.Close();
                else
                    this.Close();
            }
            if (nunchuk_Y > 30)
            {
                if (A_Pressed(p1))
                {
                    noteD2_Loop[0].PlayLooping();
                    sp.AddNote(1);

                    if (CheckSong(0) > 0)
                    {
                        noteD2_Loop[0].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (B_Pressed(p1)) // (B)
                {
                    noteB_Loop[0].PlayLooping();
                    sp.AddNote(3);

                    if (CheckSong(0) > 0)
                    {
                        noteB_Loop[0].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                        sp = new Song();
                    }
                }
                if (Minus_Pressed(p1)) // (A)
                {
                    noteA_Loop[0].PlayLooping();
                    sp.AddNote(4);

                    if (CheckSong(0) > 0)
                    {
                        noteA_Loop[0].PlaySync();
                        silence.PlaySync();
                        songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song(); sp = new Song();
                    }
                }
                if (Plus_Pressed(p1)) // (F)
                {
                    noteF_Loop[0].PlayLooping();
                    sp.AddNote(6);

                    if (CheckSong(0) > 0)
                    {
                        noteF_Loop[0].PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (Z_Pressed(p1)) // (D)
                {
                    noteD_Loop[0].PlayLooping();
                    sp.AddNote(8);

                    if (CheckSong(0) > 0)
                    {
                        noteD_Loop[0].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
            }
            if (nunchuk_Y > 10 && nunchuk_Y <= 30)
            {
                if (A_Pressed(p1))
                {
                    noteD2_Loop[1].PlayLooping();
                    sp.AddNote(1);

                    if (CheckSong(0) > 0)
                    {
                        noteD2_Loop[1].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (B_Pressed(p1)) // (B)
                {
                    noteB_Loop[1].PlayLooping();
                    sp.AddNote(3);

                    if (CheckSong(0) > 0)
                    {
                        noteB_Loop[1].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                        sp = new Song();
                    }
                }
                if (Minus_Pressed(p1)) // (A)
                {
                    noteA_Loop[1].PlayLooping();
                    sp.AddNote(4);

                    if (CheckSong(0) > 0)
                    {
                        noteA_Loop[1].PlaySync();
                        silence.PlaySync();
                        songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song(); sp = new Song();
                    }
                }
                if (Plus_Pressed(p1)) // (F)
                {
                    noteF_Loop[1].PlayLooping();
                    sp.AddNote(6);

                    if (CheckSong(0) > 0)
                    {
                        noteF_Loop[1].PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (Z_Pressed(p1)) // (D)
                {
                    noteD_Loop[1].PlayLooping();
                    sp.AddNote(8);

                    if (CheckSong(0) > 0)
                    {
                        noteD_Loop[1].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
            }
            if (nunchuk_Y > -10 && nunchuk_Y <= 10)
            {
                if (A_Pressed(p1))
                {
                    noteD2_Loop[2].PlayLooping();
                    sp.AddNote(1);

                    if (CheckSong(0) > 0)
                    {
                        noteD2_Loop[2].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (B_Pressed(p1)) // (B)
                {
                    noteB_Loop[2].PlayLooping();
                    sp.AddNote(3);

                    if (CheckSong(0) > 0)
                    {
                        noteB_Loop[2].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                        sp = new Song();
                    }
                }
                if (Minus_Pressed(p1)) // (A)
                {
                    noteA_Loop[2].PlayLooping();
                    sp.AddNote(4);

                    if (CheckSong(0) > 0)
                    {
                        noteA_Loop[2].PlaySync();
                        silence.PlaySync();
                        songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song(); sp = new Song();
                    }
                }
                if (Plus_Pressed(p1)) // (F)
                {
                    noteF_Loop[2].PlayLooping();
                    sp.AddNote(6);

                    if (CheckSong(0) > 0)
                    {
                        noteF_Loop[2].PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (Z_Pressed(p1)) // (D)
                {
                    noteD_Loop[2].PlayLooping();
                    sp.AddNote(8);

                    if (CheckSong(0) > 0)
                    {
                        noteD_Loop[2].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
            }
            if (nunchuk_Y > -30 && nunchuk_Y <= -10)
            {
                if (A_Pressed(p1))
                {
                    noteD2_Loop[3].PlayLooping();
                    sp.AddNote(1);

                    if (CheckSong(0) > 0)
                    {
                        noteD2_Loop[3].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (B_Pressed(p1)) // (B)
                {
                    noteB_Loop[3].PlayLooping();
                    sp.AddNote(3);

                    if (CheckSong(0) > 0)
                    {
                        noteB_Loop[3].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                        sp = new Song();
                    }
                }
                if (Minus_Pressed(p1)) // (A)
                {
                    noteA_Loop[3].PlayLooping();
                    sp.AddNote(4);

                    if (CheckSong(0) > 0)
                    {
                        noteA_Loop[3].PlaySync();
                        silence.PlaySync();
                        songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song(); sp = new Song();
                    }
                }
                if (Plus_Pressed(p1)) // (F)
                {
                    noteF_Loop[3].PlayLooping();
                    sp.AddNote(6);

                    if (CheckSong(0) > 0)
                    {
                        noteF_Loop[3].PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (Z_Pressed(p1)) // (D)
                {
                    noteD_Loop[3].PlayLooping();
                    sp.AddNote(8);

                    if (CheckSong(0) > 0)
                    {
                        noteD_Loop[3].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
            }
            if (nunchuk_Y <= -30)
            {
                if (A_Pressed(p1))
                {
                    noteD2_Loop[4].PlayLooping();
                    sp.AddNote(1);

                    if (CheckSong(0) > 0)
                    {
                        noteD2_Loop[4].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (B_Pressed(p1)) // (B)
                {
                    noteB_Loop[4].PlayLooping();
                    sp.AddNote(3);

                    if (CheckSong(0) > 0)
                    {
                        noteB_Loop[4].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                        sp = new Song();
                    }
                }
                if (Minus_Pressed(p1)) // (A)
                {
                    noteA_Loop[4].PlayLooping();
                    sp.AddNote(4);

                    if (CheckSong(0) > 0)
                    {
                        noteA_Loop[4].PlaySync();
                        silence.PlaySync();
                        songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song(); sp = new Song();
                    }
                }
                if (Plus_Pressed(p1)) // (F)
                {
                    noteF_Loop[4].PlayLooping();
                    sp.AddNote(6);

                    if (CheckSong(0) > 0)
                    {
                        noteF_Loop[4].PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
                if (Z_Pressed(p1)) // (D)
                {
                    noteD_Loop[4].PlayLooping();
                    sp.AddNote(8);

                    if (CheckSong(0) > 0)
                    {
                        noteD_Loop[4].PlaySync();
                        silence.PlaySync();
                        silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                        PlaySong(); sp = new Song();
                    }
                }
            }
            // A button is D2
            // B button is B
            // Minus is A
            // Plus is F
            // Z is D
        }
 // Notes Values:
 // D2   = 1;
 // C    = 2;
 // B    = 3;
 // A    = 4;
 // G    = 5;
 // F    = 6;
 // E    = 7;
 // D    = 8;
 public void addSongs()
 {
     s_time      = new Song(time, "the Song of Time", A, D, F, A, D, F);
     s_saria     = new Song(saria, "Saria\'s Song", F, A, B, F, A, B);
     s_epona     = new Song(epona, "Epona\'s Song", D2, B, A, D2, B, A);
     s_storm     = new Song(storm, "the Song of Storms", D, F, D2, D, F, D2);
     s_zelda     = new Song(zelda, "Zelda\'s Lullaby", B, D2, A, B, D2, A);
     s_sun       = new Song(sun, "the Sun\'s Song", A, F, D2, A, F, D2);
     s_light     = new Song(light, "the Prelude of Light", D2, A, D2, A, B, D2);
     s_forest    = new Song(forest, "the Minuet of Forest", D, D2, B, A, B, A);
     s_fire      = new Song(fire, "the Bolero of Fire", F, D, F, D, A, F, A, F);
     s_water     = new Song(water, "the Serenade of Water", D, F, A, A, B);
     s_shadow    = new Song(shadow, "the Nocturn of Shadow", B, A, A, D, B, A, F);
     s_spirit    = new Song(spirit, "the Requiem of Spirit", D, F, D, A, F, D);
     s_heal      = new Song(heal, "the Song of Healing", B, A, F, B, A, F);
     s_soar      = new Song(soar, "the Song of Soaring", F, B, D2, F, B, D2);
     s_time2x    = new Song(time2x, "the Song of Double Time", A, A, D, D, F, F);
     s_half      = new Song(half, "the Inverted Song of Time", D, A, F, D, A, F);
     s_awake     = new Song(awake, "the Sonata of Awakening", D2, B, D2, B, D, A, D);
     s_goron     = new Song(goron, "the Goron Lullaby", D, A, B, D, A, B, A, D);
     s_wave      = new Song(wave, "New Wave Bossa Nova", B, D2, B, A, F, B, A);
     s_empty     = new Song(empty, "the Elegy of Emptiness", A, B, A, F, A, D2, B);
     s_order     = new Song(order, "the Oath to Order", A, F, D, F, A, D2);
 }
        private void button79_Click(object sender, EventArgs e)
        {
            noteB_Short[2].Play();
               sp.AddNote(3); if (CheckSong(0) > 0) { noteB_Short[2].PlaySync(); }
            if (CheckSong(0) > 0)
            {

                silence.PlaySync();songForm = new SongForm(CheckSong());songForm.Show();
                PlaySong();sp = new Song();
            }
        }
        private void button50_Click(object sender, EventArgs e)
        {
            noteF_Long[8].Play();
            sp.AddNote(6); if (CheckSong(0) > 0) { noteF_Loop[4].PlaySync(); }

            if (CheckSong(0) > 0)
            {

                silence.PlaySync(); songForm = new SongForm(CheckSong()); songForm.Show();
                PlaySong(); sp = new Song();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            noteA_Frog.Play();
            sp.AddNote(4);if(CheckSong(0) > 0){noteA_Frog.PlaySync();}

            if (CheckSong(0) > 0)
            {

                songForm = new SongForm(CheckSong()); songForm.Show();
                PlaySong(); sp = new Song();
            }
        }
        private void button150_Click(object sender, EventArgs e)
        {
            noteA_Loop[0].PlayLooping();
            sp.AddNote(4);

            if (CheckSong(0) > 0)
            {
                noteA_Loop[0].PlaySync();
                silence.PlaySync();
                songForm = new SongForm(CheckSong());songForm.Show();
                PlaySong();sp = new Song();sp = new Song();
            }
        }
Exemple #9
0
        // Notes Values:
        // D2   = 1;
        // C    = 2;
        // B    = 3;
        // A    = 4;
        // G    = 5;
        // F    = 6;
        // E    = 7;
        // D    = 8;
        //
        public bool CompareSong(Song target)
        {
            if (target.GetLastNote() == GetLastNote())
            {
                if (target.GetSecondNote() == GetSecondNote())
                {
                    if (target.GetNumberNotes() == 2)
                    {
                        return true;
                    }
                    else if (target.GetThirdNote() == GetThirdNote())
                    {
                        if (target.GetNumberNotes() == 3)
                        {
                            return true;
                        }
                        else if (target.GetFourthNote() == GetFourthNote())
                        {
                            if (target.GetNumberNotes() == 4)
                            {
                                return true;
                            }
                            else if (target.GetFifthNote() == GetFifthNote())
                            {
                                if (target.GetNumberNotes() == 5)
                                {
                                    return true;
                                }
                                else if (target.GetSixthNote() == GetSixthNote())
                                {
                                    if (target.GetNumberNotes() == 6)
                                    {
                                        return true;
                                    }
                                    else if (target.GetSeventhNote() == GetSeventhNote())
                                    {
                                        if (target.GetNumberNotes() == 7)
                                        {
                                            return true;
                                        }
                                        else if (target.GetEighthNote() == GetEighthNote())
                                        {
                                            return true;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            return false;
        }