com.frinika.sequencer.midi.sysex
Class E70fx

java.lang.Object
  extended by com.frinika.sequencer.model.AbstractSysexMacro
      extended by com.frinika.sequencer.midi.sysex.E70fx
All Implemented Interfaces:
SysexMacro

public class E70fx
extends AbstractSysexMacro

Sysex-macro for setting interal effects on a Roland E70. This macro not only returns sysex-events, but also generates bank-select controller messages. (An example how flexible SysexMacros are.)

Author:
Jens Gulden

Field Summary
static int ADDR_OFFSET_CHORUS
           
static int ADDR_OFFSET_REVERB
           
static java.lang.String[] CHORUS_TYPES
           
static byte COMMAND_SYSEX_REQUEST
           
static byte COMMAND_SYSEX_SET
           
static byte DEVICE_ID_ROLAND
           
static byte MODEL_ID_E70
           
static java.lang.String[] REVERB_TYPES
           
static int USER_PROGRAM_BASE_ADDR
           
static int USER_PROGRAM_SIZE
           
 
Fields inherited from class com.frinika.sequencer.model.AbstractSysexMacro
SYSEX_MACRO_PACKAGE
 
Constructor Summary
E70fx()
           
 
Method Summary
static byte calculateChecksum(byte[] data, int from, int to)
           
 void checksum(byte[] data)
           
static byte[] denibblize(byte[] nibbles)
           
protected  byte[] e70Req(int addr, int size)
           
protected  byte[] e70Set(int addr, byte[] data)
           
protected  byte[] e70UserProgramReq(int userProgram, int offset, int size)
           
protected  byte[] e70UserProgramSet(int userProgram, int offset, byte[] data)
           
static byte[] nibblize(byte[] data)
           
 byte[] parse(java.lang.String[] args)
          The default implementation treats all args as decimal number values, then calls parse(int[] args)
 javax.sound.midi.MidiMessage[] parseMessages(java.lang.String macro)
          Macro: e70fx [ ] [ ] Sets the built-in reverb-effect style on one of the user-programs.
protected  byte[] rolandSysexReq(byte modelId, int addr, int size)
          Creates sysex-data for requesting a block of data from the midi-device.
protected  byte[] rolandSysexSet(byte modelId, int addr, byte[] data)
          Creates sysex-data for sending a block of data to the device.
protected  byte[] rolandSysexSetRaw(byte modelId, int addr, byte[] data)
          Creates sysex-data for sending a block of data to the device.
 java.lang.String usage()
          Generic usage message.
static javax.sound.midi.MidiMessage[] usrPrgChg(int pgmnr, int chn)
           
 
Methods inherited from class com.frinika.sequencer.model.AbstractSysexMacro
error, findMacro, parse, parse, parse, parseByte, parseInt, parseInt, parseIntArg, parseType, splitArgs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADDR_OFFSET_REVERB

public static final int ADDR_OFFSET_REVERB
See Also:
Constant Field Values

ADDR_OFFSET_CHORUS

public static final int ADDR_OFFSET_CHORUS
See Also:
Constant Field Values

REVERB_TYPES

public static final java.lang.String[] REVERB_TYPES

CHORUS_TYPES

public static final java.lang.String[] CHORUS_TYPES

MODEL_ID_E70

public static final byte MODEL_ID_E70
See Also:
Constant Field Values

USER_PROGRAM_BASE_ADDR

public static final int USER_PROGRAM_BASE_ADDR
See Also:
Constant Field Values

USER_PROGRAM_SIZE

public static final int USER_PROGRAM_SIZE
See Also:
Constant Field Values

DEVICE_ID_ROLAND

public static final byte DEVICE_ID_ROLAND
See Also:
Constant Field Values

COMMAND_SYSEX_SET

public static final byte COMMAND_SYSEX_SET
See Also:
Constant Field Values

COMMAND_SYSEX_REQUEST

public static final byte COMMAND_SYSEX_REQUEST
See Also:
Constant Field Values
Constructor Detail

E70fx

public E70fx()
Method Detail

usage

public java.lang.String usage()
Description copied from class: AbstractSysexMacro
Generic usage message. Should be overwritten by subclasses.

Overrides:
usage in class AbstractSysexMacro
Returns:
Usage message string.

parseMessages

public javax.sound.midi.MidiMessage[] parseMessages(java.lang.String macro)
                                             throws javax.sound.midi.InvalidMidiDataException
Macro: e70fx [ ] [ ] Sets the built-in reverb-effect style on one of the user-programs. There are two modes of operation: In order to overcome the limitation that the actively selected user-program cannot be configured via sysex, the current user-program will be changed to before sending the sysex message and after having made the changes will be switched back again. This has the effect that after setting the effect this way, the will be the actively selected one, even if it hadn't been selected before. To disable the special behaviour of switching user-programs, use arg[0]: reverb-type (0: none, 1: room1, 2: room2, 3: room3, 4: hall1, etc.) arg[1]: reverb-intensity (0-7) arg[2]: chorus-type (0: none, 1: chorus1, 2: chorus2, etc.) arg[3]: chorus-intensity (0-7) arg[4] (optional): user-program to modify, default "11" (0) arg[5] (optional): channel on which to send user program switch, may differ from current Frinika-track's channel. Default is 16 (i.e. 15 if counting from 0 to 15), use -1 to disable sending user-program changes before and after the sysex data.

Specified by:
parseMessages in interface SysexMacro
Overrides:
parseMessages in class AbstractSysexMacro
Throws:
javax.sound.midi.InvalidMidiDataException

parse

public byte[] parse(java.lang.String[] args)
             throws javax.sound.midi.InvalidMidiDataException
Description copied from class: AbstractSysexMacro
The default implementation treats all args as decimal number values, then calls parse(int[] args)

Overrides:
parse in class AbstractSysexMacro
Returns:
Throws:
javax.sound.midi.InvalidMidiDataException

e70Set

protected byte[] e70Set(int addr,
                        byte[] data)

e70Req

protected byte[] e70Req(int addr,
                        int size)

e70UserProgramSet

protected byte[] e70UserProgramSet(int userProgram,
                                   int offset,
                                   byte[] data)

e70UserProgramReq

protected byte[] e70UserProgramReq(int userProgram,
                                   int offset,
                                   int size)

usrPrgChg

public static javax.sound.midi.MidiMessage[] usrPrgChg(int pgmnr,
                                                       int chn)
                                                throws javax.sound.midi.InvalidMidiDataException
Throws:
javax.sound.midi.InvalidMidiDataException

checksum

public void checksum(byte[] data)

rolandSysexSet

protected byte[] rolandSysexSet(byte modelId,
                                int addr,
                                byte[] data)
Creates sysex-data for sending a block of data to the device. The data will automatically converted to nibblized format, as internally required for transmission.

Parameters:
modelId -
addr -
data -
Returns:

rolandSysexSetRaw

protected byte[] rolandSysexSetRaw(byte modelId,
                                   int addr,
                                   byte[] data)
Creates sysex-data for sending a block of data to the device. The data is expected to already be in nibblized format, as required for transmission.

Parameters:
modelId -
addr -
data -
Returns:

rolandSysexReq

protected byte[] rolandSysexReq(byte modelId,
                                int addr,
                                int size)
Creates sysex-data for requesting a block of data from the midi-device.

Parameters:
modelId -
addr -
size -
Returns:

nibblize

public static byte[] nibblize(byte[] data)

denibblize

public static byte[] denibblize(byte[] nibbles)

calculateChecksum

public static byte calculateChecksum(byte[] data,
                                     int from,
                                     int to)