Page 9 of 9

Re: MultiSampler

PostPosted: Thu Nov 24, 2016 10:34 am
by Spogg
I haven't tried it in detail yet but I do like the interface so I would say this is the right direction KG. Very nice!

Cheers

Spogg

Re: MultiSampler

PostPosted: Sat Dec 03, 2016 11:41 pm
by KG_is_back
OK guys, another update.
Now all looping modes are implemented. All combinations of attack sustain and release phase are available and working OK-ish. Problem I have is, CPU goes way up and will go even more as I add additional channels (current version still works with 1 channel only, evne though GUI suggests 8). I'm unsure how to solve the issue.

Re: MultiSampler

PostPosted: Sun Dec 04, 2016 12:55 am
by martinvicanek
Have you profiled the code to see where most of the CPU is spent? You might consider hopping for control signals, for instance you could convert pitch to period at hop(32). Not sure how much that helps though.

Re: MultiSampler

PostPosted: Sun Dec 04, 2016 2:08 am
by KG_is_back
martinvicanek wrote:Have you profiled the code to see where most of the CPU is spent? You might consider hopping for control signals, for instance you could convert pitch to period at hop(32). Not sure how much that helps though.


The CPU seems to be rather evenly spaced across the board. Each voice has 3 clocks. Each clock has two int parts and frac parts (one pair for counting time and one for counting readout position). A code version of the clock would look something like this:
Code: Select all
temp=f+step;
f=temp%1;
i=i+(temp-f);

Also, each sample the value of (i+f) is compared with section-end-points to determine whether attack/sustain/release phase is ended.


I have two possible ideas how to make it more efficient. One would be to switch to double floats, which would circumvent int<->float conversions for rounding purposes until the very end. The downside is, that the value of the clock needs to be checked each sample for section-transitions.
Second option is to hop the dumping of the fractional. Something like:

Code: Select all
f=f+step;
hop(32){
temp=f%1;
i=i+(f-temp);
f=temp;
}


This would however not remove the issue - the integer and fractional part still need to be calculated each sample for readouts.

Another big CPU eater is the waveArrayRead prim - there are 3 per voice.

Re: MultiSampler

PostPosted: Sun Dec 04, 2016 2:40 am
by tulamide
Short not, KG, you know why. You're not forgotten.