Beispiel #1
0
        private void DoNote()
        {
            DomainModel.Note cr = (DomainModel.Note)currentNote;

            if (cr.Pitch == "")
            {
                Rest r = new Rest(durriation[cr.Duration]);
                r.NumberOfDots = cr.Dotted;
                symbols.Add(r);
                return;
            }

            PSAMControlLibrary.Note n = new PSAMControlLibrary.Note(cr.Pitch.ToUpper(), semitones[cr.Semitone], 2 + cr.Octave, durriation[cr.Duration],
                                                                    NoteStemDirection.Up, NoteTieType.None,
                                                                    new List <NoteBeamType>()
            {
                NoteBeamType.Single
            });
            n.NumberOfDots = cr.Dotted;

            float count = 1 / cr.Duration;
            float dur   = (float)((Math.Pow(2, cr.Dotted) - 1) / Math.Pow(2, cr.Dotted)) + 1;

            barlinecount += (count * dur);
            symbols.Add(n);
        }
Beispiel #2
0
 private bool ClefHasChanged(DomainModel.Note c)
 {
     if (c.Clef == null)
     {
         return(false);
     }
     return(c.Clef.key != this.clef.key);
 }
Beispiel #3
0
 private bool TimeSigHasChanged(DomainModel.Note c)
 {
     if (c.TimeSignature == null)
     {
         return(false);
     }
     return(this.timeSignature.NumberOfBeats != c.TimeSignature.NumberOfBeats || this.timeSignature.TimeOfBeats != c.TimeSignature.TimeOfBeats);
 }
Beispiel #4
0
        private void DoTimesig()
        {
            if (currentNote.GetType() != typeof(DomainModel.Note))
            {
                return;
            }
            DomainModel.Note c = (DomainModel.Note)currentNote;

            if (!TimeSigHasChanged(c))
            {
                return;
            }
            this.timeSignature.TimeOfBeats   = c.TimeSignature.TimeOfBeats;
            this.timeSignature.NumberOfBeats = c.TimeSignature.NumberOfBeats;
            symbols.Add(new PSAMControlLibrary.TimeSignature(TimeSignatureType.Numbers, (uint)c.TimeSignature.NumberOfBeats, (uint)c.TimeSignature.TimeOfBeats));
        }
Beispiel #5
0
        public void DoRepeat()
        {
            DomainModel.BarLine br = (DomainModel.BarLine)currentNote;

            Barline b = new Barline();


            if (br.Type == BarLine.TYPE.REPEAT)
            {
                int     alt      = 1;
                Barline startAlt = new Barline();
                startAlt.AlternateRepeatGroup = alt;
                symbols.Add(startAlt);

                for (int i = 0; i < br.Alternatives.Count; i++)
                {
                    Symbol temp = br.Alternatives[i];
                    while (temp != null)
                    {
                        DomainModel.Note        cr = (DomainModel.Note)temp;
                        PSAMControlLibrary.Note n  = new PSAMControlLibrary.Note(cr.Pitch.ToUpper(), 0, 2 + cr.Octave, durriation[cr.Duration],
                                                                                 NoteStemDirection.Up, NoteTieType.None,
                                                                                 new List <NoteBeamType>()
                        {
                            NoteBeamType.Single
                        });
                        symbols.Add(n);
                        temp = temp.nextSymbol;
                    }

                    if (i == 0)
                    {
                        alt++;
                        Barline blt = new Barline();
                        blt.RepeatSign           = RepeatSignType.Backward;
                        blt.AlternateRepeatGroup = alt;
                        symbols.Add(blt);

                        continue;
                    }
                }
                return;
            }
            b.RepeatSign = reapeatType[br.Type];
            symbols.Add(b);
            barlinecount = 0;
        }
Beispiel #6
0
        private void DoClef()
        {
            if (currentNote.GetType() != typeof(DomainModel.Note))
            {
                return;
            }
            DomainModel.Note c = (DomainModel.Note)currentNote;

            if (!ClefHasChanged(c))
            {
                return;
            }

            symbols.Add(new PSAMControlLibrary.Clef(clefs[c.Clef.key], 2));

            this.clef.key = c.Clef.key;
        }