Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hydrogen-music/hydrogen i…
Browse files Browse the repository at this point in the history
…nto cymbal_choke

Conflicts:
	src/core/src/IO/midi_input.cpp
  • Loading branch information
blablack committed May 16, 2014
2 parents b0b33dd + 2c38a26 commit 7eed4e1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
15 changes: 9 additions & 6 deletions src/core/src/IO/midi_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ void MidiInput::handleMidiMessage( const MidiMessage& msg )
{
EventQueue::get_instance()->push_event( EVENT_MIDI_ACTIVITY, -1 );

// infoLog( "[handleMidiMessage]" );
// infoLog( "[handleMidiMessage] channel: " + to_string( msg.m_nChannel ) );
// infoLog( "[handleMidiMessage] val1: " + to_string( msg.m_nData1 ) );
// infoLog( "[handleMidiMessage] val2: " + to_string( msg.m_nData2 ) );
INFOLOG( "[start of handleMidiMessage]" );
INFOLOG( QString("[handleMidiMessage] channel: %1").arg(msg.m_nChannel) );
INFOLOG( QString("[handleMidiMessage] val1: %1").arg( msg.m_nData1 ) );
INFOLOG( QString("[handleMidiMessage] val2: %1").arg( msg.m_nData2 ) );

// midi channel filter for all messages
bool bIsChannelValid = true;
Expand Down Expand Up @@ -88,10 +88,12 @@ void MidiInput::handleMidiMessage( const MidiMessage& msg )
break;

case MidiMessage::NOTE_ON:
INFOLOG("This is a NOTE ON message.");
handleNoteOnMessage( msg );
break;

case MidiMessage::NOTE_OFF:
INFOLOG("This is a NOTE OFF message.");
handleNoteOffMessage( msg, false );
break;

Expand Down Expand Up @@ -163,6 +165,7 @@ void MidiInput::handleMidiMessage( const MidiMessage& msg )
default:
ERRORLOG( QString( "unhandled midi message type: %1" ).arg( msg.m_type ) );
}
INFOLOG("[end of handleMidiMessage]");
}

void MidiInput::handleControlChangeMessage( const MidiMessage& msg )
Expand Down Expand Up @@ -232,8 +235,8 @@ void MidiInput::handleNoteOnMessage( const MidiMessage& msg )
pEngine->sequencer_setNextPattern( patternNumber, false, false );

} else {
static const float fPan_L = 1.0f;
static const float fPan_R = 1.0f;
static const float fPan_L = 0.5f;
static const float fPan_R = 0.5f;

int nInstrument = nNote - 36;
if ( nInstrument < 0 ) {
Expand Down
7 changes: 5 additions & 2 deletions src/core/src/basics/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Note::Note( Instrument* instrument, int position, float velocity, float pan_l, f
__instrument_id( 0 ),
__position( position ),
__velocity( velocity ),
__pan_l( pan_l ),
__pan_r( pan_r ),
__pan_l( PAN_MAX ),
__pan_r( PAN_MAX ),
__length( length ),
__pitch( pitch ),
__key( C ),
Expand All @@ -67,6 +67,9 @@ Note::Note( Instrument* instrument, int position, float velocity, float pan_l, f
__adsr = __instrument->copy_adsr();
__instrument_id = __instrument->get_id();
}

set_pan_l(pan_l);
set_pan_r(pan_r);
}

Note::Note( Note* other, Instrument* instrument )
Expand Down
4 changes: 2 additions & 2 deletions src/gui/src/MainForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1387,8 +1387,8 @@ bool MainForm::eventFilter( QObject *o, QEvent *e )
Hydrogen* engine = Hydrogen::get_instance();

float velocity = 0.8;
float pan_L = 1.0;
float pan_R = 1.0;
float pan_L = 0.5f;
float pan_R = 0.5f;

engine->addRealtimeNote (row, velocity, pan_L, pan_R, 0, NULL, NULL , row + 36);

Expand Down

0 comments on commit 7eed4e1

Please sign in to comment.