public Part genPart(CommandSelections selection) { Part part = Part.createInstance(SongInfo.createDefault(), InstrumentInfo.createDefault(), selection.BPM, selection.NumBeats, selection.BeatType); selection.SelectedPart = part; return(part); }
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; }
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)); }
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); }