News:

PsrStyles.com
- Download Styles and Expansion Packs

Main Menu

Algorithm to Split Midi between two Times

Started by chikitin, January 25, 2019, 11:27:06 AM

Previous topic - Next topic

chikitin

Hi,

I am trying to capture music between to given times in a midi file type 0 and write it a another midi file of type 0.

Any one can suggest an algorithm to do this please? I assume the file retains the latest changes to all channels and midi notes involved.

By the way,  I will be using javax.sound.midi package. If you can help more about the code it will be greatly appreciated.

Best.
CS




SeaGtGruff

Can you explain a little bit more about what you're trying to do? For example, are you trying to take all of the MIDI events from a style file and separate them into the various sections of the style?

I'm not familiar with the javax.sound.midi package, although I've dabbled a bit in Java. But I could try to make some sort of basic flow chart or pseudocode to try to outline some basic logic.

Fred Smith

From your description, you just need an If statement:

if (time>startTime && time<endTime) copy it

What else are you trying to do?

Cheers,
Fred
Fred Smith,
Saskatoon, SK
Sun Lakes, AZ
Genos, Bose L1 compacts, Finale 2015
Check out my Registration Lessons

Jørgen

Quote from: Fred Smith on January 26, 2019, 11:39:10 PM
From your description, you just need an If statement:

if (time>startTime && time<endTime) copy it

What else are you trying to do?

Cheers,
Fred

Hi

Not that simple in javax.sound.midi....

All timing is done by delta time = the duration between events...

No time methods...

Maybe: http://c4dm.eecs.qmul.ac.uk/people/robm/MidiRealTime.java

Jørgen
The Unofficial YAMAHA Keyboard Resource Site at http://www.jososoft.dk/yamaha
- since 1999