Class Style

java.lang.Object
org.jjazz.yamjjazz.rhythm.api.Style

public class Style extends Object
Store all the data of a Yamaha style.

The feel parameter is estimated programatically from the analysis of the notes positions.

Limitations:
- ignore SFF2 files
- in the Midi music data ignore the following data: sysex, program changes, pitch bends, controller changes
- Program changes are loaded from the SInt section.

  • Field Details

    • name

      public String name
    • timeSignature

      public TimeSignature timeSignature
    • ticksPerQuarter

      public int ticksPerQuarter
    • tempo

      public int tempo
    • division

      public Division division
    • sffType

      public Style.SFFtype sffType
  • Constructor Details

    • Style

      public Style()
  • Method Details

    • addStylePart

      public StylePart addStylePart(StylePartType type)
      Create a StylePart of specified type and add it to this object.

      If StylePart already exists, just return it.

      Parameters:
      type -
      Returns:
      The created StylePart.
    • getStylePart

      public StylePart getStylePart(StylePartType spType)
    • getStylePartSizeInBars

      public int getStylePartSizeInBars(StylePartType spType)
    • getStylePartTypes

      public List<StylePartType> getStylePartTypes()
      The list used StylePartTypes sorted according to natural ordering.
      Returns:
    • getSInt

      public SInt getSInt()
    • getAllAccTypes

      public List<AccType> getAllAccTypes()
      Returns:
      All the different AccTypes used in this style, in the AccType natural order.
    • getAccType

      public AccType getAccType(int channel)
      Get the AccType for a specified channel (which can be a "secondary" source channel or the "main" one).

      Search the first StylePart which uses this channel and return the associated AccType. If one channel is used by two AccTypes (it can happen, in 2 different StyleParts), try to return each of them successively upon each method call (otherwise problem will happen).

      Returns:
      Null if this channel is not used in this Style.
    • readNonMusicData

      public void readNonMusicData(File stdFile) throws IOException, org.jjazz.yamjjazz.FormatNotSupportedException, FileNotFoundException, InvalidMidiDataException
      Read only the non MusicData (Midi notes) of a standard Yamaha style file : CASM (StyleParts creation), SInt, tempo, signature, name.
      Parameters:
      stdFile - A standard Yamaha style file
      Throws:
      IOException
      org.jjazz.yamjjazz.FormatNotSupportedException
      FileNotFoundException
      InvalidMidiDataException
    • readMusicData

      public void readMusicData(File stdFile) throws IOException, FileNotFoundException, InvalidMidiDataException
      Read only the MusicData (Midi notes) which will fill/create all the SourcePhrase objects in the StyleParts.

      This method must be called AFTER readNonMusicData() has been called, so that the StyleParts are already created.

      Parameters:
      stdFile - A standard Yamaha style file
      Throws:
      IOException
      FileNotFoundException
      InvalidMidiDataException
    • readNonMusicData

      public void readNonMusicData(File extFile, File stdFile) throws IOException, org.jjazz.yamjjazz.FormatNotSupportedException, FileNotFoundException, InvalidMidiDataException
      Get the non music data by merging data from an extension style file and a base style file.

      Parameters:
      extFile - A YamJJazz extension file
      stdFile - A standard Yamaha style file
      Throws:
      IOException
      org.jjazz.yamjjazz.FormatNotSupportedException
      FileNotFoundException
      InvalidMidiDataException
    • readMusicData

      public void readMusicData(File extFile, File stdFile) throws IOException, FileNotFoundException, InvalidMidiDataException, org.jjazz.yamjjazz.FormatNotSupportedException
      Get the music data by merging music data from an extension style file and a base style file.

      This method must be called AFTER readNonMusicData() has been called, so that the StyleParts are already created.

      Parameters:
      extFile - A YamJJazz extension file
      stdFile - A standard Yamaha style file
      Throws:
      IOException
      FileNotFoundException
      InvalidMidiDataException
      org.jjazz.yamjjazz.FormatNotSupportedException
    • dump

      public void dump(boolean showMusicData, boolean showSInt, boolean showCASM)