예제 #1
0
  public void messageReceived(MorphRangeChangeMessage message) {
    int slotId = message.getSlot();

    if (!isValidSlot(slotId)) return;

    int vaId = message.getSection();
    int moduleId = message.getModule();
    int paramId = message.getParameter();
    int span = message.getSpan();
    int direction = message.getDirection(); // +==0/-==1

    NmSlot slot = synth.getSlot(slotId);
    NMPatch patch = slot.getPatch();

    VoiceArea va = null;
    if (vaId == Format.VALUE_SECTION_VOICE_AREA_POLY) va = patch.getPolyVoiceArea();
    else if (vaId == Format.VALUE_SECTION_VOICE_AREA_COMMON) va = patch.getCommonVoiceArea();

    if (va == null) return;

    PModule module = va.getModule(moduleId);

    PParameter p;
    try {
      p = Helper.getParameter(module, "morph", paramId);
    } catch (InvalidDescriptorException e) {
      return;
    }
    p.setValue(direction == 1 ? -span : +span);
  }
예제 #2
0
  public void messageReceived(ParameterSelectMessage message) {
    int slotId = message.getSlot();
    if (!isValidSlot(slotId)) return;

    int vaId = message.getSection();
    int moduleId = message.getModule();
    int paramId = message.getParameter();

    // addParameter("pid", "data:pid");
    // addParameter("sc", "data:sc");

    NmSlot slot = synth.getSlot(slotId);
    NMPatch patch = slot.getPatch();

    String parameterClass = "parameter";
    VoiceArea va = null;
    if (vaId == Format.VALUE_SECTION_VOICE_AREA_POLY) va = patch.getPolyVoiceArea();
    else if (vaId == Format.VALUE_SECTION_VOICE_AREA_COMMON) va = patch.getCommonVoiceArea();
    else if (vaId == Format.VALUE_SECTION_MORPH) {
      parameterClass = "morph";
      va = patch.getPolyVoiceArea();
    }

    if (va == null) return;

    PModule module = va.getModule(moduleId);

    PParameter p;
    try {
      p = Helper.getParameter(module, parameterClass, paramId);
    } catch (InvalidDescriptorException e) {
      return;
    }
    p.requestFocus();
  }