Package vavi.sound.mfi

Examples of vavi.sound.mfi.MfiMessage


        }

        Track track = mfiTracks[0];
        for (int j = 0; j < track.size(); j++) {
            MfiEvent event = track.get(j);
            MfiMessage message = event.getMessage();

            if (message instanceof TempoMessage) {
                return ((TempoMessage) message).getTimeBase();
            }
        }
View Full Code Here


    public HeaderChunk(Sequence sequence) {
        //
        Track track = sequence.getTracks()[0];
        for (int j = 0; j < track.size(); j++) {
            MfiEvent event = track.get(j);
            MfiMessage message = event.getMessage();
            if (message instanceof SubMessage) {
                SubMessage subChunk = (SubMessage) message;
//Debug.println(infoMessage);
                subChunks.put(subChunk.getSubType(), subChunk);
            }
View Full Code Here

     *
     * @param masterVolume in %
     */
    public static MfiEvent getMasterVolumeEvent(int masterVolume) {
        int realMasterVolume = (int) (masterVolume * maxMasterVolume / 100f);
        MfiMessage message = new MasterVolumeMessage(0x00, 0xff, 0xb0, realMasterVolume);
        return new MfiEvent(message, 0l);
    }
View Full Code Here

    }

private int deltas[] = new int[4];

private void addEventToTrack(MfiContext mfiContext, long tick, Track mfiTrack, int mfiTrackNumber, MfiEvent mfiEvent) {
    MfiMessage mfiMessage = mfiEvent.getMessage();
    deltas[mfiTrackNumber] += mfiMessage.getDelta();
    double tickDash = deltas[mfiTrackNumber] * mfiContext.getScale();
    if ((tickDash / tick) * 100 < 95 && (tickDash / tick) * 100 != 0 && !(mfiMessage instanceof NopMessage))
Debug.println(Level.SEVERE, String.format("XXXXX track: %d, tick: %d, tick': %.2f (%.2f), %d, %s\n",
            mfiTrackNumber,
            tick,
View Full Code Here

            Track mfiTrack = mfiTracks[i];
           
            for (int j = 0; j < mfiTrack.size(); j++) {
                MfiEvent mfiEvent = mfiTrack.get(j);
                MfiMessage mfiMessage = mfiEvent.getMessage();
               
                midiContext.addCurrent(mfiMessage.getDelta());
               
                if (mfiMessage instanceof MidiConvertible) {
//Debug.println("midi convertible: " + message);
                    MidiEvent[] midiEvents = ((MidiConvertible) mfiMessage).getMidiEvents(midiContext);
                    if (midiEvents != null) {
View Full Code Here

        dos.writeBytes(TYPE);
        dos.writeInt(getDataLength());
Debug.println("track: " + trackNumber + ": " + getDataLength());
        for (int j = 0; j < track.size(); j++) {
            MfiEvent event = track.get(j);
            MfiMessage message = event.getMessage();
            if (!VaviMfiFileFormat.isIgnored(message)) {
                byte[] data = message.getMessage();
                dos.write(data, 0, data.length);
            }
        }
    }
View Full Code Here

        int trackLength = 0;

        for (int j = 0; j < track.size(); j++) {
try {
            MfiEvent event = track.get(j);
            MfiMessage message = event.getMessage();
            if (!VaviMfiFileFormat.isIgnored(message)) {
                trackLength += message.getLength();
            }
} catch (RuntimeException e) {
Debug.printStackTrace(e);
Debug.println("j: " + j + ", track.size: " + track.size() + ", " + track.get(j));
throw e;
View Full Code Here

Debug.println("trackLength[" + trackNumber + "]: " + trackLength);

        // events
        int l = 0;
        while (l < trackLength) {
            MfiMessage message = getMessage(dis);
            track.add(new MfiEvent(message, 0l));

            l += message.getLength();
//Debug.println("track[" + trackNumber + "] event length sum: " + l + " / " + trackLlength);
        }

        //
        this.length = trackLength + 4 + 4; // + type + length
View Full Code Here

                                               DataInputStream dis)
        throws IOException {

        int data1 = dis.readUnsignedByte();    // �g���X�e�[�^�X

        MfiMessage message = null;
        if (data1 >= 0x00 && data1 <= 0x7f) {
            // �g���X�e�[�^�X A ... LongMessage
            message = LongMessageFactory.getMessage(delta, status, data1, dis, exst);
        } else if (data1 >= 0x80 && data1 <= 0xef) {
            // �g���X�e�[�^�X B ... ShortMessage
View Full Code Here

TOP

Related Classes of vavi.sound.mfi.MfiMessage

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.