Community > Project / Coder's Corner

Use of OpenMPT in C program in Linux with libmodplug

(1/2) > >>

zzo38:
Can a C program written for Linux that is currently using libmodplug be made to use the playback routines from OpenMPT? Specifically my "playmod" program

Saga Musix:
Yes it can: https://lib.openmpt.org/libopenmpt/
Either use the libmodplug emulation layer (not recommended), or change all libmodplug API calls to libopenmpt API calls. The libopenmpt API is much better structured than libmodplug's API anyway.

zzo38:
OK, thanks. However note that this program does sometimes write into the pattern data. Also is libopenmpt compatible with input that might not be seekable? (This does seem possible to do even if not seekable as far as I can tell, but there are also other problems which I cannot find the answer in their documentation.) It would be possible to avoid to write into pattern data if it were possible to write plugins in C codes and link them to channels/instruments in the mixer, so that it can be used to mute channels/instruments or for other purposes; this also I would like so that I can do use such thing.

Saga Musix:
Currently it is only possible to read and format pattern data, not write to it - writing would give away internal implementation details which may change at any time, hence it is not possible at the moment.
As for your other question, libopenmpt supports both seekable and unseekable streams. Unseekable streams will, depending on the file type, require an internal buffer that is up to the size of the full file though.

zzo38:

--- Quote from: Saga Musix on April 09, 2016, 02:15:17 ---As for your other question, libopenmpt supports both seekable and unseekable streams. Unseekable streams will, depending on the file type, require an internal buffer that is up to the size of the full file though.
--- End quote ---
This is what I have thought.

The reason I have used writing to pattern data is to mute channels/instruments and to tamper with looping, however there may be better ways to do these things (if so, I could not find it in the documentation). In some cases this would be for purposes of mixing separately (which would also require loading multiple copies), although if there are more mixing controls (I could not find it) then that would also be possible (and muting could be implemented by using these extra mixing controls perhaps). (Splitting into two separate programs might also be a way, although it is not what I intended to do.)

Navigation

[0] Message Index

[#] Next page

Go to full version