This is a treat Alexei, many thanks! (and yes, the calculation has an iterator in it) Francisco
From: Alexei Boulbitch <Alexei.Boulbitch@iee.lu> Sent: Monday, September 16, 2013 4:27 AM Subject: Re: producing a noise
Dear Group: Suppose I am running a simulation, and go on to work on another issue. I would like Mathematica to produce a sound as soon as it ends (but not always, only when told so). I imagine this is quite easy, but don't know how. Any ideas? Thanks Francisco
Below I am sending you one program that has a comparable functionality. This is a toy to teach a school pupil of the first classes to count. As the outcome they receive a sound signal, the one in the case of a correct answer different from that in the case of the incorrect one. In addition two short cartoons are played after a correct and an incorrect answers correspondingly. I am afraid that to view the program you will need to save the notebook with this code into some folder, and place two gif images or gif movies with the names (1) cataround.gif and (2) argue01.gif into this same folder.
Now to the point: the two sounds used in the program are kept in the form of the two functions g1[ ] and g2[ ]. It is done in the beginning of the program. You then apply the functions where you need. This may include the place where your calculation is finished. In my case they have been applied in the very end depending upon the correctness of the answer given. The functions g1 and g2 are stand alone ones. You may play them just by evaluation.
You did not write, what type of calculation do you do there. I can imagine that if your procedure has an iterator in it, (like, say, a Table or a loop) the sound may play as soon as the iterator achieves a certain value.