03 March 2007

simulink and some reading


I worked in simulink and things I encountered to remember are:
  • delay blocks are calculated this way:
    I put the delay in frames. 1 frame has a default value of 256 samples. Because the sampling period (Ts = 1/Fs) equals 2,27E-5, one frame takes 5,8 milliseconds to end. So if the delay value is 10 frames, we have a delay time of 58 msec.
  • so the general formula could be stated as: delay time = Nsamples * Nframes / Fs with Nsamples the number of samples per frame and Nframes the number of frames.
    Normal delay times are:
    • ROLAND SH32
      • stereo delay: 0-500 ms
      • long delay: 0-1000 ms
      • stereo and long delay sync type: (Thirty-second note), (Sixteenth-note triplet), (Dotted thirty-second note), (Sixty-fourth-note triplet), (Sixty-fourth note), (Thirty-second-note triplet), (Eighth note), (Quarter-note triplet), (Dotted eighth note), (Quarter note), (Sixteenth note), (Eighth-note triplet), (Dotted sixteenth note)
        13 possibilities!
      • feedback : -98% - +98% (no mapping given)
    • YAMAHA MO8
      • 0.1 - 1638.3 (with value range: 1-16383)
      • feedback level: -63 - +63 (0-127)
        they also use a feedback time, which could mean
          • they use delay time parameter for the first delay and the feedback time for a new delay in the feedback loop, so for the rest of the delays. If so then it's better to rename the delay time parameter to initial delay time.
          • Another possibility is that it is used to specify a kind of gate time, like the number of copies you allow.
    • T.C.ELECTRONIC D2
      • feedback time in stereo mode is maximally 5 sec.
    • KORG MICROKORG
      • Here they don't really give a time but the values: 0-127
      • For the syncing they give as parameters: 1.32 - 1.1 (see the diagram) 15 possibilities!
      • feedback (delay depth): 0-127
  • So it seems that for our purpose, our delay must have a range which is the same as the range our bpm algorithm will work with. And there might have to be an ability to choose the sync type too, with a knob or something (=gesture control)
  • I designed two delay implementations in simulink. The only one I'm going to speak of is the one with the feedback line. The other one has a more flexibel, but too complex way of assigning each delay or feedback level a gain value.
    For the feedback looped delay, I have set a feedback level of 50%. It thus has identically the same effect as the other implementation.

    To see what a negative percentage for the feedback level could mean, I tried one out and also calculated the gain after every round through the loop: it gives the same values as for the positive counterpart, but alternating negative/positive. Is it true that this is just a phase reverse after every loop? And is that the reason why I don't hear a difference at first sight? And why do professional keyboards give this choice than? Or is there another meaning connected to this negative percentage? I just tried adding two delays: one with a positive feedback level of .5 or 50% and one with a negative one of -.5 or -50%. This gives a more beautiful sound, and on the image you can see that some delaypeaks filter each other out due to a the sum of opposite magnitudes. (in my thesis folder on ESAT, you can find an image an the model too). This is an image where the original signal is not shown!
  • Now I am trying to include a HF damp filter in the loop (because it reappears in many synths). For info on filters for audio applications, this website seems interesting: http://ccrma.stanford.edu/~jos/filters/.
    The ranges are:
      • YAMAHA MO8: 0.1 - 1.0 kHz (1-10)
      • ROLAND SH32: 200Hz - 8kHz or bypass
    I read that this HF DAMP function tries to simulate analog delays. Because trying to simulate other effects will focus too much on effect design, and it's something extra that can be added later, I stop implementing it any further than this. So I'll use a lowpass filter modeled with a chebyshev II filter for which Fstop can be controlled with gestures (like a knob or slider). The A-stop could also be controlled, and many other things typical to a filter can be, but no effect device that I know of provides more control than the Fstop.
  • Oh yes, sometimes you can choose how many times a sound is repeated, this is possible with a multitap delay. eg the T.C.ELECTRONIC D2 has a max delay time of 5000msec stereo or a total of 10000msec mono. When you want 5 taps you have a max delay of 2000msec on every tap, when you want 10 taps, you still have 1000msec available. I don't know if the implementation differs rather than the parameter calculation. Therefore I'll just remember the possibility but I won't implement it now.
-6/3/2007-
  • Another thing with simulink: a single line represents a scalar value per iteration. A double line represents a vector. In this case there are double lines because of the fact that the audio input is given in frames. There is a way to see how the signals look on every line: Format -> Port/Signal Displays -> Signal Dimensions
  • The simplest way to use and process a stereo signal is to split the two channels in two mono channels right after the input block and to merge them again right before you enter the output block. This is done with the following commands:
      • select columns (stereo > mono)
        Simulink -> Signal Routing -> Selector
      • merge columns (mono > stereo)
        Simulink -> Math Operations -> Matrix Concatenation

1 comment:

ronny said...

In the meanwhile I have drawn all the possible fractions of a measure of four beats on a paper, so that I could visually understand the sync type used by many synths to sync the delay time with the given tempo. I might put them on the web, but I just don't have a scanner...