Opened 16 years ago

Closed 16 years ago

Last modified 6 years ago

#8940 closed patch

Custom percussion instruments for the AdLib MIDI driver

Reported by: jvprat Owned by:
Priority: normal Component: Audio
Version: Keywords:
Cc: Game:


The attached patch adds custom instruments support to the AdLib MIDI driver. It lets the Groovie engine to play the AdLib music properly without having to use the FMOPL driver directly. I've used 'ADLP' as the sysex type, adding P for percussion to the standard AdLib instruments (I guess that's an internal constant). With this each key can be associated to an AdLib instrument definition and the absolute note that should be played.

In addition, the patch removes the empty implementation of AdlibPercussionChannel::controlChange(), which lets the volume to be set properly for the percussion channel. If the other controls need to be ignored, a personalized implementation could be done.

I'm submitting it to the tracker because it's my first time with AdLib instruments and I don't know whether this approach is good enough, or maybe it should be changed to a more general solution. Thanks in advance to any reviews.

Ticket imported from: #2357165. Ticket imported from: patches/1045.

Attachments (1)

adlib-percussion.patch (2.8 KB ) - added by jvprat 16 years ago.

Download all attachments as: .zip

Change History (5)

by jvprat, 16 years ago

Attachment: adlib-percussion.patch added

comment:1 by lordhoto, 16 years ago

I don't see anything bad about adding that 'ADLP' type for sysEx_customInstrument.

I'm a bit unsure about direct copying of the passed data into a AdlibInstrument struct though. After all the struct is not packed, so it could contain alignment bytes. Thus I would rather just setup the struct per hand, if the passed data is really a simple byte stream of the data stored in AdlibInstrument.

comment:2 by jvprat, 16 years ago

I've commited it with lordhoto's proposed changes.

comment:3 by jvprat, 16 years ago

Status: newclosed

comment:4 by digitall, 6 years ago

Component: Audio
Note: See TracTickets for help on using tickets.