private void ComboBoxes_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (!Ocupado)
         {
             ComboBox Combo = sender as ComboBox;
             if (Combo != null)
             {
                 int Índice_Instrumento = int.Parse(Combo.Name.Replace("ComboBox_", null));
                 if (Índice_Instrumento > -1 && Índice_Instrumento < 13)
                 {
                     int Milisegundo = Environment.TickCount;
                     if ((Milisegundo - Milisegundo_Anterior) >= 100) // Only allow 10 plays per second in redstone ticks.
                     {
                         Milisegundo_Anterior = Milisegundo;
                         Total_Notas++;
                         this.Text = Texto_Título + " - [Visible notes: " + Program.Traducir_Número(Total_Notas) + "]";
                         Matriz_Listas_Milisegundos[Índice_Instrumento].Add(Milisegundo);
                         Matriz_Listas_Notas[Índice_Instrumento].Add(Matriz_ComboBoxes[Índice_Instrumento].SelectedIndex);
                         Matriz_Listas_Voltear[Índice_Instrumento].Add((Variable_Voltear_Notas_Horizontalmente && Program.Rand.Next(0, 2) == 1 ? 1 : 0) | (Variable_Voltear_Notas_Verticalmente && Program.Rand.Next(0, 2) == 1 ? 2 : 0));
                         Reproductor = Reproductor_Sonidos.Cargar_Sonido(Matrices_Bytes_WAV[Índice_Instrumento].Clone() as byte[], Matriz_Porcentajes_Frecuencias[Matriz_ComboBoxes[Índice_Instrumento].SelectedIndex]);
                         if (Reproductor != null)
                         {
                             Reproductor.Play();
                         }
                     }
                 }
             }
         }
     }
     catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); Variable_Excepción_Total++; Variable_Excepción = true; }
 }
 private void Picture_MouseDown(object sender, MouseEventArgs e)
 {
     try
     {
         if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Middle)
         {
             if (!Ocupado)
             {
                 int Índice_Instrumento = e.X / 64;
                 if (Índice_Instrumento < 0)
                 {
                     Índice_Instrumento = 0;
                 }
                 else if (Índice_Instrumento > 12)
                 {
                     Índice_Instrumento = 12;
                 }
                 Matriz_ComboBoxes[Índice_Instrumento].Select();
                 Matriz_ComboBoxes[Índice_Instrumento].Focus();
                 if (e.Button == MouseButtons.Left) // Play
                 {
                     int Milisegundo = Environment.TickCount;
                     if ((Milisegundo - Milisegundo_Anterior) >= 100) // Only allow 10 plays per second in redstone ticks.
                     {
                         Milisegundo_Anterior = Milisegundo;
                         Total_Notas++;
                         this.Text = Texto_Título + " - [Visible notes: " + Program.Traducir_Número(Total_Notas) + "]";
                         Matriz_Listas_Milisegundos[Índice_Instrumento].Add(Milisegundo);
                         Matriz_Listas_Notas[Índice_Instrumento].Add(Matriz_ComboBoxes[Índice_Instrumento].SelectedIndex);
                         Matriz_Listas_Voltear[Índice_Instrumento].Add((Variable_Voltear_Notas_Horizontalmente && Program.Rand.Next(0, 2) == 1 ? 1 : 0) | (Variable_Voltear_Notas_Verticalmente && Program.Rand.Next(0, 2) == 1 ? 2 : 0));
                         Reproductor = Reproductor_Sonidos.Cargar_Sonido(Matrices_Bytes_WAV[Índice_Instrumento].Clone() as byte[], Matriz_Porcentajes_Frecuencias[Matriz_ComboBoxes[Índice_Instrumento].SelectedIndex]);
                         if (Reproductor != null)
                         {
                             Reproductor.Play();
                         }
                     }
                 }
                 else if (e.Button == MouseButtons.Middle) // Change pitch
                 {
                     if (Matriz_ComboBoxes[Índice_Instrumento].SelectedIndex < 24)
                     {
                         Matriz_ComboBoxes[Índice_Instrumento].SelectedIndex++;
                     }
                     else
                     {
                         Matriz_ComboBoxes[Índice_Instrumento].SelectedIndex = 0;
                     }
                 }
             }
         }
     }
     catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); Variable_Excepción_Total++; Variable_Excepción = true; }
 }
 private void Ventana_Afinador_Bloques_Nota_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (!e.Alt && !e.Control && !e.Shift)
         {
             if (e.KeyCode == Keys.Escape)
             {
                 e.Handled          = true;
                 e.SuppressKeyPress = true;
                 this.Close();
             }
             else if (e.KeyCode == Keys.Insert)
             {
                 e.Handled          = true;
                 e.SuppressKeyPress = true;
                 int Milisegundo = Environment.TickCount;
                 if ((Milisegundo - Milisegundo_Anterior) >= 100) // Only allow 10 plays per second in redstone ticks.
                 {
                     Milisegundo_Anterior = Milisegundo;
                     Total_Notas++;
                     this.Text = Texto_Título + " - [Visible notes: " + Program.Traducir_Número(Total_Notas) + "]";
                     int Índice_Instrumento = Program.Rand.Next(0, 13);
                     Matriz_Listas_Milisegundos[Índice_Instrumento].Add(Milisegundo);
                     Matriz_Listas_Notas[Índice_Instrumento].Add(Program.Rand.Next(0, Matriz_ComboBoxes[Índice_Instrumento].Items.Count));
                     Matriz_Listas_Voltear[Índice_Instrumento].Add((Variable_Voltear_Notas_Horizontalmente && Program.Rand.Next(0, 2) == 1 ? 1 : 0) | (Variable_Voltear_Notas_Verticalmente && Program.Rand.Next(0, 2) == 1 ? 2 : 0));
                     Reproductor = Reproductor_Sonidos.Cargar_Sonido(Matrices_Bytes_WAV[Índice_Instrumento].Clone() as byte[], Matriz_Porcentajes_Frecuencias[Matriz_ComboBoxes[Índice_Instrumento].SelectedIndex]);
                     if (Reproductor != null)
                     {
                         Reproductor.Play();
                     }
                 }
             }
         }
     }
     catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); Variable_Excepción_Total++; Variable_Excepción = true; }
 }