Package vavi.sound.smaf.message

Examples of vavi.sound.smaf.message.UndefinedMessage


                    read(is, data);
                    // TODO end check 0xf7
                    smafMessage = SysexMessage.Factory.getSysexMessage(0, data);
                    break;
                default:
                    smafMessage = new UndefinedMessage(0);
Debug.println("unknown 0xff, 0x" + StringUtil.toHex2(e2));
                    break;
                }
            } else {
                smafMessage = new UndefinedMessage(0);
Debug.println("unhandled: " + StringUtil.toHex2(e1));
            }

            if (smafMessage != null) {
                messages.add(smafMessage);
View Full Code Here


                byte[] data = new byte[messageSize];
                read(is, data);
                // TODO end check 0xf7
                smafMessage = SysexMessage.Factory.getSysexMessage(0, data);
            } else {
                smafMessage = new UndefinedMessage(0);
Debug.println("unhandled: " + StringUtil.toHex2(status));
            }

            if (smafMessage != null) {
                messages.add(smafMessage);
View Full Code Here

                    break;
                case 0x00: // nop
                    smafMessage = new NopMessage(duration);
                    break;
                default:
                    smafMessage = new UndefinedMessage(duration);
Debug.println("unknown 0xff, 0x" + StringUtil.toHex2(e2));
                    break;
                }
            } else if (e1 != 0x00) { // note
                int gateTime = readOneToTwo(is);
//Debug.println("gateTime: " + gateTime + ", 0x" + StringUtil.toHex4(gateTime));
                smafMessage = getHandyPhoneStandardMessage(duration, e1, gateTime);
            } else { // e1 == 0x00 other event
                int e2 = read(is);
                if (e2 == 0x00) {
                    int e3 = read(is);
                    if (e3 == 0x00) {
                        smafMessage = new EndOfSequenceMessage(duration);
                    } else {
                        smafMessage = new UndefinedMessage(duration);
Debug.println("unknown 0x00, 0x00, 0x" + StringUtil.toHex2(e3));
                    }
                } else {
                    int channel = (e2 & 0xc0) >> 6;
                    int event   = (e2 & 0x30) >> 4;
                    int data = e2 & 0x0f;
                    switch (event) {
                    case 3:
                        int value = read(is);
                        switch (data) {
                        case 0: // program change - 0x00 ~ 0x7f
                            smafMessage = new ProgramChangeMessage(duration, channel, value);
                            break;
                        case 1: // bank select - normal: 0x00 ~ 0x7f, drum: 0x80 ~ 0xff
                            smafMessage = new BankSelectMessage(duration, channel, value);
                            break;
                        case 2: // octave shift - 0x00, 0x01, 0x02, 0x03, 0x04, 0x81, 0x82, 0x83, 0x84
                            smafMessage = new OctaveShiftMessage(duration, channel, value);
                            break;
                        case 3: // modulation -  0x00 ~ 0x7f
                            smafMessage = new ModulationMessage(duration, channel, value);
                            break;
                        case 4: // pitch bend - 0x00 ~ 0x40 ~ 0x7f
                            smafMessage = new PitchBendMessage(duration, channel, value << 7);
                            break;
                        case 7: // volume -  0x00 ~ 0x7f
                            smafMessage = new VolumeMessage(duration, channel, value);
                            break;
                        case 0x0a: // pan -  0x00 ~ x040 ~ 0x7f
                            smafMessage = new PanMessage(duration, channel, value);
                            break;
                        case 0x0b: // expression - normal: 0x00 ~ 0x7f
                            smafMessage = new ExpressionMessage(duration, channel, value);
                            break;
                        default:
                            smafMessage = new UndefinedMessage(duration);
Debug.println("unknown 0x00, 0x" + StringUtil.toHex2(e2) + ", 3, " + StringUtil.toHex2(data));
                            break;
                        }
                        break;
                    case 2: // modulation (short) 0x01 ~ 0x0e
View Full Code Here

                case 0x7e: // ���m�E���[�h�E�I��
                case 0x7f: // �|���E���[�h�E�I�� (MA-3 �̂�)
                    smafMessage = new MidiConvertibleMessage(duration, control, channel, value);
                    break;
                default:
                    smafMessage = new UndefinedMessage(duration);
Debug.println("undefined control: " + StringUtil.toHex2(control) + ", " + StringUtil.toHex2(value));
                    break;
                }
            } else if (status >= 0xc0 && status <= 0xcf) { // program change
                int channel = status & 0x0f;
                int program = read(is);
                smafMessage = new ProgramChangeMessage(duration, channel, program);
            } else if (status >= 0xd0 && status <= 0xdf) { // reserved
                int d1 = read(is);
                smafMessage = new UndefinedMessage(duration);
Debug.println("reserved: 0xd_: " + StringUtil.toHex2(d1));
            } else if (status >= 0xe0 && status <= 0xef) { // pitch vend message
                int channel = status & 0x0f;
                int lsb = read(is);
                int msb = read(is);
                smafMessage = new PitchBendMessage(duration, channel, (msb << 7) | lsb);
            } else if (status == 0xff) { // eos, nop
                int d1 = read(is);
                switch (d1) {
                case 0x00:
                    smafMessage = new NopMessage(duration);
                    break;
                case 0x2f:
                    int d2 = read(is); // must be 0
                    if (d2 != 0) {
Debug.println("illegal state: " + StringUtil.toHex2(d2));
                    }
                    smafMessage = new EndOfSequenceMessage(duration);
                    break;
                default:
                    smafMessage = new UndefinedMessage(duration);
Debug.println("unknown: 0xff: " + StringUtil.toHex2(d1));
                    break;
                }
            } else if (status == 0xf0) { // exclusive
                int messageSize = readOneToFour(is);
                byte[] data = new byte[messageSize];
                read(is, data);
                // TODO end check 0xf7
                smafMessage = SysexMessage.Factory.getSysexMessage(duration, data);
            } else /* 0xf1 ~ 0xfe */ // reserved
                smafMessage = new UndefinedMessage(duration);
Debug.println("reserved: " + StringUtil.toHex2(status));
            }

//Debug.println(available() + ", " + smafMessage);
            if (smafMessage != null) {
View Full Code Here

              } break;
            default: {
                int size = readOneToTwo(is);
                byte[] data = new byte[size];
                read(is, data);
                smafMessage = new UndefinedMessage(duration);
Debug.println("reserved: " + StringUtil.toHex2(e1));
              } break;
            }

//Debug.println(available() + ", " + smafMessage);
View Full Code Here

TOP

Related Classes of vavi.sound.smaf.message.UndefinedMessage

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.