~hp/pianoteq_utils.lv2

af5a5a3d9d04c2c1f4c6ac8def183623b71ba106 — Hanspeter Portner 2 years ago bb96313
dsp: properly parse 14bit data entry.
2 files changed, 23 insertions(+), 15 deletions(-)

M VERSION
M pianoteq_utils_demo_unmute.c
M VERSION => VERSION +1 -1
@@ 1,1 1,1 @@
0.1.81
0.1.87

M pianoteq_utils_demo_unmute.c => pianoteq_utils_demo_unmute.c +22 -14
@@ 285,6 285,25 @@ connect_port(LV2_Handle instance, uint32_t port, void *data)
	}
}

static void
_update_bend_range(plughandle_t *handle, int64_t frames)
{
	if(handle->rpn == 0x0) // set bend range
	{
		const uint32_t semi = handle->data >> 7;
		const uint32_t cent = handle->data & 0x7f;

		handle->state.bend_range = semi * 100 + cent;

		const LV2_URID bend_range_urid = props_map(&handle->props,
			PIANOTEQ_UTILS__bendRange);
		props_set(&handle->props, &handle->notify.forge, frames,
			bend_range_urid, &handle->notify.ref);

		_bender(handle, frames);
	}
}

static inline int
_handle_midi(plughandle_t *handle, int64_t frames, const uint8_t *msg)
{


@@ 354,26 373,15 @@ _handle_midi(plughandle_t *handle, int64_t frames, const uint8_t *msg)
				{
					handle->data &= ~0x7f;
					handle->data |= val;

					_update_bend_range(handle, frames);
				} break;
				case LV2_MIDI_CTL_MSB_DATA_ENTRY:
				{
					handle->data &= ~0x3f80;
					handle->data |= val << 7;

					if(handle->rpn == 0x0) // set bend range
					{
						const uint32_t semi = handle->data >> 7;
						const uint32_t cent = handle->data & 0x7f;

						handle->state.bend_range = semi * 100 + cent;

						const LV2_URID bend_range_urid = props_map(&handle->props,
							PIANOTEQ_UTILS__bendRange);
						props_set(&handle->props, &handle->notify.forge, frames,
							bend_range_urid, &handle->notify.ref);

						_bender(handle, frames);
					}
					_update_bend_range(handle, frames);
				} break;
				case LV2_MIDI_CTL_SUSTAIN:
				{