[Scilab-users] designing a sound file

P M p.muehlmann at gmail.com
Sun Dec 22 10:31:28 CET 2019


...ticket is solved.
Thank you Jan + Federico.

Creating a zero-vector of just the right length and inserting the sound at
the correct position just does it.

BR
Philipp


Am So., 22. Dez. 2019 um 00:23 Uhr schrieb Federico Miyara <
fmiyara at fceia.unr.edu.ar>:

>
> Philipp,
>
> You can certainly use the strategy you propose. This should work:
>
> tick = wavread("path/tick.wav");
> tock = wavread("path/tock.wav");
> ntick =  length(tick);
> ntock =  length(tock);
> m = max(ntick, ntock;                  // Just in case both lengths differ
> Fs = 44100;
> x = zeros(1, n*Fs + m);                // Allocate space allowing room for
> the last sound
> for k = 0:n
>    if floor(k/2)== k/2                 // tick if k is even, tock if odd
>        x(k*Fs + 1:k*Fs + ntick) = tick;
>    else
>        x(k*Fs + 1:k*Fs + ntock) = tock;
>    end
> end
>
> If you would like the sound to be a bit more realistic, you could apply
> some reververberation. To do that, create an impulse response by generating
> a random noise using grand with normal distribution and applying to it a
> decreasing exponential envelope with a time constant about 1/14 times the
> desired reverberation time (about 0.5 s for a normal living room). The
> duration of the impulse response should be longer than the reverberation
> time.
>
> Then convolve it with the dry signal x using conv. When you are done, sum
> an attenuated version of the result to the dry signal.
>
> Redards,
>
> Federico Miyara
>
>
> On 21/12/2019 17:16, P M wrote:
>
> Dear experts,
>
> I try to compose (design) a small sound file, made of several wav-files.
>
> My question:       How to approach this task in the best way?
>
>
> Here some input:
>
> - sound 1: Tick-sound of a clock
> - sound 2: Tock-sound of a clock
>
> each wav-file has these properties:
> - length: 0.1 sec
> - bits: 32
> - sample rate: 44100 Hz
> - mono
>
> Now:
> I want to create a tick-tock sound of length  n-seconds  .. where I can
> choice the length of n
> Each Tick-Tock-sound must be exactly 1-second apart from each other.
>
> I load the sounds with: loadwave
>
> Do I have to create a single "silent" wav file first, which is  n-seconds
> long and than insert at the correct position the sound signal?
>
> Thank you,
> Philipp
>
> _______________________________________________
> users mailing listusers at lists.scilab.orghttp://lists.scilab.org/mailman/listinfo/users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20191222/b1fb0143/attachment.htm>


More information about the users mailing list