我怎么做音乐记事本? [英] How do I a music notepad ?

查看:74
本文介绍了我怎么做音乐记事本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在C#2012上制作一个音乐记事本。问题是如何设计一个带有工作人员(音乐线)的表格,用户可以在其上或之间写下音符。线条以及工作人员的下方或上方,在笔记后面有一条短的horizental线作为额外的线

{



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& eY< = 400)

{



PictureBox aa = new PictureBox();

aa.BackColor = Color.Transparent;

位图newImage =新位图(@G:\\\ hh.png);

aa.Width = 15;

aa.Height = 10;

aa.TabIndex = 0;

aa.Image = newImage;

aa.BackColor = Color 。透明;

aa.Name =note+ count;

aa.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;

aa。 Location = new Point(eX-7,eY-6);

this.Controls.Add(aa);

string b = Convert.ToString(aa.Name) ;

label1.Text = b;

shapeContainer1.BringToFront();

count ++;



}

}

}

}



我尝试了什么:



我设计了一个包含10行的表单,如音乐表,用户可以通过'mousedown'编写音符

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'

推荐答案

正如 Sergey Alexandrovich Krykov [ ^ ]提到,音乐记事本和乐谱。我建议你阅读:音乐符号 - 维基百科,免费的百科全书 [ ^ ]。



根据我的理解,你想创建一个应用程序,使用户可以写(或画)乐谱,让我们说乐谱记事本的。但是......而不是那样,你试图用控件来绘制乐谱。您应该创建将处理此类数据的自定义类。注意:不要专注于乐谱的图形表示。您应该关心数据:

- 如何创建音乐符号,

- 如何在乐谱/谱表上放置音乐符号,

- 如何存储有关节奏的信息,

- 等等



Fortunaltely,之前有人做过,你可以使用MusicXml规范 [ ^ ]。添加信息: MusicXML - 维基百科,免费的百科全书 [ ^ ]



还有另一种方法: PSAM控制库 [ ^ ]
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[^]


这篇关于我怎么做音乐记事本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆