MultiSampler

Post any examples or modules that you want to share here
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: MultiSampler

Post 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
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: MultiSampler

Post 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.
Attachments
gsampv0.2.0.fsm
(48.3 KiB) Downloaded 1257 times
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: MultiSampler

Post 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.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: MultiSampler

Post 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.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: MultiSampler

Post by tulamide »

Short not, KG, you know why. You're not forgotten.
"There lies the dog buried" (German saying translated literally)
Post Reply