SynthMaker

Reduce CPU usage of Wave/Memory Read Components

Archive · 2009 8 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

TheAudiophileDutchman ·

Ways of drastically reducing CPU usage of Wave/Memory Read components without affecting sound quality (i.e. no hopping) by changing behaviour as follows:

* Only access memory to read a (new) value as soon as the index changes and then hold that value (no @samplerate reading of the same value over and over again).

* When using samples add to the above: only access memory if index<=sampleindex and kill the voice if index>sampleindex

* ... (more suggestions)

exonerate ·

* The wave read component should also take a polyInt as it's index. Each wave read AFAIA rounds to int internally, often this is a waste, we could round using the polyInt components and feed that to numerous wave reads.

*There should be a component that takes 2 float arrays and outputs a stereo wave file, effectively allowing one to read two float arrays with one wave read. ( I've tried creating something like this but couldn't get it to work).

*Allow me to ASM optimize the code. 😉

Cheers 😉

Exo

TheAudiophileDutchman ·

exonerate wrote: *Allow me to ASM optimize the code. 😉

For that you would need direct memory access in the code component, right?

exonerate ·

TheAudiophileDutchman wrote: exonerate wrote: *Allow me to ASM optimize the code. 😉

For that you would need direct memory access in the code component, right?

You mean a mem input? If we had that we could write our own wave reads. So yes.

A mem input (to the ASM component at least) is actually my most wanted feature! it would mean I could write a synth/sampler entirely in the ASM component. 😀

My second most wanted feature is the Lua component! I'd use that entirely for the GUI. 🙂

Cheers 😉

Exo

rl ·

since float -> int conversion is CPU-intense:

* add more primitives to allow manipulations of polyints (add, multiply,..)

* a int datatype for the code module for faster array index handling

BTW: The ASM primitive already supports a memin statement. I just couldn't find out how to use it (yet). At least SM seems to be prepared for that.

Andrew J ·

rl wrote: BTW: The ASM primitive already supports a memin statement. I just couldn't find out how to use it (yet). At least SM seems to be prepared for that.

Does it? I actually asked Malc for this early in January. His reply then was it would be quite fiddly and potentially buggy - so he was going to take a look at other ways to initialise float arrays instead (which would have solved my request).

TheAudiophileDutchman ·

Just tried, but I didn't figure out the secret handshake yet to get 'memin' to work: 😕

memin test; streamout out; mov eax, ptr test[0]; movaps xmm0,eax; // [eax] results in a crash movaps out,xmm0;

altf13 ·

exonerate wrote: My second most wanted feature is the Lua component! I'd use that entirely for the GUI. 🙂 Exo

rl wrote: since float -> int conversion is CPU-intense: * add more primitives to allow manipulations of polyints (add, multiply,..) * a int datatype for the code module for faster array index handling

I'm using my first post to +1 these.

Code is so much easier when dealing with arrays, I'd rather use some strategic hopping (even with what should be triggered data) than deal with matrices of array modules. Bitshifting ints in code would be awesome too. In a project I'm doing now, that would allow me to lose a dozen streamins and hop the partitioning, saving a huge fraction of the cost of streaming in a bunch of numbers that don't change too often.

A triggered scripting component would solve all my woes.

So...ints + bit shifting + lua (or an otherwise arbitrarily triggered code module) = happy times.

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.