• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How read time coefficient from midi files?

 
Ranch Hand
Posts: 101
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 )
 
Sheriff
Posts: 22815
132
Eclipse IDE Spring Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 101
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 101
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic