Make a music software

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
3 posts Page 1 of 1
Contributors
User avatar
RunarM
Hardcore Programmer
Hardcore Programmer
Posts: 508
Joined: Wed Nov 18, 2009 11:33 pm

Make a music software
RunarM
We're going to make a music software
If you have seen my software "Play my Guitar" then you know what we're making now.
viewtopic.php?f=54&t=957

**For a reason all the sound files have to be saved as .Wav


It very simple!!

First you need a background, i'm going to use this iphone piano:
Image

Just download it and click on your form, go to BackgroundImage and choose it.
Now you will have the iphone piano as your background all we have to add 14 picture boxes, we will add 14 because there are 14 piano keys (or whatever they called)

You will also need to make all those picture boxes transparent:
Just go to BackColor -> Web and Click Transparent. ( Its on the top )

You will also need 14 piano sounds, you have to find that by yourself, i'm going to add the source of this in the vip area, plus some drum, acoustic guitar, electric guitar and piano sounds [maybe more]

When you have found the sounds you want, click on 'My Project' then go to resource and add all the sounds you want.

When you got that go back to your form and double click on 1 of the picture boxes and enter this code:
Code: Select all
My.Computer.Audio.Play(My.Resources.YOURSOURCE, AudioPlayMode.Background)
You see there it says 'YOURSOURCE', you have to edit that with 1 of your sounds..
Example:
One of my sound files is called CHANGPIANOHARD_A_1OGG so this is the code for the picturebox:
Code: Select all
My.Computer.Audio.Play(My.Resources.CHANGPIANOHARD_A_1OGG, AudioPlayMode.Background)
Thats it, simple and good!

Now, if you want it to sound smoother when you click not like 'click, sound stop' 'click, sound stop' then you have to write MouseDown and not click:
For example:
Code: Select all
    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
        My.Computer.Audio.Play(My.Resources.CHANGPIANOHARD_A_1OGG, AudioPlayMode.Background)
    End Sub
New:
Code: Select all
    Private Sub PictureBox1_MouseDow(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseDow
        My.Computer.Audio.Play(My.Resources.CHANGPIANOHARD_A_1OGG, AudioPlayMode.Background)
    End Sub
I just replaced MouseDow with click..

If you want to stop all music with a button just add this code to the button:
Code: Select all
My.Computer.Audio.Stop()

If you didnt get anything of this tutorial don't worry, i'll be adding pictures later so it will be easier..
Thanks and have a nice day!

-RunarM
Just another day in my life.
http://www.codexvideos.com
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: Make a music software
CodenStuff
Hello,

Excellent tutorial!. You should make an application with a guitar, keyboard, drums and maybe some other instruments all in one and add a way to save each instruments notes then play them all back at once and we can make some nice tunes :D cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Re: Make a music software
hungryhounduk
Hi
I was hunting around at Home today for a Tutorial i'd written and saved to CDROM on this very same theme cooll; But for FLASH ...............But could not find it ( i have around 2,000 cdroms :? ) I really like the Style of Piano you have put up :)

Good Tutorial and is virtualy the same for coding it in Flash wahooo;

Well Done

Chris
Image
3 posts Page 1 of 1
Return to “Tutorials”