ModPlug Central

OpenMPT => Help and Questions => Topic started by: EthanF4D on February 23, 2018, 10:54:19

Title: libopenmpt interactive feature request: play_note at sample offset
Post by: EthanF4D on February 23, 2018, 10:54:19
Hi developers,
I would like to have a way to play_note() at sample offset like the command 9XX or Oxx.

The current play_note API has (note, instrument, volume, panning) which is quite basic and does a good job.
On the other hand, the interactive API also included 'global effect' such as set_speed, set_tempo and 'per channel effect' such as set_channel_mute_status

what is the vision for the interactive API? will it keep on evolving to be fully functional for many commands or there is a limit of what it can do?
Title: Re: libopenmpt interactive feature request: play_note at sample offset
Post by: Saga Musix on February 23, 2018, 16:57:29
It's not planned, but rather than adding more and more optional parameters of play_note(), I'd rather add extra functions that can manipulate any playing channel, e.g. channel_offset(int channel, int offset).
These kind of requests are better kept on our issue tracker (https://bugs.openmpt.org/) by the way, as it's easier to keep track of requests and bug reports there.
Title: Re: libopenmpt interactive feature request: play_note at sample offset
Post by: EthanF4D on February 24, 2018, 08:06:19
Seems promising. I will post a request on issue tracker.

Is it because of the commands are queued and happen on the next tick, so that we can modify the note's property after play_note() ?
int channel = play_note(...);
if (channel != -1) {
  set_channel_sample_offset(channel, offset);
}
Title: Re: libopenmpt interactive feature request: play_note at sample offset
Post by: Saga Musix on February 24, 2018, 12:37:55
Quote from: EthanF4D on February 24, 2018, 08:06:19
Is it because of the commands are queued and happen on the next tick, so that we can modify the note's property after play_note() ?
No, there is no "queue". But until the next call to read() libopenmpt will naturally not do any rendering, so it's okay to change these properties after the note has been triggered.