<p>Trish's version is good but wait for bed temperature being at 30 °C (<code>M190 R30</code>) before setting the temperature to 0 °C (<code>M140 S0</code>)</p>
<p>So this is my version:</p>
<pre><code>G91 ;relative positioning
G1 E-1 F300  ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more
G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
G1 Y150 F5000 ;move completed part out
M84 ;steppers off
G90 ;absolute positioning
M190 R30 ;waits until cooling to 30 °C
M300 S300 P1000 ;beep
M300 S300 P1000 ;beep
M300 S300 P1000 ;beep
M300 S300 P1000 ;beep
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off 
</code></pre>

CC BY-SA 4.0
2019-10-04T13:54:08.113Z
S perimeter is "this or more" - 60 is more than 30, so triggers S.
Trish
CC BY-SA 4.0
2019-10-04T14:34:00.527Z
ups yeah my bad..I was talking about the M190 R30 gcode but - hey - you used the "R" right so my fault..I'm gonna edit my answer
jakjakjakjakjak
CC BY-SA 4.0
2019-10-05T15:23:09.360Z
Yur order of commands in the revamped... You do realize that you set the bed off (M140 S0) and then demand the printer to target 30°C after that and not turn off the bed again?
Trish
CC BY-SA 4.0
2019-10-04T13:52:15.610Z
2022-02-21T11:50:55.367Z
2022-02-21T11:50:55.367Z
jakjakjakjakjak
<p>Let's put the parts one by one:</p>

<ul>
<li>Wait for bed temperature being at 30 °C: <code>M190 R30</code></li>
<li>Play Bleep for 1/5th of a second: <code>M300 S440 P200</code></li>
<li>Wait for 1/5th of a second: <code>G4 P200</code></li>
</ul>

<p>That gives:</p>

<pre><code>M190 R30
M140 S0
M300 S440 P200
G4 P200
M300 S440 P200
G4 P200
M300 S440 P200
G4 P200
M300 S440 P200
G4 P200
</code></pre>

<p>Just for 0scar:</p>

<pre><code>M300 S1396.91 P400 ;f7
G4 P400
M300 S1661.22 P600 ;as7
M300 S1396.91 P400 ;f7
M300 S1396.91 P200 ;f7
M300 S1864.66 P400 ;b7
M300 S1244.51 P400 ;es7
M300 S1396.91 P400 ;f7
G4 P400
M300 S2093.00 P400 ;c8
M300 S1396.91 P400 ;f7
M300 S1396.91 P200 ;f7
M300 S2217.46 P400 ;des8
M300 S2093.00 P400 ;c8
M300 S1661.22 P400 ;as7
M300 S1396.91 P400 ;f7
M300 S2093.00 P400 ;c8
M300 S2793.83 P400 ;f8
M300 S1244.51 P400 ;es7
M300 S1244.51 P200 ;es7
M300 S1046.50 P400 ;c7
M300 S1567.98 P400 ;g7
M300 S1396.91 P1600 ;f7
</code></pre>

CC BY-SA 4.0
2019-09-23T04:53:37.560Z
Cool, I'll implement it as soon as you post how to play [this](https://www.youtube.com/watch?v=Qx2gvHjNhQ0)! ;)
0scar
CC BY-SA 4.0
2020-01-13T21:37:38.237Z
@0scar There you go. Beverly Hills cop.
Trish
CC BY-SA 4.0
2020-01-13T22:01:49.347Z
Lol! I will give it a try!
0scar
CC BY-SA 4.0
2024-04-21T18:38:09.477Z
For the printers with [non-blocking beeping](https://marlinfw.org/docs/gcode/M300.html), the pause duration must be longer than the tone duration, e.g. `M300 S440 P200` and `G4 P400` (note the pause is twice as long as the tone duration, so it covers the tone itself, and a silent pause). This is, for example, true for the Creality Ender 3 V3 SE which I tested.
v_2e
CC BY-SA 4.0
2024-04-21T19:17:28.800Z
@v_2e good point - the tone lengths here are for old style 1.0.x!
Trish
CC BY-SA 4.0
2019-09-21T08:30:34.837Z
2020-01-13T23:09:06.693Z
2020-01-13T23:09:06.693Z
Trish
<p>Often, the pre-generated G-code is enough for start and end. However, sometimes we want to have something different. In this case: how to generate an audible alert of something like 4 bleeps at the end of the print, after putting the printer into the end position and when the bed has reached a "safe" 30 °C?</p>

<ultimaker-cura><g-code>
Writing G-code: Audible Alert at end of print
Trish
# Writing G-code: Audible Alert at end of print

(Asked by: username_0 on 2019-09-21)

Often, the pre-generated G-code is enough for start and end. However, sometimes we want to have something different. In this case: how to generate an audible alert of something like 4 bleeps at the end of the print, after putting the printer into the end position and when the bed has reached a "safe" 30 °C?

**Tags:** ultimaker-cura, g-code


---

## 2 answers

### Answer by username_0 on 2019-09-21. Score: 10 | Accepted answer

Let's put the parts one by one:

* Wait for bed temperature being at 30 °C: `M190 R30`
* Play Bleep for 1/5th of a second: `M300 S440 P200`
* Wait for 1/5th of a second: `G4 P200`

That gives:

```
M190 R30
M140 S0
M300 S440 P200
G4 P200
M300 S440 P200
G4 P200
M300 S440 P200
G4 P200
M300 S440 P200
G4 P200

```

Just for username_2:

```
M300 S1396.91 P400 ;f7
G4 P400
M300 S1661.22 P600 ;as7
M300 S1396.91 P400 ;f7
M300 S1396.91 P200 ;f7
M300 S1864.66 P400 ;b7
M300 S1244.51 P400 ;es7
M300 S1396.91 P400 ;f7
G4 P400
M300 S2093.00 P400 ;c8
M300 S1396.91 P400 ;f7
M300 S1396.91 P200 ;f7
M300 S2217.46 P400 ;des8
M300 S2093.00 P400 ;c8
M300 S1661.22 P400 ;as7
M300 S1396.91 P400 ;f7
M300 S2093.00 P400 ;c8
M300 S2793.83 P400 ;f8
M300 S1244.51 P400 ;es7
M300 S1244.51 P200 ;es7
M300 S1046.50 P400 ;c7
M300 S1567.98 P400 ;g7
M300 S1396.91 P1600 ;f7

```

> **Comments:**
> **username_2**: Cool, I'll implement it as soon as you post how to play [this](https://www.youtube.com/watch?v=Qx2gvHjNhQ0)! ;)  
> **username_0**: @username_2 There you go. Beverly Hills cop.  
> **username_2**: Lol! I will give it a try!  
> **username_3**: For the printers with [non-blocking beeping](https://marlinfw.org/docs/gcode/M300.html), the pause duration must be longer than the tone duration, e.g. `M300 S440 P200` and `G4 P400` (note the pause is twice as long as the tone duration, so it covers the tone itself, and a silent pause). This is, for example, true for the Creality Ender 3 V3 SE which I tested.  
> **username_0**: @username_3 good point - the tone lengths here are for old style 1.0.x!  

---

### Answer by username_1 on 2019-10-04. Score: 1

username_0's version is good but wait for bed temperature being at 30 °C (`M190 R30`) before setting the temperature to 0 °C (`M140 S0`)

So this is my version:

```
G91 ;relative positioning
G1 E-1 F300  ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more
G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
G1 Y150 F5000 ;move completed part out
M84 ;steppers off
G90 ;absolute positioning
M190 R30 ;waits until cooling to 30 °C
M300 S300 P1000 ;beep
M300 S300 P1000 ;beep
M300 S300 P1000 ;beep
M300 S300 P1000 ;beep
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off 

```

> **Comments:**
> **username_0**: S perimeter is "this or more" - 60 is more than 30, so triggers S.  
> **username_1**: ups yeah my bad..I was talking about the M190 R30 gcode but - hey - you used the "R" right so my fault..I'm gonna edit my answer  
> **username_0**: Yur order of commands in the revamped... You do realize that you set the bed off (M140 S0) and then demand the printer to target 30°C after that and not turn off the bed again?  

---

