<div dir="ltr"><div><div><div><div>...ticket is solved.<br></div>Thank you Jan + Federico.<br><br></div>Creating a zero-vector of just the right length and inserting the sound at the correct position just does it.<br></div><br>BR<br></div>Philipp<br><div><div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am So., 22. Dez. 2019 um 00:23 Uhr schrieb Federico Miyara <<a href="mailto:fmiyara@fceia.unr.edu.ar">fmiyara@fceia.unr.edu.ar</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <br>
    <font face="Courier New">Philipp,<br>
      <br>
      You can certainly use the strategy you propose. This should work:<br>
      <br>
      tick = wavread("path/tick.wav");<br>
      tock = </font><font face="Courier New"><font face="Courier New">wavread("path/tock.wav");<br>
        ntick =  </font></font><font face="Courier New"><font face="Courier New">length(tick);<br>
      </font></font><font face="Courier New"><font face="Courier New"><font face="Courier New"><font face="Courier New">ntock =  </font></font><font face="Courier New"><font face="Courier New">length(tock);<br>
          </font></font></font></font><font face="Courier New"><font face="Courier New">m = max(ntick, ntock;                  //
        Just in case both lengths differ<br>
      </font>Fs = 44100;<br>
      x = zeros(1, n*Fs + m);                // Allocate space allowing
      room for the last sound<br>
    </font>for k = 0:n<br>
       if floor(k/2)== k/2                 // tick if k is even, tock if
    odd<br>
           x(k*Fs + 1:k*Fs + ntick) = tick;<br>
       else<br>
           x(k*Fs + 1:k*Fs + ntock) = tock;<br>
       end<br>
    end<br>
    <br>
    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. <br>
    <br>
    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. <br>
    <br>
    Redards,<br>
    <br>
    Federico Miyara<br>
    <br>
    <br>
    <div>On 21/12/2019 17:16, P M wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>
                            <div>Dear experts,<br>
                              <br>
                            </div>
                            I try to compose (design) a small sound
                            file, made of several wav-files.<br>
                            <br>
                          </div>
                          My question:       How to approach this task
                          in the best way?<br>
                        </div>
                        <br>
                        <br>
                      </div>
                      Here some input:<br>
                      <br>
                    </div>
                    - sound 1: Tick-sound of a clock<br>
                  </div>
                  - sound 2: Tock-sound of a clock<br>
                  <br>
                </div>
                each wav-file has these properties:<br>
              </div>
              - length: 0.1 sec<br>
            </div>
            - bits: 32<br>
          </div>
          - sample rate: 44100 Hz<br>
        </div>
        - mono<br>
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div><br>
                      <div>
                        <div>
                          <div>
                            <div>Now:<br>
                            </div>
                            <div>I want to create a tick-tock sound of
                              length  n-seconds  .. where I can choice
                              the length of n<br>
                            </div>
                            <div>Each Tick-Tock-sound must be exactly
                              1-second apart from each other.<br>
                            </div>
                            <div><br>
                            </div>
                            <div>I load the sounds with: loadwave<br>
                              <br>
                            </div>
                            <div>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?<br>
                              <br>
                            </div>
                            <div>Thank you,<br>
                            </div>
                            <div>Philipp<br>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
users mailing list
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div>