Пример #1
0
        public Part genPart(CommandSelections selection)
        {
            Part part = Part.createInstance(SongInfo.createDefault(), InstrumentInfo.createDefault(), selection.BPM, selection.NumBeats, selection.BeatType);

            selection.SelectedPart = part;
            return(part);
        }
Пример #2
0
        private Part(SongInfo song, InstrumentInfo instrument, int bpm, TimeSignature time_sig, PositionedModelCollection <Measure> collection)
        {
            SongInfo       = song;
            InstrumentInfo = instrument;

            DefaultBPM      = bpm;
            TimeSignature   = time_sig;
            ModelCollection = collection;
        }
Пример #3
0
        public static Part createInstance(SongInfo song, InstrumentInfo instrument, int?bpm, int?num_beats, NoteLength?beat_type)
        {
            if (song == null || instrument == null || bpm == null || num_beats == null || beat_type == null)
            {
                return(null);
            }

            var time_sig   = TimeSignature.createInstance((int)num_beats, (NoteLength)beat_type);
            var collection = new PositionedModelCollection <Measure>();

            return(new Part(song, instrument, (int)bpm, time_sig, collection));
        }
Пример #4
0
        public Part createPart(ReaderInfo info)
        {
            var song_info       = new SongInfo(SongName, ArtistName, AlbumName);
            var instrument_info = new InstrumentInfo((InstrumentType)InstrumentType, NumStrings);
            var part            = Part.createInstance(song_info, instrument_info, BPM, NumBeats, (NoteLength)BeatLength);

            foreach (var s_measure in Measures)
            {
                part?.Add(s_measure.createMeasure(info));
            }

            foreach (var effect in Effects)
            {
                info.readInMultiEffect(effect);
            }
            info.createMultiEffects();
            return(part);
        }