4

I am making a music notation app for Android for one of my school projects.

  • In this app, I don't have a music notation rendering mechanism. Instead, I use a font, which has all different notes in different heights with the music sheet lines in place. This way, all I need to do is to insert characters into an EditText view.
  • Lately, I found out that I couldn't have 2 notes playing at the same time with this method.

I'd like to know if there is a way for 2 characters to overlap each other in an EditText view, so that 2 notes with different heights can be displayed in the same column.

Alternatively, if anyone knows of a library for rendering music on Android, please share the knowledge with me.

Matthieu Brucher
  • 21,634
  • 7
  • 38
  • 62
hoangbv15
  • 360
  • 2
  • 4
  • 14
  • Thats really is a good question.. but i don't think someone would implement it unless its found usefull... no one demands for something like that.. – ngesh May 24 '11 at 12:29
  • I think you'd be better off with a SurfaceView. You could have dedicated bitmaps for the staffs and different types of notes. The placement of the notes on the staffs shouldn't be that hard. – Jim Clay May 24 '11 at 12:29
  • Could you achieve what you want to by overlaying multiple TextViews with transparent backgrounds, with each TextView having a particular vertical offset corresponding to the pitch it represents? – Trevor May 24 '11 at 12:31
  • @Trev16v That is not an admissible solution, because the music sheet needs to "scroll" when there is not enough space to display it. The drawing method seems to be the only solution now, but I have only about 3 or 4 days to finish this project... Any comment would be very much of help now. Thank you all. – hoangbv15 May 24 '11 at 13:27

1 Answers1

1

Use a SurfaceView with the necessary music PNG bitmaps. You can find a lot of the needed bitmaps here, assuming your project can handle whatever open source license Wikibooks uses. If it can't, I'm sure you can find music bitmaps elsewhere.

Jim Clay
  • 963
  • 9
  • 24
  • Thank you for your response, it was very informative. So basically, a library for this doesn't exist on Android? I have seen a lot of advice about implementing my own method. – hoangbv15 May 24 '11 at 17:23
  • Not that I am aware of. I am fairly new to Android myself, though, so it is possible there is one out there somewhere. – Jim Clay May 24 '11 at 17:26
  • seems to be the only solution now. Thank you very much. – hoangbv15 May 26 '11 at 05:44