Package org.jjazz.quantizer.api
Class Quantizer
java.lang.Object
org.jjazz.quantizer.api.Quantizer
Provide quantize related methods and properties.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
static Quantizer
float
getQuantized
(Position pos, TimeSignature ts, int maxBarIndex) Return the closest quantized position using the Quantizer's global settings.static float
getQuantized
(Quantization q, float beatPos) Quantize beatPos using the specified quantization setting.static Position
getQuantized
(Quantization q, Position pos, TimeSignature ts, float qStrength, int maxBarIndex) Return the closest quantized position using the specified quantization settings.static float
getQuantizedNext
(Quantization q, float beatPos) Get the next quantized position after beatPos.static float
getQuantizedPrevious
(Quantization q, float beatPos) Get the previous quantized position before beatPos.float
Convenience method to get the current quantization strength.boolean
Check if iterative quantize is enabled.void
void
setIterativeQuantizeEnabled
(boolean b) Set the value of iterativeEnabledvoid
setIterativeQuantizeStrength
(float strength) Set the iterative quantize strength.void
-
Field Details
-
PROP_ITERATIVE_QUANTIZE_STRENGTH
- See Also:
-
PROP_ITERATIVE_ENABLED
- See Also:
-
-
Method Details
-
getInstance
-
getQuantizeStrength
public float getQuantizeStrength()Convenience method to get the current quantization strength.- Returns:
- 1f if isIterativeQuantizedEnabled() is false, otherwise return getIterativeQuantizeStrength().
-
getIterativeQuantizeStrength
public float getIterativeQuantizeStrength()- Returns:
- See Also:
-
setIterativeQuantizeStrength
public void setIterativeQuantizeStrength(float strength) Set the iterative quantize strength.1 means hard quantize. 0.2f means note is moved 0.2f * half_quantize_distance.
- Parameters:
strength
- A value in the ]0;1] range.
-
isIterativeQuantizeEnabled
public boolean isIterativeQuantizeEnabled()Check if iterative quantize is enabled.This is enabled by default.
- Returns:
-
setIterativeQuantizeEnabled
public void setIterativeQuantizeEnabled(boolean b) Set the value of iterativeEnabled- Parameters:
b
- new value of iterativeEnabled
-
getQuantized
Return the closest quantized position using the Quantizer's global settings.- Parameters:
pos
- The original position.ts
- The TimeSignature for the original position.maxBarIndex
- The quantized position can not exceed this maximum bar index.- Returns:
- See Also:
-
#getQuantized(org.jjazz.quantizer.api.Quantization, org.jjazz.chordleadsheet.api.item.Position, org.jjazz.harmony.api.TimeSignature, int)
isIterativeQuantizeEnabled()
getIterativeQuantizeStrength()
-
getQuantized
public static Position getQuantized(Quantization q, Position pos, TimeSignature ts, float qStrength, int maxBarIndex) Return the closest quantized position using the specified quantization settings.- Parameters:
q
- The quantization settingpos
- The original position.ts
- The TimeSignature for the original position.qStrength
- A value in the ]0;1] range. 1 means hard quantize. 0.2f means note is moved half_quantize_distance*0.2f.maxBarIndex
- The quantized position can not exceed this maximum bar index.- Returns:
-
getQuantized
Quantize beatPos using the specified quantization setting.- Parameters:
q
-beatPos
-- Returns:
-
getQuantizedNext
Get the next quantized position after beatPos.If beatPos is already a quantized position, return, beatPos.
- Parameters:
q
-beatPos
-- Returns:
-
getQuantizedPrevious
Get the previous quantized position before beatPos.If beatPos is already a quantized position, return beatPos.
- Parameters:
q
-beatPos
-- Returns:
-
setQuantizationValue
-
getQuantizationValue
-
getDefaultQuantizationValue
-
addPropertyChangeListener
-
removePropertyChangeListener
-