tags:

views:

171

answers:

1

I'd like to write a simple application that needs to display notes on a score (musical notes on a music staff). It is not for writing a music notation software, it is just for showing some notes on the staff, in readonly mode. I could of course have an image as background with an empty staff and paint the notes... But of course this takes time.

Is there a suitable VCL component?

Of course, the richer the better, anyway even a basic component that can display notes one after the other would be enough. If an instance of TMusicStaff is called MyMusicStaff I could add notes to it in this way:

MyMusicStaff.Add([G4,F4,D4])

(of course here in the Add method I am not specifing the duration, or if they are in a chord or in melodic fashion, it is just to give an idea).

I think I expressed myself.

+9  A: 

One possibility is to draw the notes on a canvas using a music note font like this one.

For example:

procedure TFormMain.PaintBoxNotesPaint(Sender: TObject);
var
  Canvas: TCanvas;
begin
  Canvas := TPaintBox(Sender).Canvas;

  Canvas.Font.Name := 'MusiQwik';
  Canvas.Font.Size := 30;

  Canvas.TextOut(10, 30, '&=B=C=D=E=F=G=H=I=!=R=S=T=U=!');
end;

gives:

notes

ulrichb
yes exactly! So somehow the component I was looking for is just a wrapper for this font. Thanks!
+1 Very nice...
Lieven