From 7bcb00197542b15b2914bf175b1a7bde6b7c16f3 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 11 Nov 2022 14:03:51 -0500 Subject: [PATCH] cwMidi.h : Added isSoftPedal() --- cwMidi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cwMidi.h b/cwMidi.h index fd0c0af..3e7353b 100644 --- a/cwMidi.h +++ b/cwMidi.h @@ -99,6 +99,10 @@ namespace cw template< typename T> bool isSostenutoPedalDown( T s, T d0, T d1) { return ( isSostenutoPedal(s,d0) && (d1)>=64 ); } template< typename T> bool isSostenutoPedalUp( T s, T d0, T d1) { return ( isSostenutoPedal(s,d0) && (d1)<64 ); } + template< typename T> bool isSoftPedal( T s, T d0 ) { return ( kCtlMdId <= (s) && (s) <= (kCtlMdId + kMidiChCnt) && (d0)== kSoftPedalCtlMdId ); } + template< typename T> bool isSoftPedalDown( T s, T d0, T d1) { return ( isSoftPedal(s,d0) && (d1)>=64 ); } + template< typename T> bool isSoftPedalUp( T s, T d0, T d1) { return ( isSoftPedal(s,d0) && (d1)<64 ); } + template< typename T> bool isPedal( T s, T d0 ) { return ( kCtlMdId <= (s) && (s) <= (kCtlMdId + kMidiChCnt) && (d0)>=kSustainCtlMdId && (d0)<=kLegatoCtlMdId ); } template< typename T> bool isPedalDown( T s, T d0, T d1 ) { return ( isPedal(s,d0) && (d1)>=64 ); } template< typename T> bool isPedalUp( T s, T d0, T d1 ) { return ( isPedal(s,d0) && (d1)<64 ); }