View Single Post
Old 10-15-2015, 07:15 PM   #9
Human being with feelings
Join Date: Oct 2015
Posts: 5
Default gimme more detail

I've noticed that raising the process priority of wasabi_ninjam.exe to realtime seems to help a little. Any thoughts on this?
It is related to time consumption , a cpu cycle taking x(time), the priority
define the latency of the application's timer refreshtime in a process ( like wasabi_ninjam.exe): With realtime sync with the cpu , the cpu clock and the app clock differs only by the time the information takes to be registered by tha application .
If priority is lowered , an other app will be refreshed before you , and if the counter is incremental in your app ( and not an expensive cost of time due to a function call ), the internal incremental timer will reflect the right time + the micro-sleep time due to the priority

Use HIGH_PRIORITY_CLASS with care. If a thread runs at the highest priority level for extended periods, other threads in the system will not get processor time. If several threads are set at high priority at the same time, the threads lose their effectiveness. The high-priority class should be reserved for threads that must respond to time-critical events.
mmm.. that could be hard coded in the code source :
If your application performs one task that requires the high-priority class while the rest of its tasks are normal priority, use SetPriorityClass to raise the priority class of the application temporarily; then reduce it after the time-critical task has been completed. Another strategy is to create a high-priority process that has all of its threads blocked most of the time, awakening threads only when critical tasks are needed. The important point is that a high-priority thread should execute for a brief time, and only when it has time-critical work to perform.
src :


2) Would it be possible to have midi synchronisation for the metronome so that people playing "live music" ( with instruments ) could jam with people using sequencers ?
That suppose that when u connect to the server , u receive a midi clock event:

MIDI beat clock (also known as MIDI timing clock or simply MIDI clock) is a clock signal that is broadcast via MIDI to ensure that several MIDI-enabled devices such as a synthesizer or music sequencer stay in synchronization. It is not MIDI timecode.
So how to start a sequencer automatically from ninjam ?
I can imagine that when u log into a ninjam session , after you close the legal window , ninjam couls send a midi msg to a sequencer to make it ready to start at the next midi beat ?
MIDI beat clock defines the following real time messages:

clock (decimal 248, hex 0xF8)
start (decimal 250, hex 0xFA)
continue (decimal 251, hex 0xFB)
stop (decimal 252, hex 0xFC)

Last edited by ezee; 10-15-2015 at 07:23 PM.
ezee is offline   Reply With Quote