hey,
i just noticed that hydrogens first instrument in instrument list is mapped to
midi note
36. but most gm compatible drum-boxes send note 35 for accoustic bass drumm by
default.
currently this issue result in a instrument shift -1. and note 35 will ignored
( no bd ).
i write a patch against this problem. see attachment.
if all devs agree i will check in the changes.
greetings wolke
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d335b84..42d2468 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -311,8 +311,7 @@ IF(VERSION_SUFFIX)
ENDIF(VERSION_SUFFIX)
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Hydrogen ${VERSION}")
-
-
+SET(CPACK_PACKAGE_CONTACT "[email protected]")
IF(WIN32)
# TODO
diff --git a/src/core/include/hydrogen/globals.h b/src/core/include/hydrogen/globals.h
index ce6426c..4892dab 100644
--- a/src/core/include/hydrogen/globals.h
+++ b/src/core/include/hydrogen/globals.h
@@ -32,6 +32,9 @@
#define MAX_BUFFER_SIZE 8192
+// midi in first note 35 for gm kit
+#define MIDI_BASE_NOTE 35
+
#define MIDI_OUT_NOTE_MIN 0
#define MIDI_OUT_NOTE_MAX 127
#define MIDI_OUT_CHANNEL_MIN -1
diff --git a/src/core/src/IO/midi_input.cpp b/src/core/src/IO/midi_input.cpp
index c47f417..f6e8239 100644
--- a/src/core/src/IO/midi_input.cpp
+++ b/src/core/src/IO/midi_input.cpp
@@ -203,7 +203,7 @@ void MidiInput::handleNoteOnMessage( const MidiMessage& msg )
if ( bPatternSelect ) {
- int patternNumber = nNote - 36;
+ int patternNumber = nNote - MIDI_BASE_NOTE;
//INFOLOG( QString( "next pattern = %1" ).arg( patternNumber ) );
pEngine->sequencer_setNextPattern( patternNumber, false, false );
@@ -211,7 +211,7 @@ void MidiInput::handleNoteOnMessage( const MidiMessage& msg )
static const float fPan_L = 1.0f;
static const float fPan_R = 1.0f;
- int nInstrument = nNote - 36;
+ int nInstrument = nNote - MIDI_BASE_NOTE;
if ( nInstrument < 0 ) {
nInstrument = 0;
}
@@ -242,7 +242,7 @@ void MidiInput::handleNoteOffMessage( const MidiMessage& msg )
int nNote = msg.m_nData1;
//float fVelocity = msg.m_nData2 / 127.0; //we need this in future to controll release velocity
- int nInstrument = nNote - 36;
+ int nInstrument = nNote - MIDI_BASE_NOTE;
if ( nInstrument < 0 ) {
nInstrument = 0;
}
@@ -251,7 +251,7 @@ void MidiInput::handleNoteOffMessage( const MidiMessage& msg )
}
Instrument *pInstr = pSong->get_instrument_list()->get( nInstrument );
- float fStep = pow( 1.0594630943593, (nNote -36) );
+ float fStep = pow( 1.0594630943593, (nNote - MIDI_BASE_NOTE) );
if ( !Preferences::get_instance()->__playselectedinstrument )
fStep = 1;
diff --git a/src/core/src/smf/smf.cpp b/src/core/src/smf/smf.cpp
index fb0e4d0..762079c 100644
--- a/src/core/src/smf/smf.cpp
+++ b/src/core/src/smf/smf.cpp
@@ -267,7 +267,7 @@ void SMFWriter::save( const QString& sFilename, Song *pSong )
(int)( 127.0 * pNote->get_velocity() );
int nInstr =
iList->index(pNote->get_instrument());
- int nPitch = 36 + nInstr;
+ int nPitch = MIDI_BASE_NOTE + nInstr;
eventList.push_back(
new SMFNoteOnEvent(
nStartTicks + nNote,
diff --git a/src/gui/src/MainForm.cpp b/src/gui/src/MainForm.cpp
index baf8fd7..e13e83c 100644
--- a/src/gui/src/MainForm.cpp
+++ b/src/gui/src/MainForm.cpp
@@ -1389,7 +1389,7 @@ bool MainForm::eventFilter( QObject *o, QEvent *e )
float pan_L = 1.0;
float pan_R = 1.0;
- engine->addRealtimeNote (row, velocity, pan_L, pan_R, 0, NULL, NULL , row + 36);
+ engine->addRealtimeNote (row, velocity, pan_L, pan_R, 0, NULL, NULL , row + MIDI_BASE_NOTE);
return TRUE; // eat event
}
diff --git a/src/gui/src/UI/ExportSongDialog_UI.ui b/src/gui/src/UI/ExportSongDialog_UI.ui
index 5f3fb4f..dce5b3a 100644
--- a/src/gui/src/UI/ExportSongDialog_UI.ui
+++ b/src/gui/src/UI/ExportSongDialog_UI.ui
@@ -173,7 +173,7 @@
<property name="readOnly">
<bool>false</bool>
</property>
- <property name="placeholderText">
+ <property name="placeholderText" stdset="0">
<string notr="true"/>
</property>
</widget>
------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel