• Post Reply Bookmark Topic Watch Topic
  • New Topic

How read time coefficient from midi files?  RSS feed

 
Andrzej Borucki
Ranch Hand
Posts: 90
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

For file getTickLength() returns 58364 ticks, Midi Editor sat that file has 79396 ms. But sequence.PPQ is 0.0 and sequence.getDivisionType() is 0.0

( thread may be moved to Other JSE/JEE APIs )
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sequence.PPQ is always 0.0, because it's a static final field. The division type also can't be used to determine the length; it's a type, and 0.0 means the type is Sequence.PPQ.

But what's wrong with sequence.getMicrosecondLength()? It's not in ms but a factor 1000 more precise.
 
Andrzej Borucki
Ranch Hand
Posts: 90
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:But what's wrong with sequence.getMicrosecondLength()? It's not in ms but a factor 1000 more precise.

I suggested that getMicrosecondLength() is always getTickLength() * 1000 ;-)
Thanks
(but if getResolution() == 384, it is not 120 beat per minute, is 115.2 - near value)
 
Andrzej Borucki
Ranch Hand
Posts: 90
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to change content of file? IS example www.jsresources.org, but still problems?
What is velocity? beats per minute? why not 120 but 64? why ticks means not 1.3 millisecond interval but 0.5 second? How place shorter note?
How read instruments from file?
Sample code

reads MidiChannel from system (global?) not from file.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!