Problems with MIDI player programing..serious help needed - Gearslutz.com

Gearslutz.com

All Advertisers
Go Back   Gearslutz.com > The Forums > Music computers


Problems with MIDI player programing..serious help needed

New Reply New Reply Thread Tools Search this Thread
Old 16th April 2007   #1
Gear Head
 
Luk3_c's Avatar
 
Joined: Jan 2006
Location: Prague, The Czech Republic
Posts: 46

Thread Starter
Problems with MIDI player programing..serious help needed

Hi
I'am finising university of electronics and a topic of my dissertation is MIDI. I have to program some aplication that shows how MIDI protocol works a I have serious problems with this aplication. It is somethingh like midi sequencer that works in real time, the core of this aplication is the same like a simple midi player but i have no expirience with programing aplications like that. The main problem is in timing. I can read messages and data from any midi file, I can count the times when it should be sent itno the MIDI port or virtul MIDI machine or some other object. But the problem is that I need time resolution around ten milliseconds or less for proper real time function. I use ''Timer'' object in Delphy, something like a simple counter with 10 ms long steps, but the problem is that 10ms is too short time interval and a timing error rises. I have no error messages, everything works but 1 second in my aplicacion takes of 1,5 real second when step in the timer is set to 10ms. When I use 100ms step or 1s step the time error is getting smaller, but it is still realy serious (eg. 1.1s).
Do you have any expirience or do you know how to program the core of this aplication to avoid the timing errors? There are tons of simple MIDI sequencers or players that works fine.

Thanks for any help
Luk3_c is offline   Reply With Quote
Old 16th April 2007   #2
Lives for gear
 
joris de man's Avatar
 
Joined: Jun 2002
Location: Amsterdam - now Steyning, UK
Posts: 571

Hey Luk,

This forum is more for peope who use computers for music, rather than programming them, so this is probably not the correct forum for questions like this.
You'd be better of looking at the forums at http://www.kvraudio.com/
They deal with plugin programming etc.

However, having a teeny little bit of programming experience myself (though not with Delphi), I would think the following is the problem:
The timer object is probably not accurate enough for your needs, as any other code that is happening in your program will affect the accuracy of the timer.

What you'd usually end up doing is putting the timing code in a thread, that runs independently of the rest of your program, and give this thread a high priority.
Things like the user interface would need to be polled less frequently (and accurately) than the midi code that you would run in that thread.

If all you're wanting to do is create examples, you might also want to check out a program called Synthmaker. This is an object oriented editor that lets you create VST and VSTi plugins that work with midi. You can create objects there that can show you midi data and how it flows through a plugin in various ways.
www.synthmaker.com

This might be an easier route than having to program it from scratch.
Other programs that spring to mind are max msp: http://www.cycling74.com/products/maxmsp

Another object oriented language in which you can create midi structures from the ground up.

Good luck,

Joris

Last edited by joris de man; 16th April 2007 at 09:19 AM.. Reason: Edited for sprouting bollocks
joris de man is offline   Reply With Quote
Old 16th April 2007   #3
Lives for gear
 
Joined: May 2004
Location: canada
Posts: 3,998

luk....
if programming in windows,..it sounds to me that you need whats called
a very high resolution timer.

if you have the msdn dev stuff from MS , if i remember there is a high resolution timer in the MS api. also there are high performance timers from third parties
if you google.
chek out the MS api queryperformancefrequency.
i think it results in sub millisec accuracy.
ive never used this cos ive only worked with biz apps in big companies..
but i suspect this might be what u need.

heres one of many google links to help/discussion....
on high performance timing in windows.
http://www.devsource.com/article2/0,1895,2063854,00.asp
__________________
i'm just a dumb computer engr (ret'd)...."quantum computing is the future"
running a native software studio daw...Powertracks and Reaper on amd.
new cockney album released http://therockingbloodbrothers.blogspot.com/
my other little songs www.motagator.com/bmanning
manning1 is offline   Reply With Quote
New Reply New Reply Submit Thread to Facebook Facebook  Submit Thread to Twitter Twitter  Submit Thread to LinkedIn LinkedIn 



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread starter Forum Replies Last Post
midi problems, maybe you can help RadioBox So much gear, so little time! 2 12th July 2008 10:38 AM
MIDI controlled music player somsto75 Music computers 3 8th April 2007 04:58 PM
MIDI Controlled player somsto75 So much gear, so little time! 0 5th April 2007 03:30 PM
Midi Player for my Mac Powerbook... SparkyCanada Music computers 5 1st January 2006 05:26 PM
Best Windows MIDI file player app? blearyeyes Music computers 3 26th June 2004 08:02 PM


All times are GMT +1. The time now is 01:47 PM.

Home - Search Forum - Contact Us - Terms Of Use - Advertise on Gearslutz - All Advertisers - Archive - Top
 
 
Powered by vBulletin®
Gearslutz.com LTD - UK Company Number 7597610.
Registered Office - 35 Ballards Lane, London, N3 1XW.
Hosted by Nimbus Hosting.

SEO by vBSEO ©2010, Crawlability, Inc.