Interface SongFactory
public interface SongFactory
Manage the creation of Song and related components.
-
Method Summary
Modifier and TypeMethodDescriptioncreateEmptyChordLeadSheet(String sectionName, TimeSignature ts, int size, String initialChord) Create an empty chord leadsheet with the specified parameters.createEmptySong(String songName) Create a 8-bar empty song with only the 4/4 initial Section named "A" and its corresponding SongPart.createEmptySong(String songName, int nbBars, String initSectionName, TimeSignature ts, String initialChord) Create an empty song with the specified parameters.createRamdomChordLeadSheet(String sectionName, TimeSignature ts, int size) Create a ChordLeadSheet with random chord symbols and sections.createSampleChordLeadSheet(String sectionName, int size) Create a ChordLeadSheet with a fixed set of sections and chord symbols in the first 12 bars.createSong(String name, ChordLeadSheet cls) Create a Song from the specified ChordLeadSheet.createSong(String name, SongStructure sgs) Create a Song from a SongStructure and its parent ChordLeadSheet.createSong(String name, SongStructure sgs, boolean disableSongInternalUpdates) Create a Song from a SongStructure and its parent ChordLeadSheet.Create a SongStructure with cls as parentChordLeadSheet.static SongFactoryloadFromFile(File f) Load a Song from a file.
-
Method Details
-
getDefault
-
loadFromFile
Load a Song from a file.Song's getFile() will return f.
Song's getName() will return f.getName().
- Parameters:
f-- Returns:
- Throws:
SongCreationException
-
createEmptyChordLeadSheet
ChordLeadSheet createEmptyChordLeadSheet(String sectionName, TimeSignature ts, int size, String initialChord) Create an empty chord leadsheet with the specified parameters.- Parameters:
sectionName-ts-size-initialChord- e.g. "C7". If null no initial chord is added.- Returns:
-
createEmptySong
-
createEmptySong
Song createEmptySong(String songName, int nbBars, String initSectionName, TimeSignature ts, String initialChord) Create an empty song with the specified parameters.- Parameters:
songName- The name of the songnbBars-initSectionName- The name of the initial sectionts- The time signature of the initial sectioninitialChord- eg "Cm7". A string describing an initial chord to be put at the start of the song. If null no chord is inserted.- Returns:
-
createRamdomChordLeadSheet
Create a ChordLeadSheet with random chord symbols and sections.- Parameters:
sectionName-ts-size-- Returns:
-
createSampleChordLeadSheet
Create a ChordLeadSheet with a fixed set of sections and chord symbols in the first 12 bars.- Parameters:
sectionName-size- Must be >= 12- Returns:
-
createSong
Create a Song from the specified ChordLeadSheet.The SongStructure is created from the ChordLeadSheet.
- Parameters:
name-cls-- Returns:
- Throws:
UnsupportedEditException- Can happen if too many timesignature changes resulting in not enough Midi channels for the various rhythms.
-
createSong
Create a Song from a SongStructure and its parent ChordLeadSheet.- Parameters:
name-sgs- sgs.getParentChordLeadSheet() must be non null- Returns:
- Throws:
UnsupportedEditException- Can happen if too many timesignature changes resulting in not enough Midi channels for the various rhythms.
-
createSong
Song createSong(String name, SongStructure sgs, boolean disableSongInternalUpdates) throws UnsupportedEditException Create a Song from a SongStructure and its parent ChordLeadSheet.- Parameters:
name-sgs- sgs.getParentChordLeadSheet() must be non nulldisableSongInternalUpdates- If true the returned instance will have internal consistency updates disabled, e.g. changing a section in the ChordLeadSheet won't impact the SongStructure. For special purposes only, this can lead to inconsistent Song states..- Returns:
- Throws:
UnsupportedEditException- Can happen if too many timesignature changes resulting in not enough Midi channels for the various rhythms.
-
createSongStructure
Create a SongStructure with cls as parentChordLeadSheet.One SongPart is created for each cls section.
- Parameters:
cls-- Returns:
- Throws:
UnsupportedEditException
-