public KrystalPaletteScore(string scoreTitleName, CompositionAlgorithm algorithm, PageFormat pageFormat, List <Krystal> krystals, List <Palette> palettes, string folder, string keywords, string comment) : base(folder, scoreTitleName, algorithm, keywords, comment, pageFormat) { Notator = new Notator(pageFormat); bool success = CreateScore(krystals, palettes); if (success == false) { this.Systems.Clear(); } }
/// <summary> /// Called by the derived class after setting _midiAlgorithm and Notator. /// Returns false if it fails for some reason. Otherwise true. /// </summary> protected bool CreateScore(List <Krystal> krystals, List <Palette> palettes) { bool success = true; List <List <VoiceDef> > barDefsInOneSystem = _algorithm.DoAlgorithm(krystals, palettes); CheckBars(barDefsInOneSystem); CreateEmptySystems(barDefsInOneSystem, _pageFormat.VisibleInputVoiceIndicesPerStaff.Count); // one system per bar if (_pageFormat.ChordSymbolType != "none") // set by AudioButtonsControl { Notator.ConvertVoiceDefsToNoteObjects(this.Systems); FinalizeSystemStructure(); // adds barlines, joins bars to create systems, etc. /// The systems do not yet contain Metrics info. /// The systems are given Metrics inside the following function then justified internally, /// both horizontally and vertically. success = Notator.CreateMetricsAndJustifySystems(this.Systems); if (success) { success = CreatePages(); } } return(success); }