Forums

Topic: Petit Computer

Posts 2,701 to 2,720 of 9,620

randomous

@Bluerobin2 Wow, did you need a lot of screen space? Or do you just like 2 better?

If anybody's interested, the QR stitcher I made is on the Petit Computer wiki, and I've added some features: http://petitcomputer.wikia.com/wiki/Petit_Computer_QR_Stitcher

@Discostew Maybe it'll be useful for your MM2 remake? All those QR's... if you had to stitch them by hand, it would be a nightmare! Unless you're going to release them individually/already have a stitcher.

Edited on by randomous

randomous

Discostew

@randomouscrap98 I've been using PTCUtilities QR code creator, which outputs the individual QR codes and makes an HTML page to display them all. It works, but it also means I'll have 100+ QR codes in a folder on my site, whereas I could probably use your program to make one image containing all codes, and reduce the clutter. I'll see what is needed when I get to that point.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

randomous

@Discostew I didn't know PTCUtilities did that! I should really use it, but I don't want to keep scanning QR codes every time I want to test it on my system. That's cool that it makes an HTML page though.

Edited on by randomous

randomous

Sniper101

@MrSirr What is the point of the DATA 0 part in your arpeggio program? Also why do you have to put @ in front of the instrument number? Another question, why do you put quotation marks around the instrument and note data?

Edited on by Sniper101

Sniper101

3DS Friend Code: 2208-4619-7423

Discostew

Sniper101 wrote:

@MrSirr What is the point of the DATA 0 part in your arpeggio program? Also why do you have to put @ in front of the instrument number? Another question, why do you put quotation marks around the instrument and note data?

DATA 0 is just to indicate to the BGM functions that load/play music that it is the end of the current track.

The @x (where x is a number) is the way to set an instrument to the current channel. That's just basic MML design.

If you're referring to quotation marks for music like "CDEFGAB<C>", that's another design choice for MML to make it compatible with BASIC, as the only valid use of letters outside of quoted segments (which are strings in BASIC) are for functions, labels and variable names.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

MrSirr

Discostew wrote:

Sniper101 wrote:

@MrSirr What is the point of the DATA 0 part in your arpeggio program? Also why do you have to put @ in front of the instrument number? Another question, why do you put quotation marks around the instrument and note data?

DATA 0 is just to indicate to the BGM functions that load/play music that it is the end of the current track.

The @x (where x is a number) is the way to set an instrument to the current channel. That's just basic MML design.

If you're referring to quotation marks for music like "CDEFGAB<C>", that's another design choice for MML to make it compatible with BASIC, as the only valid use of letters outside of quoted segments (which are strings in BASIC) are for functions, labels and variable names.

Wow, you're good. Couldn't have explained it better myself(literally)

MrSirr

randomous

Well, I thought I'd share something that happened to me with you all in case it happens to you (although you may already know this):

I was implementing another feature in QuikNote which required a lot of jumping around and nested for-loops along with drawing/etc. Basically, it was doing a lot of repeated actions using for-loops. If I continuously ran a section of code within a for loop, the program would eventually crash with an "out of memory" error. Turns out that I was jumping out of a loop before the loop finished with a "GOTO" statement, but apparently however they've implemented the underlying code for "GOTO" doesn't take into account whether or not you're jumping out of the loop. They've probably got some code which keeps track of each loop you're in, and since I kept jumping out of the loop before finishing, it thought I was still in the loop, so when I came back to it, it thought I was in ANOTHER loop and made ANOTHER record for it. For you compiled language programmers out there, this is akin to "blowing the stack" because you made some super recursive function.

TLDR; Don't do this:

FOR I=0 TO 100
IF <WHATEVER> THEN <DO SOMETHING>:GOTO @ENDLOOP
NEXT
@ENDLOOP

Note: This is perfectly acceptable (if not a little messy) in pretty much all languages that are compiled to machine code (and support unconditional jumps to a fixed location), because the machine's not going to care about what loop you're in.

randomous

randomous

@TexMurphy Recursion is nice, but I've never liked it. If I could make a function iterative instead of recursive, even at the expense of extra data structures/complexity, I would. But I know they're useful! And yeah, pointers are always a pain, but unfortunately necessary in a lot of cases.

randomous

Hamjam00

I got bored this weekend and I made a simple drawing program. However, it only clears the screen with the a button. I'm going to fancy it up this week and get it up on twitter. (How do u post pics on nintendolife?)

Python, C/C++, Lua, Ruby rule (java is too complex lol)

Twitter:

Pixelrobin

@Randomouscrap98, Here is my updated version of your text wrap program that fits my needs. I hope it answers any questions.
Untitled
Note: This is just a demo for randomouscrap98. It is NOT a game.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

Nitras

I just got petit composer, and while it's simple to use I have one question. How would I use an MML string saved in a GRP file?

Nitras

Discostew

Nitras wrote:

I just got petit composer, and while it's simple to use I have one question. How would I use an MML string saved in a GRP file?

Do you know how it writes the MML string to the GRP? Assuming you are able to get the length and position it starts, you just read it pixel-by-pixel, left-to-right, top-to-bottom on the GRP until you have multiple strings of the MML track (with each string being up to 256 characters). You would then use BGMSET or BGMPLAY, taking those strings, and using them for the parameters. For example, if you had A1$, A2$,...,A9$ filled with MML data, you'd use BGMSET like this...

BGMSET 0,A1$,A2$,A3$,A4$,A5$,A6$,A7$,A8$,A9$

If you needed only 5 string variables, you could still use the remaining ones, so long as they are empty.

If you are unsure about how to read from the GRP, just take a look at how I did it with my MM2 Audio Player.
http://lazerlight.x10.mx/projects/megaman-2-ptc/megaman-2-ptc...

Edited on by Discostew

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

randomous

@Bluerobin2 Lol I like the textbox! It looks really nice, and I like that it was directed at me haha. Hope whatever you use it in goes well

randomous

ramstrong

randomouscrap98 wrote:

@HamJam00 It's [img][/img] with the url in between

Also, here's a bunch of other stuff you can do: https://www.nintendolife.com/forums/help/helpful_tips_for_form...

Hey, I got bored this weekend and made a drawing program too! It's like it's the drawing program weekend or something. Well, really I got "inspiration" to make it, but it's still drawing program weekend lol.

No way! Both of you and HamJam are inspired to write a drawing program? That's unbelievable, because ... me too!
Hey, how about we all do our drawing program and see which one is best?
Here's a quick one that I did in an hour:

@INIT
ACLS:GPAINT 1,1,1
PNLTYPE “OFF”
GPAGE 1: GPAINT 1,1,1
LOCATE 7,5:?”QUICKIE DRAW”
LOCATE 9,7:?”BY”
LOCATE 11,9:?”HARRY HARDJONO”
LOCATE 6,17:?”A CLEAR SCREEN”
LOCATE 6,18:?”B CLEAR PROGRAM”

@PRE
S=TCHST:X0=TCHX:Y0=TCHY
IF BTRIG()==16 GOTO @INIT
IF BTRIG()==32 GOTO @END
IF S==0 GOTO @PRE
@LOOP
X1=TCHX:Y1=TCHY
GLINE X0,Y0,X1,Y1,14
X0=X1:Y0=Y1
IF TCHST==0 GOTO @PRE ELSE GOTO @LOOP
@END
END

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

randomous

@ramstrong Lol this is an interesting situation. But I've already made mine, it's in the QR code thread (and on the wiki). It's not really a graphics editing program but more of a place to jot down some things or to play with. It's fun to watch what you drew redraw itself (or at least, I like watching stuff draw itself).

Edited on by randomous

randomous

MrSirr

ramstrong wrote:

randomouscrap98 wrote:

@HamJam00 It's [img][/img] with the url in between

Also, here's a bunch of other stuff you can do: https://www.nintendolife.com/forums/help/helpful_tips_for_form...

Hey, I got bored this weekend and made a drawing program too! It's like it's the drawing program weekend or something. Well, really I got "inspiration" to make it, but it's still drawing program weekend lol.

No way! Both of you and HamJam are inspired to write a drawing program? That's unbelievable, because ... me too!
Hey, how about we all do our drawing program and see which one is best?
Here's a quick one that I did in an hour:

@INIT
ACLS:GPAINT 1,1,1
PNLTYPE “OFF”
GPAGE 1: GPAINT 1,1,1
LOCATE 7,5:?”QUICKIE DRAW”
LOCATE 9,7:?”BY”
LOCATE 11,9:?”HARRY HARDJONO”
LOCATE 6,17:?”A CLEAR SCREEN”
LOCATE 6,18:?”B CLEAR PROGRAM”

@PRE
S=TCHST:X0=TCHX:Y0=TCHY
IF BTRIG()==16 GOTO @INIT
IF BTRIG()==32 GOTO @END
IF S==0 GOTO @PRE
@LOOP
X1=TCHX:Y1=TCHY
GLINE X0,Y0,X1,Y1,14
X0=X1:Y0=Y1
IF TCHST==0 GOTO @PRE ELSE GOTO @LOOP
@END
END

You dont need the @END though really. You could just put
IF BTRIG()==32 THEN END
just sayin lol

MrSirr

Please login or sign up to reply to this topic