| 670 | */ |
| 671 | |
| 672 | void lb302Synth::initNote( lb302Note *n) |
| 673 | { |
| 674 | catch_decay = 0; |
| 675 | |
| 676 | vco_inc = n->vco_inc; |
| 677 | |
| 678 | // Always reset vca on non-dead notes, and |
| 679 | // Only reset vca on decaying(decayed) and never-played |
| 680 | if(n->dead == 0 || (vca_mode==1 || vca_mode==3)) { |
| 681 | //printf(" good\n"); |
| 682 | sample_cnt = 0; |
| 683 | vca_mode = 0; |
| 684 | // LB303: |
| 685 | //vca_a = 0; |
| 686 | } |
| 687 | else { |
| 688 | vca_mode = 2; |
| 689 | } |
| 690 | |
| 691 | initSlide(); |
| 692 | |
| 693 | // Slide-from note, save inc for next note |
| 694 | if (slideToggle.value()) { |
| 695 | vco_slideinc = vco_inc; // May need to equal vco_slidebase+vco_slide if last note slid |
| 696 | } |
| 697 | |
| 698 | |
| 699 | recalcFilter(); |
| 700 | |
| 701 | if(n->dead ==0){ |
| 702 | // Swap next two blocks?? |
| 703 | #if QT_VERSION >= 0x050000 |
| 704 | vcf.load()->playNote(); |
| 705 | #else |
| 706 | vcf->playNote(); |
| 707 | #endif |
| 708 | // Ensure envelope is recalculated |
| 709 | vcf_envpos = ENVINC; |
| 710 | |
| 711 | // Double Check |
| 712 | //vca_mode = 0; |
| 713 | //vca_a = 0.0; |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | |
| 718 | void lb302Synth::initSlide() |