Gabriel M. Beddingfield wrote:
Looks like we both stepped up at the same time. :-)
I won't be able to work on this until about 20:30 CDT (what, 02:30 UTC)...
if you do something in the mean-time it will not hurt my feelings.
OK, this looks like it's fixing the MIDI Note Off issue. However, it may
break something else (for example, sample reloading). Please test.
Krzysztof
Index: libs/hydrogen/src/adsr.cpp
===================================================================
--- libs/hydrogen/src/adsr.cpp (revision 876)
+++ libs/hydrogen/src/adsr.cpp (working copy)
@@ -145,7 +145,9 @@
if ( __state != RELEASE ) {
__release_value = __value;
+ printf("release value = %f\n", __release_value);
__state = RELEASE;
+ __ticks = 0;
return __release_value;
}
Index: libs/hydrogen/src/sampler/sampler.cpp
===================================================================
--- libs/hydrogen/src/sampler/sampler.cpp (revision 876)
+++ libs/hydrogen/src/sampler/sampler.cpp (working copy)
@@ -169,11 +169,15 @@
void Sampler::note_off( Note* note )
{
-//this is in work. i planing a sustain-curve that users can edit
-//in moment only stop_playing_notes delete the current playing note.
- stop_playing_notes( note->get_instrument() );
-//also the note_off msg from midi keyboard should be recorded into drum pattern note_map.
-//all this will develop into branch: new_fx_rack_and_sample_fun
+ assert(note);
+ Instrument *pInstr = note->get_instrument();
+ // find the notes using the same instrument, and release them
+ for ( unsigned j = 0; j < __playing_notes_queue.size(); j++ ) {
+ Note *pNote = __playing_notes_queue[ j ];
+ if ( pNote->get_instrument() == pInstr ) {
+ pNote->m_adsr.release();
+ }
+ }
}
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel