< Back to IRCAM Forum

Synthesizing 1TRC sdif with nonsynchronous sine sweeps

Hi all,
I would like to know if there’s a workaround (preferably with the SDIF writing tools provided by OpenMusic) to synthesize a 1TRC sdif with nonsynchronous sine sweeps – in order to obtain a sound where multiple glissandos start at different times.
Here’s an example where there are two sine sweeps that start at the same time:

Exemple - tierces - 2 canaux

SDIF

1NVT
{
Date 2013/08/05 17:07:28;
TableName FileInfo;
Author OM 6.6;
}

SDFC

1TRC 1 0 0
1TRC 0x0004 0 4

1TRC 1 1 0
1TRC 0x0004 0 4

1TRC 1 0 0.05
1TRC 0x0004 1 4
0 329.628 0.5 0

1TRC 1 1 0.05
1TRC 0x0004 1 4
0 391.995 0.6 0

1TRC 1 0 3
1TRC 0x0004 1 4
0 329.628 0.5 0

1TRC 1 1 3
1TRC 0x0004 1 4
0 466.164 0.6 0

1TRC 1 0 10
1TRC 0x0004 1 4
0 329.628 0 0

1TRC 1 1 10
1TRC 0x0004 1 4
0 466.164 0 0

ENDC
ENDF

========================================================
It seems that PM2 does not support non synchronous frames, so, even if I assign different begin and end values to each stream, the synthesis engine will render them making the glissandos start all at the same time. Thus, is there a way to overcome this limitation and synthesize the sound in the desired way?
Best regards,
Francesco Vitale

Hi Francesco,

You can activate the the different chirps (by means of setting the amplitude != 0) in different frames and so you get non synchronous chirps without a problem. What PM does not support are different frame times in different streams. But this is not needed to create non synchronous chirps.

I see from your example that you write only the start and end positions of the partials. This is not possible because it leads to non synchronous time positions. Whenever you want to make a change in one stream you have to write the corresponding entries in the other streams providing the values for amplitude frequency and phase that are desired at that particular moment for that frame. Normally, sdif files are generated with a fixed time grid for all streams and then the partial parameters are rendered with a rather dense grid. This case is required for any precise analysis of natural sounds and therefore
this is the way things are handled in SDIF and PM2.

Best
Axel

Hi again,

if you don’t understand what I mean, please simply generate yourself a stereo sound file with two non synchronous chirps in the two channels and make an analysis in AudioSculpt (or OM) and see how the resulting sdif file looks like.

Best
Axel

Dear Axel,
thanks for your replies. I’ll reformulate my question – hopefully making it clearer. I need to create a SDIF (to be synthesized with PM2) with multiple partials, where each partial begins with the frequency and amplitude values x0 and y0 and then ends with the frequency and amplitude values x1 and y1. Moreover, each partial should have a different onset (the partial #1 begins at t1, while the partial #2 begins at t2, and so on… for each t value). Thus, the only difference between this and the 1MRK/1TRC file (the “chord sequence SDIF”) would be that in 1MRK/1TRC the frequency and amplitude values are steady, and then each partial begins and ends with x0 and y0, while my aim would be to make each partial start with the values x0 and y0 and end with x1 and y1. As pointed out by Jean Bresson (in http://listes.ircam.fr/sympa/arc/openmusic/2013-08/msg00008.html) the only known way to encode glissandos in a partial SDIF is to use two 1TRC frames, where the first frame has the frequency and amplitude values x0 and y0 and the second frame has the frequency and amplitude values x1 and y1. This is why, as you said, I’ve written “only the start and end positions of the partials”.
So, what I intended asking about non synchronous sines was simply: how to write glissando sines with different onsets? And since (as far as I know) you can encode glissandos only by using two 1TRC frames, to obtain multiple glissandos you have to encode the glissandos in different streams. Consequently, you get something you can’t synthesize in PM2: different frame times in different streams. Hence my question: is there a workaround to overcome such a limitation?
Best,
Francesco

Dear Francesco,

what Jean Bresson said was simply wrong. The SDIF format is capable of coding any!! really any real world sound that is generate by means of superposing sinusoids. YOur problem comes from the fact that you use an minimalistic approach to writing an sdif file.
In fact the way Jean Bresson explained is not the only one, it is only the most simple one.

The most flexible way to write partials in sdif is to write a frame in fixed grid (e.g. every 10ms). You have to write these in all streams.
If you dont have any partials in a stream at a given time the matrix is empty. Otherwise you have to write the frequency, amplitude and phase
for each partial that is active in a given stream at a given moment. If you want to encode a chirp like this you write a constant amplitude every 10ms after the chirps start and until the chirps end, the frequency to write is the frequency of the chirp at the moment of the frame time.

Now if you feel this is a bit inefficient, then you are correct. But first, PM2 is not made for writing chirps efficiently, it is made to write sinusoidal models for arbitrary sound files and in nearly all cases besides chirps or constant sinusoids you have to write frequency rather often to follow the time varying frequency. And second, if you take into account that PM2 will linearly interpolate frequency and amplitude of all active sinusoids between frames, then you can see that finally you will need only 2K frames for K non synchronous chirps in 1 or K channels. Which is not so bad.

Best
Axel

Dear Axel,
thanks for you patience. In order to understand fully what you said, I’ll bring some practical examples, and, for the same reason, I’ll keep them very simple. (After all, the “minimalistic” approach you mentioned comes from the necessity to investigate the problem in a simplified and clear way, before dealing with more complex variants of the same problem).
Here’s a SDIF with three streams, where all the three chirps start at t= 0.0 and end at t=10.0.

SDFC

1TRC 1 0 0
1TRC 0x0004 1 4
0 0 0.05 0

1TRC 1 1 0
1TRC 0x0004 1 4
0 1400 0.05 0

1TRC 1 2 0
1TRC 0x0004 1 4
0 5400 0 0

1TRC 1 0 10
1TRC 0x0004 1 4
0 2000 0 0

1TRC 1 1 10
1TRC 0x0004 1 4
0 540 0.05 0

1TRC 1 2 10
1TRC 0x0004 1 4
0 100 0.05 0

ENDC
ENDF

Since the streams start and end all at the same time, PM2 has no problem in synthesizing the file. (As you can see, in the 1st and in the 3rd chirp we have not only a frequency variation between the begin and the end value, but also an amplitude variation. Now, you’ve warned me that the amplitude must be kept steady, but I ask you: why? What if I want to get, for example, a fade-in effect – as in the 3rd chirp – or a fade-out – as in the 1st chirp –, or in general a variation in the amplitude?)
The issues emerge, as I said, when I assign different start and end times to each of the chirps, so a SDIF like the following (where chirp #1 starts at 0.0 and ends at 10.0; chirp #2 starts at 3.0 and ends at 8.0 and chirp #3 starts at 4.0 and ends at 11.0) cannot be synthesized in PM2:
SDFC

1TRC 1 0 0
1TRC 0x0004 1 4
0 0 0.05 0

1TRC 1 1 3
1TRC 0x0004 1 4
0 1400 0.05 0

1TRC 1 2 4
1TRC 0x0004 1 4
0 5400 0 0

1TRC 1 1 8
1TRC 0x0004 1 4
0 540 0.05 0

1TRC 1 0 10
1TRC 0x0004 1 4
0 2000 0 0

1TRC 1 2 11
1TRC 0x0004 1 4
0 100 0.05 0

ENDC
ENDF.
So, how would you “translate” the content of this file, unreadable for PM2, into something that can PM2 can synthesize correctly – according to the instructions that you kindly gave me in your previous post?
Thanks again for your attention,
Francesco

Hi Francesco,

Now, you’ve warned me that the amplitude must be kept steady, but I ask you: why? What if I want to get, for example, a fade-in effect – as in the 3rd chirp
– or a fade-out – as in the 1st chirp –, or in general a variation in the amplitude?)

No I did not warn you. I just described how to write a chirp, a chirp is a constant amplitude sinusoids with linear frequency evolution. I also said, that you can encode every sinusoid that you can find in a real world sound. From that it is pretty simple to conclude that non constant amplitudes are no problem.

I think I explained this pretty extensively now. Anyway here your example. I removed the third chirp, because it does not add information. I also did not calculate the intermediate chirp parameters and kept the formula that would be used to calculate the entries instead.
Like this you have a template you can use to adapt to all your cases. Here I don’t use a fixed grid but the minimal number of frames required
to encode K=2 chirps which is 2*K = frames per stream

1TRC 1 0 0
1TRC 0×0004 1 4
0 0 0.05 0

1TRC 1 0 0
1TRC 0×0004 1 4

1TRC 1 0 3
1TRC 0×0004 1 4
0 2000/103 0.05-0.053/10 0

1TRC 1 1 3
1TRC 0×0004 1 4
0 1400 0.05 0

1TRC 1 0 8
1TRC 0×0004 1 4
0 2000/108 0.05-0.058/10 0

1TRC 1 1 8
1TRC 0×0004 1 4
0 540 0.05 0

1TRC 1 0 10
1TRC 0×0004 1 4
0 2000 0 0

1TRC 1 0 10
1TRC 0×0004 1 4

ENDC
ENDF

Best
Axel

Sorry, there were 2 wrong stream ids du to copy pasting
Here the correct transcription:

1TRC 1 0 0
1TRC 0×0004 1 4
0 0 0.05 0

1TRC 1 1 0
1TRC 0×0004 1 4

1TRC 1 0 3
1TRC 0×0004 1 4
0 2000/103 0.05-0.053/10 0

1TRC 1 1 3
1TRC 0×0004 1 4
0 1400 0.05 0

1TRC 1 0 8
1TRC 0×0004 1 4
0 2000/108 0.05-0.058/10 0

1TRC 1 1 8
1TRC 0×0004 1 4
0 540 0.05 0

1TRC 1 0 10
1TRC 0×0004 1 4
0 2000 0 0

1TRC 1 1 10
1TRC 0×0004 1 4

ENDC
ENDF

Thanks Axel! Sometimes concrete examples are more eloquent than anything else.
Best,
Francesco