Csound Csound-dev Csound-tekno Search About

[Csnd] Efficient way to implement a "vector mixer"

Date2017-11-20 20:45
From"Jeanette C."
Subject[Csnd] Efficient way to implement a "vector mixer"
Hey hey everyone,
not sure, if "vector mixer" is the correct term: I have a number of audio 
signals, in the program logic indexed from 0 to n. Based on a floating point 
mixing controller, between 0 and n, I'd like to mix each two consecutive 
signals based on:
klevel_left = 1 - frac(kmix_index)
klevel_right = frac(kmix_index)

I haven't found a direct opcode to do this for me.

The complete number of audio signals will be <10. My current approach is to do 
it on a conditional basis:
1. calculate the left and right levels once
2. based on the integral part - int(kmix_index) use if/elseif to find the 
correct pair
3. inside the conditional blocks, mix the two signals into an output signal

Is there a faster better approach?

TIA.

Best wishes,

Jeanette

--------
* website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c

If there's nothing missing in my life
Then why do these tears come at night <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-11-20 22:51
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Efficient way to implement a "vector mixer"
You could use (n) tables with precalculated level for each output, and index the tables with your kmix_index (?)

2017-11-20 21:45 GMT+01:00 Jeanette C. <julien@mail.upb.de>:
Hey hey everyone,
not sure, if "vector mixer" is the correct term: I have a number of audio signals, in the program logic indexed from 0 to n. Based on a floating point mixing controller, between 0 and n, I'd like to mix each two consecutive signals based on:
klevel_left = 1 - frac(kmix_index)
klevel_right = frac(kmix_index)

I haven't found a direct opcode to do this for me.

The complete number of audio signals will be <10. My current approach is to do it on a conditional basis:
1. calculate the left and right levels once
2. based on the integral part - int(kmix_index) use if/elseif to find the correct pair
3. inside the conditional blocks, mix the two signals into an output signal

Is there a faster better approach?

TIA.

Best wishes,

Jeanette

--------
* website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c

If there's nothing missing in my life
Then why do these tears come at night <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



--
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here