Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

About MIDI KARAOKE file

Posted on 1999-07-31
9
Medium Priority
?
794 Views
Last Modified: 2010-04-04
I need a Source Code Which can play the MidiKaraoke file(*.KAR)..(and tell me the Formation of KAR file too)..
thanks.
0
Comment
Question by:tintt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 1392226
Hi
this code for playing midi files works fine as these kar files are just same as midi(see below code for details)

{remember to add mmsystem to the uses section at the top of the unit.}


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,mmsystem,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

Function PlayMidiFile(FileName:string):word;
var  //note i need to add MMSYSTEM to the uses section
wdeviceid:integer;
dwreturn:word;
mciOpen:tmci_open_parms;
mciPlay:tmci_play_parms;
mciStat:tmci_status_parms;
mciseq:tmci_seq_set_parms;
begin
    // Open the device by specifying the device and filename.
    // MCI will attempt to choose the MIDI mapper as the output port.

    mciopen.lpstrDeviceType:='sequencer';
    mciopen.lpstrElementName:=pchar(filename);

    dwReturn:=mciSendCommand($0,mci_open,mci_open_type OR
mci_open_element,longint(@mciopen));
    if dwreturn<>0 then result:=dwreturn else
    begin
      // The device opened successfully; get the device ID.
      wDeviceID:=mciOpen.wDeviceID;
      // Check if the output port is the MIDI mapper.
      mciStat.dwItem:= MCI_SEQ_STATUS_PORT;
      dwReturn:=mciSendCommand(wDeviceID, MCI_STATUS,
MCI_STATUS_ITEM,longint(@mciStat));
      if dwreturn<>0 then
      begin
        mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
        result:=dwreturn;
      end else
      begin
        // Begin playback. The window procedure function for the parent
        // window will be notified with an MM_MCINOTIFY message when
        // playback is complete. At this time, the window procedure closes
        // the device.
        mciPlay.dwCallback:=application.Handle;
        dwReturn:=mciSendCommand(wDeviceID, MCI_PLAY,
MCI_NOTIFY,longint(@mciPlay));
        if dwreturn<>0 then
        begin
          mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
          result:=dwreturn;
        end;
      end;
    end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
PlayMidiFile('c:\my.kar');

// or you could do
//opendialog1.execute;  //and find a kar file then
//PlayMidiFile(opendialog1.filename);
end;

end.





And from wotsit's file format site :
KAR files are based on standard Midi files with the following additional events:

The KAR text meta events start with an @ followed by a character indicating the type of KAR text meta event, then followed by text for that event.  The following text meta events occur embedded in regular MIDI text events:

FileType:     @KMIDI KARAOKE FILE
Version:      @V0100
Information:  @I<text>
Language:     @LENGL
Title 1:      @T<title>
Title 2:      @T<author>
Title 3:      @T<copyright>

The following lyric text indicators are defined.  A \ (backslash) in the text is to clear the screen. A / (forwardslash) in the text is a line feed (next line).

Regards Barry
0
 

Author Comment

by:tintt
ID: 1392227
But how can I get the Lyrics ?
0
 

Author Comment

by:tintt
ID: 1392228
But how can I get the Lyrics ?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 17

Expert Comment

by:inthe
ID: 1392229
i dont know any mci api commands for reading the text from them ,i suppose you could parse the file into a richedit..
all the text seems to be on the first line of the file then the music follows.
i have search the net everywhere for a way to get the text and found nothing at all on it.
do you know where any players are that play these files and show the text?i might be able to seee how they are doing it then.
0
 

Author Comment

by:tintt
ID: 1392230
You should try at www.MidiKaraoke.com.
I need to know the way to read that KAR file( that means file format ) not to play it out.
0
 
LVL 15

Accepted Solution

by:
simonet earned 100 total points
ID: 1392231
tintt,

You'll find the description of the Midi Karaoke file format here:

http://www.wotsit.org/cgi-bin/search.cgi?karaoke
http://www.wotsit.org/cgi-bin/search.cgi?KAR

Yours,

Alex
0
 
LVL 17

Expert Comment

by:inthe
ID: 1392232
alex see my first rejected answer
 i think tintt wants to know how to get the text out of the file and into a memo for instance ,but i couldnt do that :-(
0
 
LVL 15

Expert Comment

by:simonet
ID: 1392233
Ops, sorry, Barry. I noticed the code there but I didn't note your reference to Wotsit's.

I'll see what I can do about getting the lyrics out of the KAR file.

Alex
0
 
LVL 17

Expert Comment

by:inthe
ID: 1392234
that be good ,i tried for ages with no luck so hope you can find a way.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question