Exemplo n.º 1
0
        //### Methods
        public void CreateComposition(MusicDataObject.MusicDataObject musicDataObject)
        {
            //Methode erstellt eine Komposition
            Temperament            temperament    = GetTemperament(musicDataObject.Temperament);
            List <TempoIndication> tempi          = GetTempi(musicDataObject.TempoIndications);
            List <TimeSignature>   timeSignatures = GetTimeSignatures(musicDataObject.TimeSignatures);
            List <Instrument>      instruments    = GetInstrumentsAndNotes(musicDataObject);
            int baseFrequency = musicDataObject.BaseFrequency;

            Composition = new Composition(temperament, baseFrequency, tempi, timeSignatures, instruments);
        }
Exemplo n.º 2
0
        //## Methods - Help
        private List <Instrument> GetInstrumentsAndNotes(MusicDataObject.MusicDataObject musicDataObject)
        {
            //Hilfsmethode zum Erstellen einer Composition
            List <Instrument> instruments = new List <Instrument>();

            foreach (Channel channel in musicDataObject.Channels)
            {
                List <Note> notes = new List <Note>();
                notes = GetNotes(channel.Notes);
                Instrument instrument = new Instrument(channel.Name, notes);
                instruments.Add(instrument);
            }
            return(instruments);
        }