Class StylePart
For each source Midi channel, store ctab data and SourcePhraseSets.
SourcePhraseSets are stored per ComplexityLevel. There can be several SourcePhraseSets variations for one complexity level.
Standard Yamaha styles use only one variation at the default complexity level.
Cntt data is discarded because not used in this version.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSourcePhraseSet(SourcePhraseSet sps, int complexity) Add a SourcePhraseSet for the specified complexity level.voidclearMusicData(int complexityLevel) Remove the music data for the specified complexity level.voiddump(boolean showMusicData, boolean showCtab) getAccType(int channel) Get the AccType for a specified channel (which can be a "secondary" source channel or the "main" one).The AccParts used by this object, in ascending channel order.The complexity levels for which there is at least 1 SourcePhraseSet.getCtabChannelSettings(int channel) Get this StylePart's CtabChannelSettings for the specified channel.floatGet the size of this stylepart.getSourceChannels(AccType at, Note rootNote, YamChord yc) Get the source channels matching the parameters.getSourcePhraseSet(int complexity, int variationIndex) Get the SourcePhraseSet for the specified parameters.getSourcePhraseSet(int complexity, String propName, String propValue) Get the SourcePhraseSet which match the specified parameters.getSourcePhraseSets(int complexity) Get the list of SourcePhraseSets for the specified complexity.getType()booleanCheck if music data has been loaded for this StylePart.voidsetCtabChannelSettings(int channel, CtabChannelSettings cTab) Set the StylePart's CtabChannelSettings for the specified channel.voidsetSizeInBeats(float sizeInBeats) Set the size of this stylepart : must be consistent with the actual source phrases size.toString()
-
Field Details
-
DEFAULT_COMPLEXITY_LEVEL
public static final int DEFAULT_COMPLEXITY_LEVEL- See Also:
-
-
Constructor Details
-
StylePart
Create a StylePart of specified type.StylePart is initialized with 1 SourcePhraseSet at DEFAULT_COMPLEXITY_LEVEL.
- Parameters:
t-
-
-
Method Details
-
getType
-
getCtabChannelSettings
Get this StylePart's CtabChannelSettings for the specified channel.- Parameters:
channel-- Returns:
-
setCtabChannelSettings
Set the StylePart's CtabChannelSettings for the specified channel.- Parameters:
channel-cTab-
-
getSizeInBeats
public float getSizeInBeats()Get the size of this stylepart.NOTE: might be 0 if music data has not been loaded yet (see isMusicLoaded()).
- Returns:
-
setSizeInBeats
public void setSizeInBeats(float sizeInBeats) Set the size of this stylepart : must be consistent with the actual source phrases size.- Parameters:
sizeInBeats- Must be an integer value.
-
addSourcePhraseSet
Add a SourcePhraseSet for the specified complexity level.There can be several SourcePhraseSets variations for a given complexity level. Size in beats of the source phrases must be consistent with getSizeInBeats().
- Parameters:
sps-complexity- An integer > 0
-
getComplexityLevels
-
getSourcePhraseSet
Get the SourcePhraseSet for the specified parameters.- Parameters:
complexity- An integer > 0variationIndex- The index of the variation phrase >=0- Returns:
- Can be null
-
getSourcePhraseSet
Get the SourcePhraseSet which match the specified parameters.- Parameters:
complexity-propName- the name of the property to checkpropValue- The value of the of the property to check. Can be null to check if property is not set.- Returns:
- Null if not found
-
getSourcePhraseSets
Get the list of SourcePhraseSets for the specified complexity.- Parameters:
complexity-- Returns:
-
isMusicLoaded
public boolean isMusicLoaded()Check if music data has been loaded for this StylePart.- Returns:
- True if there is at least one non-empty SourcePhraseSet for a given complexity level with one SourcePhrase inside.
-
clearMusicData
public void clearMusicData(int complexityLevel) Remove the music data for the specified complexity level.This calls clear() on each SourcePhraseSet of this complexityLevel.
- Parameters:
complexityLevel- If value is < 1, remove music data for all the complexity levels.
-
getSourceChannels
Get the source channels matching the parameters.There might have 0, 1 or more channels for the specified AccType and chord symbol. There are 2 (or more) channels when each channel handles a part of the chord, e.g one channel for the 1+5 notes, another for the 3+7 notes.
Channels match if :
- same AccType as at
- rootNote is not muted
- chord is not muted- Parameters:
at- If null, parameter is ignoredrootNote- If null, parameter is ignored.yc- If null, parameter is ignored.- Returns:
- The channels which match the parameters.
-
getAccTypes
-
getAccType
Get the AccType for a specified channel (which can be a "secondary" source channel or the "main" one).- Parameters:
channel-- Returns:
- Null if this channel is not used.
-
dump
public void dump(boolean showMusicData, boolean showCtab) -
toString
-