From 8bd614ddcb75541711ef287880f08c9f49f139b1 Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Sat, 25 Aug 2018 20:19:03 +0200 Subject: upgrade timing resolution to the microsecond --- src/adlmidi_private.hpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/adlmidi_private.hpp') diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index f719f01..0b7994a 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -558,7 +558,7 @@ public: //! Vibrato depth value vibdepth; //! Vibrato delay time - int64_t vibdelay; + int64_t vibdelay_us; //! Last LSB part of RPN value received uint8_t lastlrpn, //! Last MSB poart of RPN value received @@ -801,7 +801,7 @@ public: noteAfterTouchInUse = false; vibspeed = 2 * 3.141592653 * 5.0; vibdepth = 0.5 / 127; - vibdelay = 0; + vibdelay_us = 0; panning = 64; portamento = 0; portamentoEnable = false; @@ -866,12 +866,12 @@ public: //! Has fixed sustain, don't iterate "on" timeout bool fixed_sustain; //! Timeout until note will be allowed to be killed by channel manager while it is on - int64_t kon_time_until_neglible; - int64_t vibdelay; + int64_t kon_time_until_neglible_us; + int64_t vibdelay_us; }; //! Time left until sounding will be muted after key off - int64_t koff_time_until_neglible; + int64_t koff_time_until_neglible_us; enum { users_max = 128 }; LocationData *users_first, *users_free_cells; @@ -888,12 +888,12 @@ public: void users_assign(const LocationData *users, size_t count); // For channel allocation: - AdlChannel(): koff_time_until_neglible(0) + AdlChannel(): koff_time_until_neglible_us(0) { users_clear(); } - AdlChannel(const AdlChannel &oth): koff_time_until_neglible(oth.koff_time_until_neglible) + AdlChannel(const AdlChannel &oth): koff_time_until_neglible_us(oth.koff_time_until_neglible_us) { if(oth.users_first) { @@ -906,16 +906,16 @@ public: AdlChannel &operator=(const AdlChannel &oth) { - koff_time_until_neglible = oth.koff_time_until_neglible; + koff_time_until_neglible_us = oth.koff_time_until_neglible_us; users_assign(oth.users_first, oth.users_size); return *this; } /** - * @brief Increases age of active note in milliseconds time - * @param ms Amount time in milliseconds + * @brief Increases age of active note in microseconds time + * @param us Amount time in microseconds */ - void addAge(int64_t ms); + void addAge(int64_t us); }; #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER -- cgit v1.2.3 From c7b3199669a7b7e0ba11eb0d94d4e143a5fdd633 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Fri, 31 Aug 2018 03:54:16 +0300 Subject: Added high tone frequency extension from OPL3-BE --- src/adlmidi_private.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/adlmidi_private.hpp') diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 0b7994a..2fc12a4 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -399,10 +399,11 @@ public: /** * @brief On the note in specified chip channel with specified frequency of the tone - * @param c Channel of chip (Emulated chip choosing by next formula: [c = ch + (chipId * 23)]) + * @param c1 Channel of chip [or master 4-op channel] (Emulated chip choosing by next formula: [c = ch + (chipId * 23)]) + * @param c2 Slave 4-op channel of chip, unused for 2op (Emulated chip choosing by next formula: [c = ch + (chipId * 23)]) * @param hertz Frequency of the tone in hertzes */ - void noteOn(size_t c, double hertz); + void noteOn(size_t c1, size_t c2, double hertz); /** * @brief Change setup of instrument in specified chip channel -- cgit v1.2.3 From 34ac11d4e79cef67596ad30dfa9df4f9586641aa Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Thu, 6 Sep 2018 05:31:39 +0200 Subject: access into global chip settings --- src/adlmidi_private.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/adlmidi_private.hpp') diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 2fc12a4..d179d72 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -448,6 +448,11 @@ public: */ void setVolumeScaleModel(ADLMIDI_VolumeModels volumeModel); + /** + * @brief Get the volume scaling model + */ + ADLMIDI_VolumeModels getVolumeScaleModel(); + #ifndef ADLMIDI_HW_OPL /** * @brief Clean up all running emulated chip instances -- cgit v1.2.3 From 6a90c71084b2d21c01346075924ebe01b9cfd051 Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Tue, 11 Sep 2018 13:32:07 +0200 Subject: have consistent null checks and returns --- src/adlmidi_private.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/adlmidi_private.hpp') diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index d179d72..c5b70ee 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -82,6 +82,7 @@ typedef int32_t ssize_t; //#else #include #include +#include // nothrow //#endif #include #include -- cgit v1.2.3