Click here to Skip to main content
15,889,877 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
hi
I am trying to make a music notepad in C# 2012 .the problem is how to design a form with staff(music lines)there a user be able to write notes on or between the lines and below or above the staff with a short horizental line behind the note as extra line
{

int count = 1;
public Form2()
{
InitializeComponent();


}

private void Form2_Load(object sender, EventArgs e)
{

PictureBox pb = new PictureBox() { Image = Image.FromFile(@"G:\hh.png") };//cursor _whole note
this.Cursor = new Cursor(((Bitmap)pb.Image).GetHicon());
}


private void Form2_MouseDown(object sender, MouseEventArgs e)
{
if (e.X >= 150 && e.Y >= 20 && e.X <= 400 & e.Y <= 400)
{

PictureBox aa = new PictureBox();
aa.BackColor = Color.Transparent;
Bitmap newImage = new Bitmap(@"G:\hh.png");
aa.Width = 15;
aa.Height = 10;
aa.TabIndex = 0;
aa.Image = newImage;
aa.BackColor = Color.Transparent;
aa.Name = "note" + count;
aa.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
aa.Location = new Point(e.X - 7, e.Y - 6);
this.Controls.Add(aa);
string b = Convert.ToString(aa.Name);
label1.Text = b;
shapeContainer1.BringToFront();
count++;

}
}
}
}

What I have tried:

I designed a form with 10 lines like a music sheet there a user can write notes by 'mousedown'
Posted
Updated 10-Apr-16 9:40am
Comments
OriginalGriff 10-Apr-16 8:46am    
And?
What does it do that you didn't expect, or not do that you did?
Where are you stuck?
What help do you need?
Richard MacCutchan 10-Apr-16 9:35am    
It may be a better idea to draw the lines, bars etc, manually using the grapphics class: Graphics Class (System.Drawing)[^]
Sergey Alexandrovich Kryukov 10-Apr-16 10:18am    
First of all, you should have explain the work "Notepad", because this is a name of Microsoft text editor, which has nothing to do with the topic. I can assume that you derive if from "note" and in "musical notation".

In your post, there is no effort essential to music. You just showing some image in PictureBox. Applying it to any kind of musical notation, moreover, any kind of editor, would make no sense at all. Due to lack of understanding of anything involved, I don't think you are ready for such kinds of projects yet, no matter how much help you get.

—SA
Maciej Los 10-Apr-16 11:03am    
Have a look here: PSAM Control Library
Sergey Alexandrovich Kryukov 10-Apr-16 15:18pm    
5. Any reason not to submit a formal answer? I understand it might be over the inquirer's head, as probably any material on the topic, but everyone deserves a chance...
—SA

1 solution

As Sergey Alexandrovich Krykov[^] mentioned, there's small difference between "music notepad" and musical notation. I'd suggest to read this: Musical notation - Wikipedia, the free encyclopedia[^].

As per my understanding, you want to create application which enables user to "write" (or "draw") musical notation, let's say "musical notation notepad". But... instead of that, you're trying to use controls to draw musical notation. You should create custom class which will handle such of data. Note: do not focus on graphical representation of musical notation. You should care about data:
- how to create musical symbol,
- how to place musical symbol on the staffs/staves,
- how to store information about tempo,
- etc.

Fortunaltely, someone has done it before and you can use MusicXml specification[^]. Addition information at: MusicXML - Wikipedia, the free encyclopedia[^]

There's an alternative way: PSAM Control Library[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 10-Apr-16 16:22pm    
5ed. Some more good points here.
I would also add: creating yet another score editor makes no sense if this is just editor.
It would lead to just replacement of notation-lined paper.

Such work would make sense only if some essential purely musical calculations are added; and this could be a lot of stuff. Automatic transposition would be the most trivial of operations. It could be capturing input into some predefined musical modes or roughly analogous concepts of different musical theories of non-European music, and/or into some predefined of custom rhythmic patterns, automatic generations of harmonic modulations, or embellishments, using some predefined (well-known) and custom scheme, chord manipulations, some sophisticated conversions, and a lot more. In other words, to help composing or arranging music pieces, instead of just recording existing ones. Also, import from MIDI and export to MIDI is a must.

—SA
Maciej Los 10-Apr-16 16:56pm    
Agree.
Thank you, Sergey.
hojatIzadi 12-Apr-16 8:40am    
Thank you, Sergey, for your notification. I am a software student .this project is a test. I'm not well in C#. so I need to see an example code for musical notation for at least one kind of note (like whole note) please.
Thank you
Sergey Alexandrovich Kryukov 12-Apr-16 8:54am    
No, you don't. All you need is to work harder and think more with your own brain.
Also, you need to chose more realistic projects.

As to the notes, please, be my guest: ♩ ♪ ♫ ♬ ♭ ♮ ♯ :-)
This is not your real problem. You just don't understand what's really involved.

—SA
hojatIzadi 12-Apr-16 9:22am    
OK , ))))))))))))))).absolutely

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900