still about gbbasic

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
still about gbbasic
by on (#58094)
Hi all,

Is there anyone interested to make one or two changes/additions to GBBASIC (a BASIC interpreter that runs in GB) ?

I'm a composer and I would like to use Gameboy as a sound source with different chamber ensembles (music is very experimental, atonal, but not necessarily rhythmically complex). Anyway, Shiny made wonderful job by changing GBBC (a converter which makes possible to write Basic stuff on desktop and then convert it to GBBASIC format). What I would need is two things, a possibility to change duty cycle and adding a second voice (I don't think that GBBASIC is fast enough for more than two voices). The SOUND is now in format:

SOUND x, y

where x is frequency and y is duration, if it could be changed something like:

SOUND ch, x, y, d

where ch is channel and d is duty cycle (0%,25%,50%,75%, simply 0-3).
Simpler solution would be if someone could give me hints how to open/use second voice by POKE directly to memory addresses.

Any hints, solutions etc are most welcome and greatly appreciated,
the original package can be downloaded from here:

gbb210.zip



Thanks for advance !

-jp

by on (#58101)
If you want to make sounds on the GB why don't you use something made for that, like MuddyGB, nanoloop or LSDj?

by on (#58103)
Hi mic_,

These softwares you mentioned are excellent, but I write algorithmic music, meaning I write (simple) programs which usually makes complex things. Although I've written those programs over 20 years, I'm not a good programmer (not a good composer either although my works are performed here and there quite often) and not able to change the ASM code (I've already tried). Good programs, all three, I've tried them but none of them are possible to make things I need to do, they are meant for different music and especially nanoloop and LDSj works perfectly for that purpose.

Thanks of your interest !

-jp

mic_ wrote:
If you want to make sounds on the GB why don't you use something made for that, like MuddyGB, nanoloop or LSDj?

by on (#58105)
Although there's a "risk" :) that if someone is interested to help me here, after hearing my music he will lost his/her interest, I still take my risk and put here a short example of my music. The composition is short, a little bit longer than a minute, it is scored for flute, celesta, harp and cello. Gameboy is intended to be independent part of the ensemble, the program making sounds would be written by GBBASIC, a new program for each composition, as I usually work, there's an element of chance everywhere here and writing the program just before performance adds a new dimension for this.

Hope you do not suffer too much :) !

jp

fragment #1 for flute, celesta, harp and cello



mic_ wrote:
If you want to make sounds on the GB why don't you use something made for that, like MuddyGB, nanoloop or LSDj?

by on (#58290)
I've never worked with the GameBoy's sound hardware, but adding this feature seems easy enough. There's a standard function to read an expression, which greatly simplifies things. It's all just a matter of adding two more, and then acting on them... but it's never that simple.

One issue is that GBBASIC enables the sound hardware only for the brief period of time that the 'SOUND' function is being executed, which is a very bad thing if you plan to use this for music (commenting out a few lines should fix this). More problematic is that it's a blocking command that waits until the sound is finished before continuing, but that could be fixed somewhat easily as well.

Mostly, I have doubts because GBBASIC lacks precise timing facilities, something which I assume is necessary for any composition. That isn't quite as easy.

by on (#58306)
Hi Shiny_,

I don't know ASM well, just basics, but adding this feature didn't look very complex operation, relieving to hear that it is true. There's no worry about timing, I don't know how it is done in current version but it works well, in this case GB "plays" with human performers and they are never as accurate as computer, so the current timing system is adequate enough.

Here's a technical document of sound (too):

GB programming info


Thanks of your comments Shiny_ !


-jp


Shiny_ wrote:
I've never worked with the GameBoy's sound hardware, but adding this feature seems easy enough. There's a standard function to read an expression, which greatly simplifies things. It's all just a matter of adding two more, and then acting on them... but it's never that simple.

One issue is that GBBASIC enables the sound hardware only for the brief period of time that the 'SOUND' function is being executed, which is a very bad thing if you plan to use this for music (commenting out a few lines should fix this). More problematic is that it's a blocking command that waits until the sound is finished before continuing, but that could be fixed somewhat easily as well.

Mostly, I have doubts because GBBASIC lacks precise timing facilities, something which I assume is necessary for any composition. That isn't quite as easy.

by on (#58457)
A better GB sound document

by on (#58524)
An even better sound doc, by blargg (and wikified):
http://gbdev.gg8.se/wiki/articles/Gameb ... d_hardware

And my old (somewhat obsolete but largely relevant) sound doc (it has a bunch of errors in it; if blargg's doc above counterindicates my doc on any fact, use blargg's doc):
http://web.archive.org/web/200803130253 ... BSOUND.txt

LN