[Csnd] Random non-repetitive numbers
Date | 2019-06-11 17:12 |
From | Marcelo Carneiro de Lima |
Subject | [Csnd] Random non-repetitive numbers |
Hi. I’ve been trying to generate random non-repetitive numbers during p3 time, but failing to keep generating them during time: they just make 2 passes (generate 2 numbers) no matter how much time p3 has. Any tips? Thank you. -- Marcelo Carneiro (21) 9382-3621 (21) 3497-0193 |
Date | 2019-06-11 19:34 |
From | Rory Walsh |
Subject | Re: [Csnd] Random non-repetitive numbers |
Can you post your code? Are you seeding the random generators? On Tue 11 Jun 2019, 17:12 Marcelo Carneiro de Lima, <marcelo.arcos2@gmail.com> wrote:
|
Date | 2019-06-11 20:00 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Random non-repetitive numbers |
instr 1
k1 = rnd()
printk2 k1
endin
should do the job
Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2019-06-13 10:33 |
From | Sigurd Saue |
Subject | [Csnd] rtevent output |
Hi,
I'm trying to debug an installation with an OSC-controlled csound orchestra. The received OSC messages trigger other instruments using either scoreline or event, depending on the instrument.
What puzzles me is the output from Csound, and in particular the lines with "rtevent". Could someone explain to me exactly what triggers "rtevent" output? Is it likely that some "rtevent" output to console get lost? I struggle with finding the correspondence
between the number of "rtevent" statements and the events I assume they represent.
Cheers, Sigurd |
Date | 2019-06-13 10:34 |
From | Sigurd Saue |
Subject | [Csnd] rtevent output |
Hi,
I'm trying to debug an installation with an OSC-controlled csound orchestra. The received OSC messages trigger other instruments using either scoreline or event, depending on the instrument.
What puzzles me is the output from Csound, and in particular the lines with "rtevent". Could someone explain to me exactly what triggers "rtevent" output? Is it likely that some "rtevent" output to console get lost? I struggle with finding the correspondence
between the number of "rtevent" statements and the events I assume they represent.
Cheers, Sigurd |
Date | 2019-06-13 11:19 |
From | Victor Lazzarini |
Subject | Re: [Csnd] rtevent output |
rtevent: gets printed when an event is requested at perf-time (e.g. event, schedkwhen, scorevent) or from outside Csound. It doesn’t get printed if it comes from the score, or from i-time scheduling (schedule, scoreline_i, event_i). I know, it’s confusing. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 13 Jun 2019, at 10:34, Sigurd Saue |
Date | 2019-06-13 12:03 |
From | Sigurd Saue |
Subject | [Csnd] SV: [Csnd] rtevent output |
Thanks, Victor. I'm still a little bit confused: If it gets printed when the event is requested, how can it output average amplitude as art of the output string? In my case I regularly trigger a file reading instrument with scoreline and a ramp instrument (no sound) with event. I would have expected two rtevents for this, but most of the time there is only one. Just a few times there are two. Sigurd ________________________________________ Fra: A discussion list for users of Csound |
Date | 2019-06-13 13:08 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [Csnd] rtevent output |
It is not the average amplitude, it’s the current max amp. The code is this if (score_evt > 0) p->Message(p, "B%7.3f ..%7.3f T%7.3f TT%7.3f M:", p->prvbt - p->beatOffs, p->curbt - p->beatOffs, p->curp2 - p->timeOffs, p->curp2); else p->Message(p, " rtevent:\t T%7.3f TT%7.3f M:", p->curp2 - p->timeOffs, p->curp2); for (n = p->nchnls, maxp = p->maxamp; n--; ) print_maxamp(p, *maxp++); /* IV - Jul 9 2002 */ The values in p->maxamp are the current maximum amplitudes in Csound (and updated each output ksmps block). ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 13 Jun 2019, at 12:03, Sigurd Saue |
Date | 2019-06-13 15:02 |
From | Sigurd Saue |
Subject | [Csnd] SV: [Csnd] [Csnd] rtevent output |
Thanks again. That clarifies a bit. I have a very irritating problem that appears somewhere around 1-2 hours of running. Suddenly there is a brief snapping sound and then it is all silent. From then on rtevent return zero amplitude. There are no error messages and the orchestra is still running. OSC communication and console output indicate no problem (except the amplitude). If anyone recognizes the symptom I would appreciate any suggestions on where to look for problems. Sigurd ________________________________________ Fra: A discussion list for users of Csound |
Date | 2019-06-13 15:08 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [Csnd] [Csnd] rtevent output |
After the snapping sound does Csound continue to work as before or do you need to restart? The reported amplitudes are the latest maximum in the current ksmps block. So if there is nothing playing, they will be 0. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 13 Jun 2019, at 15:02, Sigurd Saue |
Date | 2019-06-13 15:13 |
From | Sigurd Saue |
Subject | [Csnd] SV: [Csnd] [Csnd] [Csnd] rtevent output |
Csound continues to work as expected: It receives OSC-messages and sends OSC-messages from within various instruments. The only indicator of a problem is the lack of sound (as indicated by rtevent as well). Sigurd ________________________________________ Fra: A discussion list for users of Csound |
Date | 2019-06-13 15:22 |
From | Victor Lazzarini |
Subject | Re: [Csnd] SV: [Csnd] [Csnd] [Csnd] rtevent output |
It could be that something is going wrong with the output module and it can’t send audio out. What’s the OS / audio backend? That’s the most likely place where it’s gone wrong. Csound continues to compute, but the audio does not go out. Since the updating of the max amplitude happens at that stage, it would explain why 0s. You could print the RMS of an instrument that is supposed to be playing them to confirm audio computing is going on without problems. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 13 Jun 2019, at 15:13, Sigurd Saue |
Date | 2019-06-13 22:11 |
From | Sigurd Saue |
Subject | [Csnd] SV: [Csnd] SV: [Csnd] [Csnd] [Csnd] rtevent output |
Oh well. I think I got it. The rms on the output gave the necessary hint. I actually turns out to be a stupid line opcode error. I had the line segment running for a duration of p3, but forgot that I had used xtratim to extend the instrument duration. As a consequence my panning ended up with sqrt of a negative number and NaN as instrument output. Strange that it never triggered any runtime error messages though. Thanks for your assistance, Victor! Sigurd ________________________________________ Fra: A discussion list for users of Csound |
Date | 2019-06-13 22:17 |
From | Victor Lazzarini |
Subject | Re: [Csnd] SV: [Csnd] SV: [Csnd] [Csnd] [Csnd] rtevent output |
This might be (as I found out this week) the result of some optimisation flags we use, the --ffast-math. It assumes NaNs and Infs won't appear and the code does not handle them properly. So when they arise, execution may break, and possibly that's why when filters etc go wrong, Csound continues to run but stops producing sound. I was wondering whether it's safe to have these. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 13 Jun 2019, at 22:12, Sigurd Saue |
Date | 2019-06-13 22:25 |
From | Sigurd Saue |
Subject | [Csnd] SV: [Csnd] SV: [Csnd] SV: [Csnd] [Csnd] [Csnd] rtevent output |
It would certainly have made my debugging much faster, but if it is a substantial speed saver to use that option then it might not be worth it. Testing with rms did the trick for me anyway. And a classic Csound lesson is learnt. Sigurd ________________________________________ Fra: A discussion list for users of Csound |