| @@ -682,7 +682,7 @@ void tLivingString2_initToPool (tLivingString2* const pl, float freq, floa · 681 unmodified lines |
| 682 | 682 | LEAF* leaf = p->mempool->leaf; |
| 683 | 683 | |
| 684 | 684 | p->curr=0.0f; |
| 685 | | − tExpSmooth_initToPool(&p->wlSmooth, leaf->sampleRate/freq, 0.01f, mp); // smoother for string wavelength (not freq, to avoid expensive divisions) |
| 685 | + tExpSmooth_initToPool(&p->wlSmooth, leaf->sampleRate/freq, 0.1f, mp); // smoother for string wavelength (not freq, to avoid expensive divisions) |
| 686 | 686 | tLivingString2_setFreq(pl, freq); |
| 687 | 687 | p->freq = freq; |
| 688 | 688 | p->prepPos = prepPos; |
| @@ -691,7 +691,7 @@ void tLivingString2_initToPool (tLivingString2* const pl, float freq, floa · 2 unmodified lines |
| 691 | 691 | tExpSmooth_initToPool(&p->puSmooth, pickupPos, 0.01f, mp); // smoother for pickup position |
| 692 | 692 | tLivingString2_setPickPos(pl, pickPos); |
| 693 | 693 | tLivingString2_setPrepPos(pl, prepPos); |
| 694 | | − p->prepIndex=prepIndex; |
| 694 | + p->prepIndex = prepIndex; |
| 695 | 695 | p->pickupPos = pickupPos; |
| 696 | 696 | tHermiteDelay_initToPool(&p->delLF,p->waveLengthInSamples, 2400, mp); |
| 697 | 697 | tHermiteDelay_initToPool(&p->delUF,p->waveLengthInSamples, 2400, mp); |
| @@ -745,6 +745,7 @@ void tLivingString2_setFreq(tLivingString2* const pl, float freq) · 47 unmodified lines |
| 745 | 745 | LEAF* leaf = p->mempool->leaf; |
| 746 | 746 | if (freq<20.f) freq=20.f; |
| 747 | 747 | else if (freq>10000.f) freq=10000.f; |
| 748 | + freq = freq*2; |
| 748 | 749 | p->freq = freq; |
| 749 | 750 | p->waveLengthInSamples = (leaf->sampleRate/freq) - 1; |
| 750 | 751 | tExpSmooth_setDest(&p->wlSmooth, p->waveLengthInSamples); |
| @@ -754,6 +755,7 @@ void tLivingString2_setWaveLength(tLivingString2* const pl, float waveLength · 3 unmodified lines |
| 754 | 755 | { |
| 755 | 756 | _tLivingString2* p = *pl; |
| 756 | 757 | LEAF* leaf = p->mempool->leaf; |
| 758 | + waveLength = waveLength * 0.5f; |
| 757 | 759 | if (waveLength<4.8f) waveLength=4.8f; |
| 758 | 760 | else if (waveLength>2400.f) waveLength=2400.f; |
| 759 | 761 | p->waveLengthInSamples = waveLength - 1; |
| @@ -926,27 +928,27 @@ float tLivingString2_tick(tLivingString2* const pl, float input) · 166 unmodified lines |
| 926 | 928 | tHermiteDelay_setDelay(&p->delUF, upLen); |
| 927 | 929 | tHermiteDelay_setDelay(&p->delUB, upLen); |
| 928 | 930 | |
| 929 | | − /* |
| 930 | | − uint pickupPosInt; |
| 931 | + |
| 932 | + uint32_t pickupPosInt; |
| 931 | 933 | float pickupOut = 0.0f; |
| 932 | | − if (pickupPos < 0.9f) |
| 934 | + if (p->pickupPos < 0.98f) |
| 933 | 935 | { |
| 934 | | − float fullPickupPos = (pickupPos*upLen); |
| 935 | | − pickupPosInt = (uint) fullPickupPos; |
| 936 | + float fullPickupPos = (p->pickupPos*upLen); |
| 937 | + pickupPosInt = (uint32_t) fullPickupPos; |
| 936 | 938 | float pickupPosFloat = fullPickupPos - pickupPosInt; |
| 937 | 939 | if (pickupPosInt == 0) |
| 938 | 940 | { |
| 939 | 941 | pickupPosInt = 1; |
| 940 | 942 | } |
| 941 | 943 | pickupOut = tHermiteDelay_tapOutInterpolated(&p->delUF, pickupPosInt, pickupPosFloat); |
| 942 | | − pickupOut += tHermiteDelay_tapOutInterpolated(&p->delUB, (uint) (upLen - pickupPosInt), pickupPosFloat); |
| 944 | + pickupOut += tHermiteDelay_tapOutInterpolated(&p->delUB, (uint32_t) (upLen - pickupPosInt), pickupPosFloat); |
| 943 | 945 | p->curr = pickupOut; |
| 944 | 946 | } |
| 945 | 947 | else |
| 946 | | − */ |
| 947 | | − //{ |
| 948 | + |
| 949 | + { |
| 948 | 950 | p->curr = fromBridge; |
| 949 | | − //} |
| 951 | + } |
| 950 | 952 | |
| 951 | 953 | //p->curr = fromBridge; |
| 952 | 954 | //p->curr += fromNut; |