I've got a simple little mock-up program to work out some background details for my project or hello-sound (I have the feeling the latter will evolve into something for my final). Unfortunately, I can't get any different notes to play. I'm assuming there's a flaw in my quick plan (basically it's just the sample sound program combined with hello-sprite's key-press loop) or maybe I'm not telling it the frequency in the right manner.
I've zipped the whole thing with one proprietary include file and it should also require ibmpc1.inc, gbhw.inc as well as gbhw-snd.inc.
--
John Harrison
http://alumni.media.mit.edu/~harrison
Alec Jahn wrote:
>
>
> How about just subtract 256 from all the values and sorta "add it in"
> later (not literally, of course) in the calculation? That's probably
> another of my logic attempts that isn't quite plausible.
>
>
Yeah I was thinking about this as a possibility too, but then you have
the limitation of freqs only between 256 and 511. I wanted to go over
lookup tables in class tomorrow anyway, so it might make more sense
after that.
John
I just wanted to say that I fixed my (currently hard-coded) synth program to workproperly on a Gameboy. Originally, it wouldn't play the note if I held it down. When I let go of that key press, it would play that note for whatever length it was defaulted on (it played one "blip!!!").
I thought, "Hey, lets throw a halt (and subsequent nop) in there after the note call and see what happens. Well, that happened to have worked out great. So instead of
push af
and PADF_DOWN
call nz,adownB
pop af
as my hard-coded note press (in this case, for the down direction) I now have
push af
and PADF_DOWN
call nz,adownB
halt
nop
pop af
Cool.
Only problem is now unlike on the emulator (before the halts) it does not play the note continuously (like singing one long note) it instead plays the note really fast (like hitting a note on a piano really fast over and over again) which is OK, I suppose. Much better than what I had. I can understand why it is doing this, but not sure how to fix it. Any suggestions?
it sounds like you are having bouncing problems with the keypad. Try disabling the need for the keypad in your code (call the code which is supposed to play the note, regardless of input, then go to the wait infinite loop) and see if you get what you expected. That will help you figure out what is wrong.
Alec Jahn wrote:
Well, my programmer works great, but I'm having trouble with my code.When I hold a note, it doesn't play the note for the entire hey press. Only when you let go of the button will it play it, and it's just a little blip of sound.I remember a couple of classes ago you mentioned some problem you had to fix when you tried the hello-noise example on a real gameboy, but I don't remember if my code was written after the change or even what the change was. Could this possibly be the solution?
On 3/31/08, Alec Jahn <ocedto...@gmail.com> wrote:
Alright, cool. For now, I'll just stare at code until I'm sleepy. :P
On 3/31/08, John Harrison <john.harrison@wichita.edu> wrote:
Alec Jahn wrote:
>
>
> How about just subtract 256 from all the values and sorta "add it in"
> later (not literally, of course) in the calculation? That's probably
> another of my logic attempts that isn't quite plausible.
>
>
Yeah I was thinking about this as a possibility too, but then you have
the limitation of freqs only between 256 and 511. I wanted to go over
lookup tables in class tomorrow anyway, so it might make more sense
after that.
John
Updated files but still same issue :(
http://cratel.wichita.edu/blogs/assembly08/2008/05/06/hello-monkey/
When you use bigsprite, there's actually 3 numbers involved with every
description: the bigsprite ID, the sprite ID or sprite IDs associated
with that bigsprite, and the tile ids associated with each sprite.
Obviously you can use the same tile(s) for multiple sprites and thus for
multiple bigsprites, but the list of sprite #s for each bigsprite must
be unique.
In your case, you used sprite 5 in both bigsprite 9 and bigsprite 10.
But 1 sprite can't be in 2 places at once so you have a conflict.
Sometimes it appears there are only 2 sets of numbers but believe you me
and the one-eyed-cat there's 3. The confusion comes from the fact that
bigsprite tries to make life easier for us by associating each sprite #
with the corresponding tile number i.e. sprite 5 is assigned to tile 5,
sprite 6 to tile 6, etc. This happens automatically in the background
when we do INIT_BS. So that's where the 3rd set of numbers come in. It
is possible, though, to have for example both sprites 5 and 6 assigned
to tile 5. But we have to do that manually after the bigsprite
initialization. What is not possible is to have bigsprites 5 and 6
assigned to sprite 5. Or it's possible I suppose. But it gives, shall we
say, "alternative" results.
What I assume you want is to have bigsprite 9 and bigsprite 10 both use
tile 5, which is why you assigned them both to sprite 5. Here's how I
did accomplished that:
I left bigsprite 9 alone. It seemed happy enough. I noticed you weren't
using sprite 12 anywhere in your code so for bigsprite 10 I changed it's
assignment from sprite 5 to sprite 12 i.e. my line 64 of DaMan.asm reads:
db 12 ; was 5
Ok that's fine except that now bigsprite will assign bigsprite 10 to
tile 12 after the INIT_BS call and I assume you wanted it assigned to
tile 5. No problem. Reassign it yourself after bigsprite initializes. In
MrMonkeyMan.asm in line 127 right after INIT_BS:
SetSpriteTileNum 12,5
which assigns sprite 12 to tile 5.
Incidentally, your code actually built on my machine, which made me very
happy...except that I had to comment out your line:
LoWordVar RandSeed
because that's already declared in the "stock" version of gbrandom.
Let me know if this solves it. I know you've been sweating this for awhile.
Cool game, BTW.
-John
sms...@wichita.edu wrote:
>
> Updated files but still same issue :(
>
>
>
> http://cratel.wichita.edu/blogs/assembly08/2008/05/06/hello-monkey/
>
>
> >
--
John Harrison
http://alumni.media.mit.edu/~harrison
Umm, do you have no idea what is wrong or was i just overlooked?
----- Original Message -----
From: sms...@wichita.edu Date: Wednesday, May 7, 2008 7:32 pm Subject: [wsu-assembly-engrs:408] Re: Trouble getting different notes to play