So how do I make music?

#1kirbycoolPosted 7/21/2012 9:19:05 PM
I'm not even sure where to start :/
This isn't very "basic".

There a simple tutorial on coding basic things like this anywhere?

Like enough to let me display text on the screen and make a song that plays on said screen?
---
Sent from my iPhone via my iPhone. I have an iPhone.
#2Javier687Posted 7/21/2012 9:42:36 PM
Yes, it may be a bit hard, but you learn while experimenting. Try the commands, and see what they do. Also, read the manual thoroughly to understand.

Text and song?
Those are the simplest commands.
Hint: PRINT
Hint 2: BGMPLAY
---
"I am Bowser, businessman of legend! Fear my accounting!" -Bowser Morton Koopa
#3kirbycool(Topic Creator)Posted 7/21/2012 9:52:46 PM
Well I figured out the print thing by reading the manual but the program closes right when i open it. I figured the "wait" command would have it stay on the screen but that doesn't do anything :/.

And the background music command is good to know, but how do I make my own bgm? I assume once I make my own song i will use this command to play it.

Thanks for the help, I'll look over the manual again.
---
Sent from my iPhone via my iPhone. I have an iPhone.
#4Javier687Posted 7/21/2012 10:21:53 PM
The WAIT command needs a quantity of time. Like WAIT 60.
---
"I am Bowser, businessman of legend! Fear my accounting!" -Bowser Morton Koopa
#5ErrorSupplyPosted 7/21/2012 10:32:25 PM
In sample1, the last few lines of code give an example of how to maintain the program until you push a button:

@KLOOP
VSYNC 1
IF BTRIG()!=16 THEN @KLOOP
END
---
PSN: SirVoe
#6mstop_4Posted 7/22/2012 2:07:09 PM(edited)
To make your own music, you'll need to know how to transcribe your music into MML. For example, the following code will play the C scale in 8th notes with a piano:

'C Scale Player

@SONGDATA
DATA ":0@1T120O4"
DATA "C8D8E8F8G8A8B8<C8"
DATA 0

' Load song data and play
BGMCLEAR 128
BGMSETD 128,@SONGDATA
BGMPLAY 128

' Wait for button press
@KLOOP
VSYNC 1
IF BTRIG()!=16 THEN @KLOOP
END


To clarify the DATA lines:

- The first line describes channel info: Channel 0 (:0) is played with Instrument 1, the Acoustic Grand Piano (@1), at tempo 120 BPM (T120) starting in octave 4 (O4).
- The second line is the note data. In this case, the C scale (CDEFGAB) played with 8th notes (8). The "<" indicates an upward jump in octave.
- The third line tells the program that the song data has ended

For a more complicated example, here's the QR code for a program I made that plays "Tim 1" from Lemmings:

http://i1181.photobucket.com/albums/x430/mstop_4/tim1.png
---
"Put it in H!"
#7kirbycool(Topic Creator)Posted 7/22/2012 5:47:09 PM
Thanks for the explanation guys! I'll study up on this stuff until I get it right.
---
Sent from my iPhone via my iPhone. I have an iPhone.
#8drexegarPosted 7/23/2012 4:46:07 AM
To mstop_4:

Dude your a big help, This is great, When I'm done with my video game for the AGBIC.com, next month I'm going to start writing a simple program for the petit computer PC utility so people can have a nice music interface and turn there files into code.

By the way, Did you figure out how to add effects like attack or velocity?

That synthesizer that japanese guy made is a really good tester program to test out all the functionality of the music item, too bad you can't record music with it, but it does have an editor that let you save the file that makes a custom instrument for the user sounds! You can then use a program like Famitracker and grab any presets you would normally here in gameboy games or arcade games of complex japan nes game music.
#9mstop_4Posted 7/23/2012 6:16:41 PM
drexegar posted...
To mstop_4:

Dude your a big help, This is great, When I'm done with my video game for the AGBIC.com, next month I'm going to start writing a simple program for the petit computer PC utility so people can have a nice music interface and turn there files into code.

By the way, Did you figure out how to add effects like attack or velocity?

That synthesizer that japanese guy made is a really good tester program to test out all the functionality of the music item, too bad you can't record music with it, but it does have an editor that let you save the file that makes a custom instrument for the user sounds! You can then use a program like Famitracker and grab any presets you would normally here in gameboy games or arcade games of complex japan nes game music.


You're welcome. : ) It would be nice to have an easier way to compose music on this instead of manually typing out long lines of text that looks like gibberish from a distance.

You can adjust the velocity by using the V[N] command where [N] is the desired velocity from 0 to 127. The ( command increases velocity while ) decreases velocity for gradual changes. @V[N] adjusts the channel volume, again [N] ranges from 0 to 127.

As for attack, the ADSR envelope is activated using the command @E[A],[D],[S],[R] (each value is 0-127) and deactivated using @ER
---
"Put it in H!"
#10UncleSporkyPosted 7/24/2012 3:40:41 PM
Your Lemmings example is awesome and very helpful in figuring out how MML works, so thanks a lot.

Did you type all that manually, or did you use some sort of conversion program? Did you convert it from a MIDI, or do it by ear?