Interface MidiMixManager
-
Method Summary
Modifier and TypeMethodDescriptionCreate and register a MidiMix for the specified rhythm.Create and register a new MidiMix for the specified song.Try to get a MidiMix for the specified Rhythm in the following order:Get a MidiMix for the specified song in the following order.Find a mix previously registered.getChannelsNeedingDrumsRerouting(MidiMix midiMix, Map<Integer, Instrument> mapChannelNewIns) Get the midiMix channels which need drums rerouting.getDeepCopy(MidiMix midiMix, Song song) Get a deep copy of midiMix.static MidiMixManagergetRhythmMix(MidiMix midiMix, Rhythm r) Build a rhythm MidiMix from a song MidiMix.voidimportInstrumentMixes(MidiMix midiMixDest, MidiMix midiMixSrc) Import InstrumentMixes from mmSrc to mmDest.
-
Method Details
-
getDefault
-
findRegisteredMix
Find a mix previously registered.If you're not sure use
createMix(org.jjazz.song.api.Song)instead.- Parameters:
s-- Returns:
- Can't be null
- Throws:
IllegalStateException- If no mix found
-
findMix
Get a MidiMix for the specified song in the following order.1. If the mix for song s already exists, just return it
2. Load mix from song mix file
3. Create and register a new mix for s usingcreateMix(org.jjazz.song.api.Song)for each song's rhythm- Parameters:
s-- Returns:
- A valid MidiMix usable for the specified song.
- Throws:
UnsupportedEditException- If there is not enough available channels to accomodate all song rhythms
-
findMix
Try to get a MidiMix for the specified Rhythm in the following order:1. If the registered mix for rhythm r already exists, just return it
2. Load mix from the default rhythm mix file
3. Create and register a new mix for r usingcreateMix(org.jjazz.rhythm.api.Rhythm)- Parameters:
r-- Returns:
- Can't be null
-
createMix
Create and register a new MidiMix for the specified song.Use the default rhythm mix for each song's rhythm. Create UserRhythmVoices key if song as some user phrases.
- Parameters:
sg-- Returns:
- Throws:
UnsupportedEditException- If there is not enough available channels to accomodate all song rhythms
-
createMix
Create and register a MidiMix for the specified rhythm.Create one InstrumentMix per rhythm voice, using rhythm voice's preferred instrument and settings, and preferred channel (except if several voices share the same preferred channel) .
- Parameters:
r- If r is- Returns:
- A MidiMix associated to this rhythm. Rhythm voices are used as keys for InstrumentMixes.
-
getChannelsNeedingDrumsRerouting
List<Integer> getChannelsNeedingDrumsRerouting(MidiMix midiMix, Map<Integer, Instrument> mapChannelNewIns) Get the midiMix channels which need drums rerouting.A channel needs rerouting if all the following conditions are met:
0/ InsMix at MidiConst.CHANNEL_DRUMS has its instrument Midi message enabled
1/ channel != MidiConst.CHANNEL_DRUMS
2/ rv.isDrums() == true and rerouting is not already enabled
3/ instrument (or new instrument if one is provided in the mapChannelNewIns parameter) is the VoidInstrument- Parameters:
midiMix-mapChannelNewIns- Optional channel instruments to be used for the exercise. Ignored if null. See OutputSynth.getNeedFixInstruments().- Returns:
- Can be empty
-
importInstrumentMixes
Import InstrumentMixes from mmSrc to mmDest.Import is first done on matching RhythmVoices from the same rhythm. Then import only when RvTypes match. For UserRhythmVoices import is done only if name matches.
Create new copy instances of Instruments Mixes with solo OFF.- Parameters:
midiMixDest-midiMixSrc-
-
getRhythmMix
-
getDeepCopy
-