Package vavi.sound.smaf.message

Examples of vavi.sound.smaf.message.MidiContext


               IOException,
               InvalidSmafDataException {

        Track[] smafTracks = smafSequence.getTracks();

        MidiContext midiContext = new MidiContext();

        int resolution = midiContext.getResolution(smafTracks);
Debug.println("resolution: " + resolution);
        Sequence midiSequence = new SmafVaviSequence(Sequence.PPQ, resolution, 1);
        javax.sound.midi.Track midiTrack = midiSequence.getTracks()[0];

        midiTrack.add(midiContext.getTempoEvent());

        for (int i = 0; i < smafTracks.length; i++) {

            midiContext.setMidiTrack(midiTrack);

            midiContext.setSmafTrackNumber(i);
            midiContext.setTrack(smafTracks[i]);
            midiContext.setCurrentTick(0);

            Track smafTrack = smafTracks[i];

            for (int j = 0; j < smafTrack.size(); j++) {
                SmafEvent smafEvent = smafTrack.get(j);
                SmafMessage smafMessage = smafEvent.getMessage();
               
                midiContext.addCurrentTick(midiContext.getTicksOf(smafMessage.getDuration()));
//Debug.println("����������(" + i + ":" + j + ") ticks: " + midiContext.getCurrentTick() + "(" + midiContext.getTicksOf(smafMessage.getDuration()) + "," + smafMessage.getDuration() + "), " + smafMessage.getClass().getSimpleName());
               
                if (smafMessage instanceof MidiConvertible) {
if (!(smafMessage instanceof vavi.sound.smaf.message.NoteMessage) &&
    !(smafMessage instanceof vavi.sound.smaf.message.ModulationMessage) &&
View Full Code Here

TOP

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

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.