Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/2.3' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst committed Aug 3, 2024
2 parents 31fa6ea + fc51822 commit e542eda
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 32 deletions.
22 changes: 13 additions & 9 deletions .azure/azure-pipelines-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ jobs:
- job: macOS_brew
strategy:
matrix:
UnixLibs11:
imageName: 'macos-11'
UnixLibs13:
imageName: 'macOS-13'
CMakeFlags: '-Denable-framework=0'
ReadlinePkgConf: ''
UnixLibs11_static:
imageName: 'macos-11'
UnixLibs13_static:
imageName: 'macOS-13'
CMakeFlags: '-Denable-framework=0 -DBUILD_SHARED_LIBS=0'
ReadlinePkgConf: ''
UnixLibs11_static_pkgconf_readline:
imageName: 'macos-11'
UnixLibs13_static_pkgconf_readline:
imageName: 'macOS-13'
CMakeFlags: '-Denable-framework=0 -DBUILD_SHARED_LIBS=0'
ReadlinePkgConf: '$(brew --prefix readline)/lib/pkgconfig'
UnixLibs12:
Expand All @@ -50,8 +50,8 @@ jobs:
imageName: 'macos-12'
CMakeFlags: '-Denable-framework=0 -DBUILD_SHARED_LIBS=0'
ReadlinePkgConf: '$(brew --prefix readline)/lib/pkgconfig'
FrameWork11:
imageName: 'macos-11'
FrameWork13:
imageName: 'macOS-13'
CMakeFlags: ''
ReadlinePkgConf: ''
FrameWork12:
Expand Down Expand Up @@ -137,9 +137,13 @@ jobs:
# imageName: 'macos-11'
# CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0
12_0_universal_unixlibs:
macPortsUrl: 'https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-12-Monterey.pkg'
macPortsUrl: 'https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3-12-Monterey.pkg'
imageName: 'macos-12'
CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0'
13_0_universal_unixlibs:
macPortsUrl: 'https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3-13-Ventura.pkg'
imageName: 'macos-13'
CMakeFlags: '-Denable-sdl2=0 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -Denable-framework=0'
pool:
vmImage: $(imageName)
steps:
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ set ( PACKAGE "fluidsynth" )
# FluidSynth package version
set ( FLUIDSYNTH_VERSION_MAJOR 2 )
set ( FLUIDSYNTH_VERSION_MINOR 3 )
set ( FLUIDSYNTH_VERSION_MICRO 5 )
set ( FLUIDSYNTH_VERSION_MICRO 6 )
set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" )
set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )

Expand All @@ -62,7 +62,7 @@ set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
# This is not exactly the same algorithm as the libtool one, but the results are the same.
set ( LIB_VERSION_CURRENT 3 )
set ( LIB_VERSION_AGE 2 )
set ( LIB_VERSION_REVISION 3 )
set ( LIB_VERSION_REVISION 4 )
set ( LIB_VERSION_INFO
"${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" )

Expand Down
4 changes: 2 additions & 2 deletions doc/fluidsynth-v20-devdoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
\author David Henningsson
\author Tom Moebert
\author Copyright © 2003-2023 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
\version Revision 2.3.5
\date 2024-01-11
\version Revision 2.3.6
\date 2024-08-03

All the source code examples in this document are in the public domain; you can use them as you please. This document is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/3.0/ . The FluidSynth library is distributed under the GNU Lesser General Public License. A copy of the GNU Lesser General Public License is contained in the FluidSynth package; if not, visit https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Expand Down
20 changes: 12 additions & 8 deletions src/midi/fluid_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ new_fluid_midi_file(const char *buffer, size_t length)
FLUID_MEMSET(mf, 0, sizeof(fluid_midi_file));

mf->c = -1;
mf->running_status = -1;
mf->running_status = 0;

mf->buffer = buffer;
mf->buf_len = (int)length;
Expand Down Expand Up @@ -632,6 +632,7 @@ fluid_midi_file_read_event(fluid_midi_file *mf, fluid_track_t *track)
/* read the delta-time of the event */
if(fluid_midi_file_read_varlen(mf) != FLUID_OK)
{
FLUID_LOG(FLUID_DBG, "Reading delta-time failed unexpectedly (track=%d)", track->num);
return FLUID_FAILED;
}

Expand All @@ -651,7 +652,7 @@ fluid_midi_file_read_event(fluid_midi_file *mf, fluid_track_t *track)
{
if((mf->running_status & 0x80) == 0)
{
FLUID_LOG(FLUID_ERR, "Undefined status and invalid running status");
FLUID_LOG(FLUID_ERR, "Undefined status and invalid running status (0x%X, 0x%X)", status, mf->running_status);
return FLUID_FAILED;
}

Expand All @@ -660,14 +661,12 @@ fluid_midi_file_read_event(fluid_midi_file *mf, fluid_track_t *track)
}

/* check what message we have */

mf->running_status = status;

if(status == MIDI_SYSEX) /* system exclusif */
if(status == MIDI_SYSEX) /* system exclusive */
{
/* read the length of the message */
if(fluid_midi_file_read_varlen(mf) != FLUID_OK)
{
FLUID_LOG(FLUID_DBG, "Failed to read length of SYSEX msg (track=%d)", track->num);
return FLUID_FAILED;
}

Expand All @@ -686,6 +685,7 @@ fluid_midi_file_read_event(fluid_midi_file *mf, fluid_track_t *track)
/* read the data of the message */
if(fluid_midi_file_read(mf, metadata, mf->varlen) != FLUID_OK)
{
FLUID_LOG(FLUID_DBG, "Failed to read data of SYSEX msg (track=%d)", track->num);
FLUID_FREE(metadata);
return FLUID_FAILED;
}
Expand Down Expand Up @@ -733,6 +733,7 @@ fluid_midi_file_read_event(fluid_midi_file *mf, fluid_track_t *track)
/* get the length of the data part */
if(fluid_midi_file_read_varlen(mf) != FLUID_OK)
{
FLUID_LOG(FLUID_DBG, "Failed to read length of META msg (track=%d)", track->num);
return FLUID_FAILED;
}

Expand Down Expand Up @@ -765,6 +766,7 @@ fluid_midi_file_read_event(fluid_midi_file *mf, fluid_track_t *track)
FLUID_FREE(dyn_buf);
}

FLUID_LOG(FLUID_DBG, "Failed to read meta msg (track=%d)", track->num);
return FLUID_FAILED;
}
}
Expand Down Expand Up @@ -932,6 +934,7 @@ fluid_midi_file_read_event(fluid_midi_file *mf, fluid_track_t *track)
break;

default:
FLUID_LOG(FLUID_INFO, "Ignoring unrecognized meta event type 0x%X", type);
break;
}

Expand All @@ -946,7 +949,8 @@ fluid_midi_file_read_event(fluid_midi_file *mf, fluid_track_t *track)
}
else /* channel messages */
{

// remember current status (not applicable to SYSEX and META events!)
mf->running_status = status;
type = status & 0xf0;
channel = status & 0x0f;

Expand Down Expand Up @@ -1015,7 +1019,7 @@ fluid_midi_file_read_event(fluid_midi_file *mf, fluid_track_t *track)

default:
/* Can't possibly happen !? */
FLUID_LOG(FLUID_ERR, "Unrecognized MIDI event");
FLUID_LOG(FLUID_ERR, "Unrecognized MIDI event 0x%X", status);
return FLUID_FAILED;
}

Expand Down
2 changes: 1 addition & 1 deletion src/synth/fluid_chan.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct _fluid_channel_t
enum fluid_interp interp_method; /**< Interpolation method (enum fluid_interp) */

unsigned char channel_pressure; /**< MIDI channel pressure from [0;127] */
unsigned char pitch_wheel_sensitivity; /**< Current pitch wheel sensitivity */
float pitch_wheel_sensitivity; /**< Current pitch wheel sensitivity */
short pitch_bend; /**< Current pitch bend value */
/* Sostenuto order id gives the order of SostenutoOn event.
* This value is useful to known when the sostenuto pedal is depressed
Expand Down
20 changes: 10 additions & 10 deletions src/synth/fluid_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,11 +1811,12 @@ fluid_synth_cc_LOCAL(fluid_synth_t *synth, int channum, int num)
break;

case DATA_ENTRY_LSB: /* not allowed to modulate (spec SF 2.01 - 8.2.1) */
break;

case DATA_ENTRY_MSB: /* not allowed to modulate (spec SF 2.01 - 8.2.1) */
{
int data = (value << 7) + fluid_channel_get_cc(chan, DATA_ENTRY_LSB);
/* handle both because msb might come first */
int lsb_value = fluid_channel_get_cc(chan, DATA_ENTRY_LSB);
int msb_value = fluid_channel_get_cc(chan, DATA_ENTRY_MSB);
int data = (msb_value << 7) + lsb_value;

if(chan->nrpn_active) /* NRPN is active? */
{
Expand All @@ -1842,10 +1843,9 @@ fluid_synth_cc_LOCAL(fluid_synth_t *synth, int channum, int num)
{
switch(fluid_channel_get_cc(chan, RPN_LSB))
{
case RPN_PITCH_BEND_RANGE: /* Set bend range in semitones */
fluid_channel_set_pitch_wheel_sensitivity(synth->channel[channum], value);
case RPN_PITCH_BEND_RANGE: /* Set bend range in semitones plus cents */
fluid_channel_set_pitch_wheel_sensitivity(synth->channel[channum], msb_value + lsb_value / 100.0f); /* 0-127 maps to 0-100 cents */
fluid_synth_update_pitch_wheel_sens_LOCAL(synth, channum); /* Update bend range */
/* FIXME - Handle LSB? (Fine bend range in cents) */
break;

case RPN_CHANNEL_FINE_TUNE: /* Fine tune is 14 bit over +/-1 semitone (+/- 100 cents, 8192 = center) */
Expand All @@ -1855,18 +1855,18 @@ fluid_synth_cc_LOCAL(fluid_synth_t *synth, int channum, int num)

case RPN_CHANNEL_COARSE_TUNE: /* Coarse tune is 7 bit and in semitones (64 is center) */
fluid_synth_set_gen_LOCAL(synth, channum, GEN_COARSETUNE,
value - 64);
msb_value - 64);
break;

case RPN_TUNING_PROGRAM_CHANGE:
fluid_channel_set_tuning_prog(chan, value);
fluid_channel_set_tuning_prog(chan, msb_value);
fluid_synth_activate_tuning(synth, channum,
fluid_channel_get_tuning_bank(chan),
value, TRUE);
msb_value, TRUE);
break;

case RPN_TUNING_BANK_SELECT:
fluid_channel_set_tuning_bank(chan, value);
fluid_channel_set_tuning_bank(chan, msb_value);
break;

case RPN_MODULATION_DEPTH_RANGE:
Expand Down

0 comments on commit e542eda

Please sign in to comment.