Package vavi.sound.smaf

Examples of vavi.sound.smaf.SmafEvent


        props.put("durationTimeBase", timeBaseTable[durationTimeBase]);
        props.put("gateTimeTimeBase", timeBaseTable[gateTimeTimeBase]);

        MetaMessage metaMessage = new MetaMessage();
        metaMessage.setMessage(MidiConstants.META_MACHINE_DEPEND, props);
        events.add(new SmafEvent(metaMessage, 0l));

        //
        for (Chunk waveDataChunk : waveDataChunks) {
            SmafMessage smafMessage = ((WaveDataChunk) waveDataChunk).toSmafMessage(waveType);
            events.add(new SmafEvent(smafMessage, 0l));
        }

        //
        List<SmafMessage> messages = ((SequenceDataChunk) sequenceDataChunk).getSmafMessages();
        for (SmafMessage message : messages) {
            events.add(new SmafEvent(message, 0l));
        }

        return events;
    }
View Full Code Here


                smafMessage.setGateTime(i == onLength - 1 ? length % 255 : 255);
if (length >= 255) {
Debug.println(channel + "ch, " + smafMessage.getNote() + ", " + smafMessage.getDuration() + ":[" + i + "]:" + (i == onLength - 1 ? length % 255 : 255) + "/" + length);
}
//Debug.println(channel + ", " + smafMessage.getVoice() + ", " + ((smafMessage.getMessage()[1] & 0xc0) >> 6));
                smafEvents[i] = new SmafEvent(smafMessage, 0l); // TODO 0l
if (smafEvents[i] == null) {
Debug.println("[" + i + "]: " + smafEvents[i]);
}

                if (i == 0) {
View Full Code Here

        props.put("durationTimeBase", timeBaseTable[durationTimeBase]);
        props.put("gateTimeTimeBase", timeBaseTable[gateTimeTimeBase]);

        MetaMessage metaMessage = new MetaMessage();
        metaMessage.setMessage(MidiConstants.META_MACHINE_DEPEND, props);
        events.add(new SmafEvent(metaMessage, 0l));

        //
        if (setupDataChunk != null) {
            List<SmafMessage> messages = ((SetupDataChunk) setupDataChunk).getSmafMessages();
            for (SmafMessage message : messages) {
                events.add(new SmafEvent(message, 0l));
            }
        }

        //
        List<SmafMessage> messages = ((SequenceDataChunk) sequenceDataChunk).getSmafMessages();
        for (SmafMessage message : messages) {
            events.add(new SmafEvent(message, 0l)); // TODO 0l
        }

        return events;
    }
View Full Code Here

     * @see #formatType
     * @see #setDrum(int, vavi.sound.smaf.message.MidiContext.ChannelConfiguration)
     */
    public void setTrack(Track smafTrack) {
        for (int j = 0; j < smafTrack.size(); j++) {
            SmafEvent event = smafTrack.get(j);
            SmafMessage message = event.getMessage();
            if (message instanceof vavi.sound.smaf.MetaMessage) {
                vavi.sound.smaf.MetaMessage metaMessage = (vavi.sound.smaf.MetaMessage) message;
                if (metaMessage.getType() == MidiConstants.META_MACHINE_DEPEND) {
                    //
                    this.formatType = (FormatType) metaMessage.getData().get("formatType"); // [ms]
View Full Code Here

        }

int t = 0;
        for (Track track : smafTracks) {
            for (int i = 0; i < track.size(); i++) {
                SmafEvent event = track.get(i);
                SmafMessage message = event.getMessage();
                if (message instanceof vavi.sound.smaf.MetaMessage) {
                    vavi.sound.smaf.MetaMessage metaMessage = (vavi.sound.smaf.MetaMessage) message;
                    if (metaMessage.getType() == MidiConstants.META_MACHINE_DEPEND) {
                        this.timeBase = (Integer) metaMessage.getData().get("durationTimeBase"); // [ms]
Debug.println("timebase: " + timeBase + ", (" + t + ":" + i + ")");
View Full Code Here

Debug.println("voice: " + voice + ", volume: " + data2);

        context.setBeforeTick(track, midiEvent.getTick());

        return new SmafEvent[] {
            new SmafEvent(smafMessage, midiEvent.getTick())
        };
    }
View Full Code Here

    public List<SmafEvent> getSmafEvents() {
        List<SmafEvent> events = new ArrayList<SmafEvent>();

        for (Chunk streamWaveDataChunk : streamWaveDataChunks) {
            SmafMessage smafMessage = ((StreamWaveDataChunk) streamWaveDataChunk).toSmafMessage();
            events.add(new SmafEvent(smafMessage, 0l));
        }

        return events;
    }
View Full Code Here

        changeVoiceMessage.setProgram(channel == 9 ? 0 : data1);

        context.setBeforeTick(track, midiEvent.getTick());

        return new SmafEvent[] {
            new SmafEvent(changeVoiceMessage, midiEvent.getTick())
        };
    }
View Full Code Here

TOP

Related Classes of vavi.sound.smaf.SmafEvent

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.