Changeset 582
- Timestamp:
- 10/20/08 20:32:45 (3 months ago)
- Files:
-
- branches/new_fx_rack_and_sample_fun/data/hydrogen.default.conf (modified) (1 diff)
- branches/new_fx_rack_and_sample_fun/gui/src/AudioFileBrowser/AudioFileBrowser.cpp (modified) (1 diff)
- branches/new_fx_rack_and_sample_fun/gui/src/PatternEditor/DrumPatternEditor.cpp (modified) (6 diffs)
- branches/new_fx_rack_and_sample_fun/gui/src/PatternEditor/NotePropertiesRuler.cpp (modified) (2 diffs)
- branches/new_fx_rack_and_sample_fun/libs/hydrogen/include/hydrogen/Preferences.h (modified) (1 diff)
- branches/new_fx_rack_and_sample_fun/libs/hydrogen/include/hydrogen/note.h (modified) (2 diffs)
- branches/new_fx_rack_and_sample_fun/libs/hydrogen/src/hydrogen.cpp (modified) (1 diff)
- branches/new_fx_rack_and_sample_fun/libs/hydrogen/src/note.cpp (modified) (3 diffs)
- branches/new_fx_rack_and_sample_fun/libs/hydrogen/src/preferences.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/new_fx_rack_and_sample_fun/data/hydrogen.default.conf
r346 r582 182 182 <textColor>40,40,40</textColor> 183 183 <noteColor>40,40,40</noteColor> 184 184 <noteoffColor>100,100,200</noteoffColor> 185 185 <lineColor>65,65,65</lineColor> 186 186 <line1Color>75,75,75</line1Color> branches/new_fx_rack_and_sample_fun/gui/src/AudioFileBrowser/AudioFileBrowser.cpp
r581 r582 53 53 54 54 model = new QDirModel(); 55 model->setFilter( QDir::AllDirs | QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden);55 model->setFilter( QDir::AllDirs | QDir::AllEntries | QDir::NoDotAndDotDot ); 56 56 model->setNameFilters( QStringList() << "*.wav" << "*.WAV" << "*.flac"<< "*.FLAC" << "*.aiff" << "*.AIFF"<< "*.au" << "*.AU" ); 57 57 model->setSorting( QDir::DirsFirst |QDir::Name ); branches/new_fx_rack_and_sample_fun/gui/src/PatternEditor/DrumPatternEditor.cpp
r457 r582 185 185 const int nLength = -1; 186 186 const float fPitch = 0.0f; 187 Note *pNote = new Note( pSelectedInstrument, nPosition, fVelocity, fPan_L, fPan_R, nLength, fPitch); 187 Note *pNote = new Note( pSelectedInstrument, nPosition, fVelocity, fPan_L, fPan_R, nLength, fPitch ); 188 pNote->set_noteoff( false ); 188 189 m_pPattern->note_map.insert( std::make_pair( nPosition, pNote ) ); 189 190 … … 225 226 break; 226 227 } 227 } 228 } 229 /// 230 // create the new note 231 const unsigned nPosition = nColumn; 232 const float fVelocity = 0.0f; 233 const float fPan_L = 0.5f; 234 const float fPan_R = 0.5f; 235 const int nLength = 1; 236 const float fPitch = 0.0f; 237 Note *poffNote = new Note( pSelectedInstrument, nPosition, fVelocity, fPan_L, fPan_R, nLength, fPitch); 238 poffNote->set_noteoff( true ); 239 m_pPattern->note_map.insert( std::make_pair( nPosition, poffNote ) ); 240 241 // hear note 242 Preferences *pref = Preferences::getInstance(); 243 if ( pref->getHearNewNotes() ) { 244 Note *pNote2 = new Note( pSelectedInstrument, 0, fVelocity, fPan_L, fPan_R, nLength, fPitch); 245 AudioEngine::get_instance()->get_sampler()->note_on(pNote2); 246 } 247 pSong->__is_modified = true; 248 /// 228 249 } 229 250 // potrei essere sulla coda di una nota precedente.. … … 282 303 283 304 if (m_bRightBtnPressed && m_pDraggedNote ) { 305 if ( m_pDraggedNote->get_noteoff() ) return; 284 306 int nTickColumn = getColumn( ev ); 285 307 … … 391 413 static const UIStyle *pStyle = Preferences::getInstance()->getDefaultUIStyle(); 392 414 static const QColor noteColor( pStyle->m_patternEditor_noteColor.getRed(), pStyle->m_patternEditor_noteColor.getGreen(), pStyle->m_patternEditor_noteColor.getBlue() ); 415 static const QColor noteoffColor( pStyle->m_patternEditor_noteoffColor.getRed(), pStyle->m_patternEditor_noteoffColor.getGreen(), pStyle->m_patternEditor_noteoffColor.getBlue() ); 393 416 394 417 p.setRenderHint( QPainter::Antialiasing ); … … 412 435 p.setPen( noteColor ); 413 436 414 if ( note->get_lenght() == -1 ) { // trigger note437 if ( note->get_lenght() == -1 && note->get_noteoff() == false ) { // trigger note 415 438 uint x_pos = 20 + (pos * m_nGridWidth);// - m_nGridWidth / 2.0; 416 439 … … 433 456 p.drawLine(x_pos - 1, y_pos + 3, x_pos, y_pos + 4); 434 457 } 458 else if ( note->get_lenght() == 1 && note->get_noteoff() == true ){ 459 p.setPen( noteoffColor ); 460 uint x_pos = 20 + (pos * m_nGridWidth);// - m_nGridWidth / 2.0; 461 462 uint y_pos = ( nInstrument * m_nGridHeight) + (m_nGridHeight / 2) - 3; 463 464 // draw the "dot" 465 p.drawLine(x_pos, y_pos, x_pos + 5, y_pos + 5); // A 466 p.drawLine(x_pos, y_pos, x_pos - 5, y_pos + 5); // B 467 p.drawLine(x_pos, y_pos + 8, x_pos + 5, y_pos + 5); // C 468 p.drawLine(x_pos - 5, y_pos + 5, x_pos, y_pos + 8); // D 469 470 p.drawLine(x_pos, y_pos + 3, x_pos + 4, y_pos + 5); 471 p.drawLine(x_pos, y_pos + 3, x_pos - 4, y_pos + 5); 472 p.drawLine(x_pos, y_pos + 7, x_pos + 4, y_pos + 5); 473 p.drawLine(x_pos - 4, y_pos + 5, x_pos, y_pos + 7); 474 475 p.drawLine(x_pos, y_pos + 4, x_pos + 3, y_pos + 5); 476 p.drawLine(x_pos, y_pos + 4, x_pos - 3, y_pos + 5); 477 p.drawLine(x_pos, y_pos + 6, x_pos + 3, y_pos + 5); 478 p.drawLine(x_pos - 3, y_pos + 5, x_pos, y_pos + 6); 479 480 481 } 435 482 else { 436 483 uint x = 20 + (pos * m_nGridWidth); branches/new_fx_rack_and_sample_fun/gui/src/PatternEditor/NotePropertiesRuler.cpp
r377 r582 120 120 } 121 121 122 if ( m_mode == VELOCITY ) {122 if ( m_mode == VELOCITY && !pNote->get_noteoff() ) { 123 123 pNote->set_velocity( val ); 124 124 … … 210 210 continue; 211 211 } 212 if ( m_mode == VELOCITY ) {212 if ( m_mode == VELOCITY && !pNote->get_noteoff() ) { 213 213 float val = pNote->get_velocity() + delta; 214 214 if (val > 1.0) { branches/new_fx_rack_and_sample_fun/libs/hydrogen/include/hydrogen/Preferences.h
r581 r582 111 111 H2RGBColor m_patternEditor_textColor; 112 112 H2RGBColor m_patternEditor_noteColor; 113 H2RGBColor m_patternEditor_noteoffColor; 113 114 H2RGBColor m_patternEditor_lineColor; 114 115 H2RGBColor m_patternEditor_line1Color; branches/new_fx_rack_and_sample_fun/libs/hydrogen/include/hydrogen/note.h
r526 r582 200 200 } 201 201 202 void set_noteoff( bool noteOff ) { 203 __noteoff = noteOff; 204 } 205 float get_noteoff() const { 206 return __noteoff; 207 } 208 209 210 202 211 203 212 private: … … 208 217 float __pan_r; ///< Pan of the note (right volume) [0..1] 209 218 float __leadlag; ///< Lead or lag offset of the note 219 bool __noteoff; ///< note type 210 220 211 221 int __lenght; branches/new_fx_rack_and_sample_fun/libs/hydrogen/src/hydrogen.cpp
r571 r582 543 543 544 544 // aggiungo la nota alla lista di note da eseguire 545 if ( pNote->get_noteoff() ){ 546 AudioEngine::get_instance()->get_sampler()->note_off( pNote ); 547 } 545 548 AudioEngine::get_instance()->get_sampler()->note_on( pNote ); 546 549 547 550 m_songNoteQueue.pop(); // rimuovo la nota dalla lista di note 548 551 pNote->get_instrument()->dequeue(); branches/new_fx_rack_and_sample_fun/libs/hydrogen/src/note.cpp
r371 r582 54 54 , __velocity( velocity ) 55 55 , __leadlag( 0.0 ) 56 , __noteoff( false) 56 57 { 57 58 set_pan_l( fPan_L ); … … 76 77 set_lenght( pNote->get_lenght() ); 77 78 set_pitch( pNote->get_pitch() ); 79 set_noteoff( pNote->get_noteoff() ); 78 80 m_noteKey = pNote->m_noteKey; 79 81 m_fCutoff = pNote->m_fCutoff; … … 128 130 void Note::dumpInfo() 129 131 { 130 INFOLOG( "pos: " + to_string( get_position() ) + "\t humanize offset" + to_string(m_nHumanizeDelay) + "\t instr: " + __instrument->get_name()+ "\t key: " + keyToString( m_noteKey ) + "\t pitch: " + to_string( get_pitch() ) );132 INFOLOG( "pos: " + to_string( get_position() ) + "\t humanize offset" + to_string(m_nHumanizeDelay) + "\t instr: " + __instrument->get_name()+ "\t key: " + keyToString( m_noteKey ) + "\t pitch: " + to_string( get_pitch() ) + "\t noteoff: " + to_string( get_noteoff() ) ); 131 133 } 132 134 branches/new_fx_rack_and_sample_fun/libs/hydrogen/src/preferences.cpp
r581 r582 1010 1010 LocalFileMng::writeXmlString( &patternEditorNode, "textColor", m_pDefaultUIStyle->m_patternEditor_textColor.toStringFmt() ); 1011 1011 LocalFileMng::writeXmlString( &patternEditorNode, "noteColor", m_pDefaultUIStyle->m_patternEditor_noteColor.toStringFmt() ); 1012 1013 if (m_pDefaultUIStyle->m_patternEditor_noteoffColor.toStringFmt() == "-1,-1,-1" ){ 1014 m_pDefaultUIStyle->m_patternEditor_noteoffColor = H2RGBColor( "100, 100, 200" ); 1015 } 1016 LocalFileMng::writeXmlString( &patternEditorNode, "noteoffColor", m_pDefaultUIStyle->m_patternEditor_noteoffColor.toStringFmt() ); 1017 1012 1018 LocalFileMng::writeXmlString( &patternEditorNode, "lineColor", m_pDefaultUIStyle->m_patternEditor_lineColor.toStringFmt() ); 1013 1019 LocalFileMng::writeXmlString( &patternEditorNode, "line1Color", m_pDefaultUIStyle->m_patternEditor_line1Color.toStringFmt() ); … … 1046 1052 m_pDefaultUIStyle->m_patternEditor_textColor = H2RGBColor( LocalFileMng::readXmlString( pPatternEditorNode, "textColor", m_pDefaultUIStyle->m_patternEditor_textColor.toStringFmt() ) ); 1047 1053 m_pDefaultUIStyle->m_patternEditor_noteColor = H2RGBColor( LocalFileMng::readXmlString( pPatternEditorNode, "noteColor", m_pDefaultUIStyle->m_patternEditor_noteColor.toStringFmt() ) ); 1054 m_pDefaultUIStyle->m_patternEditor_noteoffColor = H2RGBColor( LocalFileMng::readXmlString( pPatternEditorNode, "noteoffColor", m_pDefaultUIStyle->m_patternEditor_noteoffColor.toStringFmt() ) ); 1048 1055 m_pDefaultUIStyle->m_patternEditor_lineColor = H2RGBColor( LocalFileMng::readXmlString( pPatternEditorNode, "lineColor", m_pDefaultUIStyle->m_patternEditor_lineColor.toStringFmt() ) ); 1049 1056 m_pDefaultUIStyle->m_patternEditor_line1Color = H2RGBColor( LocalFileMng::readXmlString( pPatternEditorNode, "line1Color", m_pDefaultUIStyle->m_patternEditor_line1Color.toStringFmt() ) );
