Package javax.sound.midi

Examples of javax.sound.midi.ShortMessage


      // right channel (RackAttack has 12 of them each with
      // a possibly different sound loaded)
      try {
        if (message.getStatus() == ShortMessage.NOTE_ON
            || message.getStatus() == ShortMessage.NOTE_OFF) {
          ShortMessage sm = (ShortMessage) message;
          sm.setMessage(sm.getCommand(), JRackAttackFrame
              .getInstance().getActiveMidiChannel(), sm
              .getData1(), sm.getData2());
        }
        MidiThread.getInstance().enqueueEvent(message);
      } catch (MidiUnavailableException e) {
        log.error("error", e);
      } catch (InvalidMidiDataException e) {
View Full Code Here


    setMidiOutDevice(dOut);
  }

  protected MidiThread() {
    if (CLOCK_MESSAGE == null) {
      CLOCK_MESSAGE = new ShortMessage();
      SYSTEM_RESET_MESSAGE = new ShortMessage();
      ALIVE_MESSAGE = new ShortMessage();
      try {
        CLOCK_MESSAGE.setMessage(ShortMessage.TIMING_CLOCK);
        SYSTEM_RESET_MESSAGE.setMessage(ShortMessage.SYSTEM_RESET);
        ALIVE_MESSAGE.setMessage(ShortMessage.ACTIVE_SENSING);
      } catch (Exception ex) {
View Full Code Here

  public int getChannel() {
    return channel;
  }

  public boolean initTestMessages() {
    ShortMessage sm = new ShortMessage();
    try {
      sm.setMessage(ShortMessage.SYSTEM_RESET, 0, 0);
      enqueueEvent(sm);
      if (programNumber != -1) {
        sm = new ShortMessage();
        sm.setMessage(ShortMessage.PROGRAM_CHANGE, programNumber, 0);
        enqueueEvent(sm);
      }
      switch (testMode) {
      case DRUMS: {
        addDrumEvents(channel);
View Full Code Here

    emitParamChange(src, sndNo, RackAttack.PAN, pan);
  }

  public void emitNoteOn(int note) {
    assertValidMidiValue(note, "note pitch");
    ShortMessage sm = new ShortMessage();
    try {
      sm.setMessage(ShortMessage.NOTE_ON, note, 100);
      enqueueEvent(sm);
    } catch (InvalidMidiDataException e) {
      log.error("error", e);
    } catch (MidiUnavailableException e) {
      log.error("error", e);
View Full Code Here

//Debug.println(this);
//      context.setPitchBend(channel, getPitchBend());

//      int pitch = context.retrieveRealPitch(channel);

        ShortMessage shortMessage = new ShortMessage();
        shortMessage.setMessage(ShortMessage.PITCH_BEND,
                                channel,
                                0,                      // LSB
                                getPitchBend() * 2);    // MSB
        return new MidiEvent[] {
            new MidiEvent(shortMessage, context.getCurrent())
View Full Code Here

    /** */
    public MfiEvent[] getMfiEvents(MidiEvent midiEvent, MfiContext context)
        throws InvalidMfiDataException {

        ShortMessage shortMessage = (ShortMessage) midiEvent.getMessage();
        int channel = shortMessage.getChannel();
        int data2 = shortMessage.getData2();

        int track = context.retrieveMfiTrack(channel);
        int voice = context.retrieveVoice(channel);

        PitchBendMessage mfiMessage = new PitchBendMessage();
View Full Code Here

        throws InvalidMidiDataException {

        int channel = getVoice() + 4 * context.getMfiTrackNumber();
       
        MidiEvent[] events = new MidiEvent[1];
        ShortMessage shortMessage = new ShortMessage();
        shortMessage.setMessage(ShortMessage.CONTROL_CHANGE,
                                channel,
                                1,    // ���W�����[�V�����E�f�v�X MSB
                                getModulationDepth() * 2);
        events[0] = new MidiEvent(shortMessage, context.getCurrent());
//      shortMessage = new ShortMessage();
View Full Code Here

    /** */
    public MfiEvent[] getMfiEvents(MidiEvent midiEvent, MfiContext context)
        throws InvalidMfiDataException {

        ShortMessage shortMessage = (ShortMessage) midiEvent.getMessage();
        int channel = shortMessage.getChannel();
        int data2 = shortMessage.getData2();

        int track = context.retrieveMfiTrack(channel);
        int voice = context.retrieveVoice(channel);

        ModulationDepthMessage mfiMessage = new ModulationDepthMessage();
View Full Code Here

        throws InvalidMidiDataException {

        int channel = getVoice() + 4 * context.getMfiTrackNumber();

        MidiEvent[] events = new MidiEvent[1];
        ShortMessage shortMessage = new ShortMessage();
        shortMessage.setMessage(ShortMessage.CONTROL_CHANGE,
                                channel,
                                10,    // �p���|�b�g MSB
                                getPanpot() * 2);
        events[0] = new MidiEvent(shortMessage, context.getCurrent());
//      shortMessage = new ShortMessage();
View Full Code Here

    /** */
    public MfiEvent[] getMfiEvents(MidiEvent midiEvent, MfiContext context)
        throws InvalidMfiDataException {

        ShortMessage shortMessage = (ShortMessage) midiEvent.getMessage();
        int channel = shortMessage.getChannel();
        int data2 = shortMessage.getData2();

        int track = context.retrieveMfiTrack(channel);
        int voice = context.retrieveVoice(channel);

        PanpotMessage mfiMessage = new PanpotMessage();
View Full Code Here

TOP

Related Classes of javax.sound.midi.ShortMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.