Ejemplo n.º 1
0
        public void AddNote(int length, int index, string pitch, DockPanel panelToAddNote)
        {
            RollElement noteToAdd   = new RollElement();
            int         spaceToLeft = getAllLeftSpace(panelToAddNote);

            foreach (RollElement note in panelToAddNote.Children)
            {
                spaceToLeft -= ((int)note.Width + (int)note.Margin.Left);
            }

            noteToAdd.Height = 24;
            noteToAdd.Width  = length;
            noteToAdd.Margin = new Thickness(spaceToLeft, 0, 0, 0);
            noteToAdd.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            noteToAdd.Pitch = pitch;
            noteToAdd.ElementPropertiesChanged += Roll_ElementPropertiesChanged;
            noteToAdd.ElementRemoved           += Roll_ElementRemoved;
            noteToAdd.ElementSelected          += Roll_ElementSelected;
            noteToAdd.NoteIndex = index;
            noteToAdd.BPM       = baseTempo;

            panelToAddNote.Children.Insert(index - countNotesNotOnLane(panelToAddNote), noteToAdd);

            Note n = noteToAdd.ElementNote;

            n.VoiceProperties = oRead.GetVoicePropFromSampleName(n.DispName);
            noteSheet.notes.Insert(index, n);

            totalNotes++;
        }
Ejemplo n.º 2
0
 public void PlaySamp(string args)
 {
     // Play back raw sample
     try { new System.Media.SoundPlayer(noteSheet.Voicebank + "\\" + or.GetVoicePropFromSampleName(args).FileName).Play(); }
     catch (Exception ex) { Console.Out.WriteLine("e: " + ex.Message); }
 }