# Automatic recordings

**URL:** <https://in-thread.sonic-pi.net/t/automatic-recordings/5521>\
**Category:** Support, Help & Resources\
**Created:** [May 13, 2021, 12:34pm UTC](https://in-thread.sonic-pi.net/t/automatic-recordings/5521 "2021-05-13T12:34:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![victorleao](https://avatars.discourse-cdn.com/v4/letter/v/cdc98d/32.png) [@victorleao](https://in-thread.sonic-pi.net/u/victorleao)\
**Post date:** [May 13, 2021, 12:34pm UTC](https://in-thread.sonic-pi.net/t/automatic-recordings/5521/1 "2021-05-13T12:34:57Z")

</div>

Is there a way to start and stop a recording automatically (using a code/function) and saving to a predetermined file?

---

<div class="post-metadata">

**Author:** ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)\
**Post date:** [May 13, 2021, 12:46pm UTC](https://in-thread.sonic-pi.net/t/automatic-recordings/5521/2 "2021-05-13T12:46:55Z")

</div>

See:

> [@Recording is not happening with osc commands](https://in-thread.sonic-pi.net/t/recording-is-not-happening-with-osc-commands/4710):
>
> The recording is not writing into the ‘test.wav’ file: osc\_send "localhost",4557, "/start-recording","myGUID" use\_bpm 120 use\_synth :saw play :c4 sleep 1 play :c4 sleep 1 play :g4 sleep 1 play :g4 sleep 1 play :a4 sleep 1 play :a4 sleep 1 play :g4 sleep 2 play :f4 sleep 1 play :f4 sleep 1 play :e4 sleep 1 play :e4 sleep 1 play :d4 sleep 1 play :d4 sleep 1 play :c4 sleep 2 play :g4 sleep 1 play :g4 sleep 1 play :f4 sleep 1 play :f4 sleep 1 play :e4 sleep 1 …

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [May 13, 2021, 3:54pm UTC](https://in-thread.sonic-pi.net/t/automatic-recordings/5521/3 "2021-05-13T15:54:26Z")

</div>

as Ethan says this worked for me. Note that port 4557 is not correct for the latestr system. Use the code here.

> [@Recording is not happening with osc commands](https://in-thread.sonic-pi.net/t/recording-is-not-happening-with-osc-commands/4710/6):
>
> Here are some bits I wrote to enable recording from software OSC commands in Sonic Pi. I wpould reiterate Ethan’s comments that they use undocumented parts of Sonic Pi and are not guaranteed to work in future versions. Rely n them at your own risk. Note the string “guid-rbn” can be any value you like, as long as you use the same value in all your OSC messages. Once you know the current value of the port, you can use this manually for OSC calls from external devices or from a python script for…
