DevSound discussion

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
DevSound discussion
by on (#211390)
DevSound is a Game Boy sound driver created by me and pigdevil2010 (a.k.a. Pigu). It can be found here: https://github.com/DevEd2/DevSound. DevSound is a fairly advanced sound driver which was originally designed for use in games, but I feel it's shaping up to be a viable competitor to LSDJ. However, unlike LSDJ there is currently no editor; the only way to compose for DevSound is to write the music data manually. Eventually, I plan on creating a proper tracker for DevSound (which will run on a computer rather than on hardware).

Since there's been a bit of discussion about DevSound here lately (specifically in this thread), I thought I'd go about creating a proper thread for it. Feel free to ask questions and/or suggest features and/or bugfixes in this thread.
Re: DevSound discussion
by on (#211391)
DevEd wrote:
Eventually, I plan on creating a proper tracker for DevSound (which will run on a computer rather than on hardware).

One shortcut for this is to create a converter from FamiTracker's text export. This way, people who have problems getting DefleMask Tracker to run properly (as I've gathered from the FamiTracker community Discord server) can at least have a composing tool to work with.
Re: DevSound discussion
by on (#211392)
I've considered making a converter for FamiTracker text export format, but I decided against it as it would be impossible to get the drums to be 1:1 with FamiTracker (and I'm kind of a stickler for accuracy).

Also I'm a noob at any programming language other than GB ASM :P
Re: DevSound discussion
by on (#211393)
Might be easier to make a fork on famitracker with the behaviour and sound you want, than writing a tracker from the ground up? Keep the interface but gut the driver?
Re: DevSound discussion
by on (#211394)
DevEd wrote:
I've considered making a converter for FamiTracker text export format, but I decided against it as it would be impossible to get the drums to be 1:1 with FamiTracker (and I'm kind of a stickler for accuracy).

You could, however, get at least the sequences converted and provide a way for the composer to map each particular (pitch, instrument) combination in noise or each particular DPCM channel pitch to a corresponding drum hit. This is what ft2pently does to work around the vast difference in drum representation between FamiTracker and Pently.
Re: DevSound discussion
by on (#211397)
Another alternative is to write a MML compiler, or to take an existing one and modify it for use with DevSound.
Re: DevSound discussion
by on (#211398)
Do you plan to add a sfx system?
Re: DevSound discussion
by on (#211400)
Not at the moment, but I do plan to add SFX eventually. Right now I'm unsure of how to actually go about doing it. For now, DevSound supports integration with FX Hammer for SFX.
Re: DevSound discussion
by on (#211429)
Very interesting. I think it's a good option to use it in our GB projects.
Re: DevSound discussion
by on (#211431)
Quote:
Another alternative is to write a MML compiler

MML is better than hardtyping hex, and writing a py script converting MML strings to hex data would be easier than writing or repurposing a tracker.
But unless writing MML music for its own sake (pc speaker music for example), i can't recommend it. I think MML sequencing would be a bit of a jail sentence for the driver, dramatically put. I can only speak for myself, but i could come nowhere close to what sort of music i'd like to make if i had to write, compile, listen, write, compile, listen; all while constrained by the interface for inputting MML code in np++. Haven't done that since qBasic and i'm glad i haven't returned. :S I think a lot of other hobbyist composers like me without years of dedicated studies and training in music theory need direct aural feedback and be able to edit during playback in order to do their best. Still others may be fine, but then you've narrowed an already slim user base significantly (while expanding it vs. byte typing).
Re: DevSound discussion
by on (#211434)
As it is, I have a series of macros that are designed to make composing with DevSound more than just writing hex. For example, you can actually type notes (e.g. C_3 or F#5) rather than their raw hex value. Pretty much every feature of DevSound can be used in this way; all commands have a "mnemonic" assigned to them such as SetInstrument or EnablePWM.

I decided against an MML compiler early on because A) it would be no better than just writing it in the standard text format, and B) I personally dislike MML because it's not a "direct" means of composing. I prefer trackers because you can actually hear the music as you're writing it. The way I see it, in terms of DevSound MML would be just another text format to learn. I would prefer a more WYSIWYG solution for DevSound composing.
Re: DevSound discussion
by on (#211436)
So in other words, the macros look like the macros that Pently used before I added a fuller MML syntax to draw in composers with MML or LilyPond experience. But because this issue cross-cuts all drivers that use MML as input, I'll make a new topic about making the MML editing process more practical.

EDIT: Here's the new topic
Which sound driver?
by on (#235137)
In this post, dougeff wrote:
My advice for making a sound engine from scratch...

Don't.

Use an existing one.

Does this mean now is the time to write a converter from FamiTracker text export to DevSound bytecode?
Re: DevSound discussion
by on (#235138)
Possibly, that is a good idea. Also possibly, the data size would be larger than the famitone code I'm working on.

The main fault with devSound is the lack of tracker. Making a famitracker export work would be helpful.

(edited)
Re: Which sound driver?
by on (#235159)
tepples wrote:
In this post, dougeff wrote:
My advice for making a sound engine from scratch...

Don't.

Use an existing one.

Does this mean now is the time to write a converter from FamiTracker text export to DevSound bytecode?


If you do make a FamiTracker to DevSound converter, I would appreciate support for 0CC-FamiTracker features supported by DevSound, i.e. echo buffers.

I'd also appreciate command aliases for features that exist in DevSound but not in FamiTracker, vanilla or otherwise, i.e. PWM.
Re: DevSound discussion
by on (#235179)
I have a nearly-finished DevSound refactor that uses macros to avoid duplicating code between handling each channel - it's not complete because I can't wrap my head around some details in CH4, and DevEd is busy so I'm help-less (pun intended). I can publish it here, if there's interest.
Re: DevSound discussion
by on (#235195)
Quote:
macros


Maybe I'm misunderstanding your use of "macro", but to me, a macro is a compiler/assembler pattern that will ultimately assemble to a LARGER binary.

Maybe you mean something more like a subroutine of common code. That would reduce code size?

Or maybe just using macros to make the source code easier to read. ?
Re: DevSound discussion
by on (#235202)
As I understand nullsleep's tutorial, "macros" in MML mean the same thing as "sequences" in FamiTracker. They're essentially envelopes, which MML assigns directly to a channel but FT binds to an instrument.
Re: DevSound discussion
by on (#235334)
dougeff wrote:
Or maybe just using macros to make the source code easier to read. ?

The goal was to deduplicate code without increasing runtime costs, yes. Basically, all the channels share some code (mainly, the command reader and processor), so I basically made a giant `update_channel` ASM macro.