I would like to experiment with sonic pi for “live looping” (the other kind of live loop), that is recording audio input into samples and playing them back.
I believe the live looping tools are usually pretty fancy in allowing some sequencing (and effects of course) on recorded clips and it’s a pretty cool way of starting making fun sounds without requiring a lot of resources.
WDYT?
A couple examples worth looking at:
ReadMe.md
Sonic Pi Record / Player version 1.2
The two other files enable a TouchOSC interface to be used with Sonic Pi 3 and above to allow notes to be played on Sonic Pi, and also recorded in real time for subsequent replay. Recordings can also be stored in files on your computer.
The Sonic Pi program is too long to run in a buffer, and should be run using the run_file command
eg
```
run_file "/path/to/file/recordplayercombined-RF.rb"
```
(The RF in the name reminds you to do this)
This file has been truncated. show original
index.xml
<?xml version="1.0" encoding="UTF-8"?><layout version="16" mode="1" orientation="horizontal"><tabpage name="cnA=" scalef="0.0" scalet="1.0" li_t="" li_c="gray" li_s="14" li_o="false" li_b="false" la_t="" la_c="gray" la_s="14" la_o="false" la_b="false" ><control name="c3ludGg=" x="46" y="902" w="680" h="60" color="green" scalef="0.0" scalet="1.0" type="multitoggle" number_x="10" number_y="1" ex_mode="true" local_off="false" ></control><control name="bGFiZWw1NA==" x="233" y="51" w="167" h="20" color="yellow" type="labelh" text="YnkgUm9iaW4gTmV3bWFu" size="18" background="true" outline="false" ></control><control name="bGFiZWwzMQ==" x="711" y="183" w="25" h="25" color="red" type="labelh" text="TQ==" size="18" background="true" outline="false" ></control><control name="bGFiZWwyNg==" x="711" y="403" w="25" h="25" color="pink" type="labelh" text="Rg==" size="18" background="true" outline="false" ></control><control name="bGFiZWwyNQ==" x="706" y="655" w="35" h="25" color="yellow" type="labelh" text="bWV0" size="18" background="true" outline="false" ></control><control name="bGFiZWwyNA==" x="711" y="577" w="25" h="25" color="pink" type="labelh" text="Uw==" size="18" background="true" outline="false" ></control><control name="bXQz" x="699" y="428" w="50" h="50" color="pink" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="bXQx" x="699" y="601" w="50" h="50" color="pink" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="bGFiZWwzMA==" x="625" y="858" w="66" h="20" color="yellow" type="labelh" text="bGVkcyBvbg==" size="18" background="true" outline="false" ></control><control name="bGFiZWwx" x="233" y="13" w="20" h="25" color="yellow" type="labelh" text="Uw==" size="24" background="true" outline="false" ></control><control name="bXVsdGlwdXNoMQ==" x="86" y="87" w="600" h="600" color="red" scalef="0.0" scalet="1.0" type="multipush" number_x="8" number_y="8" local_off="false" ></control><control name="bGFiZWwy" x="61" y="923" w="44" h="20" color="green" type="labelh" text="cGlhbm8=" size="14" background="true" outline="false" ></control><control name="bGFiZWwz" x="615" y="843" w="80" h="20" color="yellow" type="labelh" text="cGxheWJhY2s=" size="18" background="false" outline="false" ></control><control name="a2V5" x="176" y="828" w="420" h="60" color="purple" scalef="0.0" scalet="1.0" type="multitoggle" number_x="7" number_y="1" ex_mode="true" local_off="false" ></control><control name="bWFqbWlu" x="102" y="828" w="60" h="60" color="purple" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="bWFqbWluTGFiZWw=" x="108" y="849" w="47" h="20" color="yellow" type="labelh" text="bWFqb3I=" size="16" background="true" outline="false" ></control><control name="bGFiZWw1" x="198" y="849" w="20" h="20" color="yellow" type="labelh" text="Qw==" size="16" background="true" outline="false" ></control><control name="bGFiZWw2" x="257" y="849" w="20" h="20" color="yellow" type="labelh" text="RA==" size="16" background="true" outline="false" ></control><control name="bGFiZWw3" x="316" y="849" w="20" h="20" color="yellow" type="labelh" text="RQ==" size="16" background="true" outline="false" ></control><control name="bGFiZWw4" x="375" y="849" w="20" h="20" color="yellow" type="labelh" text="Rg==" size="16" background="true" outline="false" ></control><control name="bGFiZWw5" x="434" y="849" w="20" h="20" color="yellow" type="labelh" text="Rw==" size="16" background="true" outline="false" ></control><control name="bGFiZWwxMA==" x="493" y="849" w="20" h="20" color="yellow" type="labelh" text="QQ==" size="16" background="true" outline="false" ></control><control name="bGFiZWwxMQ==" x="553" y="849" w="20" h="20" color="yellow" type="labelh" text="Qg==" size="16" background="true" outline="false" ></control><control name="bTE=" x="117" y="638" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bTk=" x="114" y="115" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bTg=" x="333" y="188" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bTc=" x="560" y="263" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bTY=" x="259" y="336" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bTU=" x="485" y="412" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bTQ=" x="191" y="491" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bTM=" x="413" y="564" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bTI=" x="636" y="638" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bTEw" x="633" y="115" w="25" h="25" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="bGFiZWwxNQ==" x="248" y="13" w="49" h="25" color="green" type="labelh" text="b25pYw==" size="24" background="true" outline="false" ></control><control name="bGFiZWwxNw==" x="317" y="13" w="20" h="25" color="green" type="labelh" text="aQ==" size="24" background="true" outline="false" ></control><control name="bGFiZWwxNg==" x="303" y="13" w="20" h="25" color="yellow" type="labelh" text="UA==" size="24" background="true" outline="false" ></control><control name="bGFiZWwyMA==" x="359" y="13" w="195" h="25" color="yellow" type="labelh" text="UmVjb3JkIC8gUGxheWVy" size="24" background="true" outline="false" ></control><control name="bGFiZWwyMQ==" x="692" y="681" w="64" h="20" color="pink" type="labelh" text="TWV0IE9u" size="18" background="true" outline="false" ></control><control name="bGFiZWwyMg==" x="129" y="923" w="44" h="20" color="green" type="labelh" text="cGx1Y2s=" size="14" background="true" outline="false" ></control><control name="bGFiZWwyMw==" x="711" y="353" w="25" h="25" color="yellow" type="labelh" text="cGI=" size="18" background="true" outline="false" ></control><control name="bGFiZWwyNw==" x="711" y="270" w="25" h="25" color="red" type="labelh" text="Uw==" size="18" background="true" outline="false" ></control><control name="bGFiZWwyOA==" x="711" y="93" w="25" h="25" color="red" type="labelh" text="Rg==" size="18" background="true" outline="false" ></control><control name="bGVkcGxheWJhY2s=" x="699" y="836" w="50" h="50" color="yellow" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="bWV0cm9ub21l" x="699" y="706" w="50" h="50" color="pink" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="cGIz" x="699" y="120" w="50" h="50" color="red" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="cGIy" x="699" y="208" w="50" h="50" color="red" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="cGIx" x="699" y="297" w="50" h="50" color="red" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="dm9sdW1l" x="23" y="163" w="50" h="221" color="red" scalef="0.0" scalet="1.0" type="faderv" response="absolute" inverted="true" centered="false" ></control><control name="ZHVyYXRpb24=" x="25" y="463" w="50" h="221" color="red" scalef="0.0" scalet="1.0" type="faderv" response="absolute" inverted="true" centered="false" ></control><control name="bW9kaWZpZXI=" x="247" y="724" w="280" h="90" color="red" scalef="0.0" scalet="1.0" type="multipush" number_x="2" number_y="1" local_off="false" ></control><control name="bGFiZWw1NQ==" x="195" y="923" w="44" h="20" color="green" type="labelh" text="dHJp" size="14" background="true" outline="false" ></control><control name="bGFiZWw1Ng==" x="263" y="923" w="44" h="20" color="green" type="labelh" text="dGIzMDM=" size="14" background="true" outline="false" ></control><control name="bGFiZWw1Nw==" x="330" y="923" w="44" h="20" color="green" type="labelh" text="YmxhZGU=" size="14" background="true" outline="false" ></control><control name="bGFiZWw1OA==" x="389" y="923" w="62" h="20" color="green" type="labelh" text="Y2hpcGxlYWQ=" size="14" background="true" outline="false" ></control><control name="bGFiZWw1OQ==" x="670" y="923" w="37" h="20" color="green" type="labelh" text="Zm0=" size="14" background="true" outline="false" ></control><control name="bGFiZWw2MA==" x="599" y="923" w="44" h="20" color="green" type="labelh" text="c2luZQ==" size="14" background="true" outline="false" ></control><control name="bGFiZWw2MQ==" x="516" y="923" w="76" h="20" color="green" type="labelh" text="dGVjaHNhd3M=" size="14" background="true" outline="false" ></control><control name="bGFiZWw2Mg==" x="458" y="923" w="59" h="20" color="green" type="labelh" text="cHJvcGhldA==" size="14" background="true" outline="false" ></control><control name="bGFiZWw2Mw==" x="7" y="129" w="74" h="25" color="red" type="labelh" text="Vm9sdW1l" size="18" background="true" outline="false" ></control><control name="bGFiZWw2NA==" x="20" y="428" w="58" h="25" color="red" type="labelh" text="RGVjYXk=" size="18" background="true" outline="false" ></control><control name="bGFiZWw2NQ==" x="429" y="696" w="58" h="25" color="red" type="labelh" text="U2hhcnA=" size="18" background="true" outline="false" ></control><control name="bGFiZWw2Ng==" x="286" y="697" w="58" h="25" color="red" type="labelh" text="RmxhdA==" size="18" background="true" outline="false" ></control><control name="bGFiZWw2OA==" x="564" y="17" w="69" h="25" color="red" type="labelh" text="RW5hYmxl" size="18" background="true" outline="false" ></control><control name="bGFiZWw2OQ==" x="563" y="40" w="69" h="25" color="red" type="labelh" text="UmVjb3Jk" size="18" background="true" outline="false" ></control><control name="cmVwZWF0" x="27" y="733" w="136" h="50" color="red" scalef="0.0" scalet="1.0" type="multitoggle" number_x="4" number_y="1" ex_mode="true" local_off="false" ></control><control name="bGFiZWw3MA==" x="42" y="702" w="104" h="23" color="yellow" type="labelh" text="UEIgUmVwZWF0cw==" size="16" background="true" outline="false" ></control><control name="bGFiZWw3MQ==" x="35" y="793" w="20" h="20" color="yellow" type="labelh" text="MQ==" size="16" background="true" outline="false" ></control><control name="bGFiZWw3Mg==" x="101" y="793" w="20" h="20" color="yellow" type="labelh" text="Mw==" size="16" background="true" outline="false" ></control><control name="bGFiZWw3Mw==" x="69" y="793" w="20" h="20" color="yellow" type="labelh" text="Mg==" size="16" background="true" outline="false" ></control><control name="bGFiZWw3NA==" x="123" y="793" w="43" h="20" color="yellow" type="labelh" text="Y29udA==" size="16" background="true" outline="false" ></control><control name="bGFiZWw3NQ==" x="418" y="51" w="114" h="20" color="yellow" type="labelh" text="KHZlcnNpb24gMS4yKQ==" size="18" background="true" outline="false" ></control><control name="ZHJ1bXM=" x="614" y="707" w="50" h="50" color="pink" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="bGFiZWw3OQ==" x="541" y="726" w="67" h="27" color="pink" type="labelh" text="RHJ1bXM=" size="18" background="true" outline="false" ></control><control name="bGFiZWw4MA==" x="538" y="707" w="74" h="24" color="pink" type="labelh" text="U3luY2Vk" size="18" background="true" outline="false" ></control><control name="bGFiZWw4MQ==" x="711" y="490" w="25" h="25" color="pink" type="labelh" text="TQ==" size="18" background="true" outline="false" ></control><control name="bXQy" x="699" y="514" w="50" h="50" color="pink" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="cmVzdHgy" x="169" y="43" w="45" h="30" color="blue" scalef="1.0" scalet="2.0" type="toggle" local_off="false" ></control><control name="bGFiZWw4Mg==" x="90" y="44" w="73" h="27" color="yellow" type="labelh" text="cmVzdCB4IDI=" size="18" background="true" outline="false" ></control><control name="aGVscGVyTGVkcw==" x="699" y="771" w="50" h="50" color="yellow" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="bGFiZWw4Mw==" x="625" y="799" w="65" h="20" color="yellow" type="labelh" text="bGVkcyBvbg==" size="18" background="true" outline="false" ></control><control name="bGFiZWw4NA==" x="628" y="781" w="62" h="20" color="yellow" type="labelh" text="aGVscGVy" size="18" background="true" outline="false" ></control><control name="cmVzdEhhbGY=" x="169" y="8" w="45" h="30" color="blue" scalef="1.0" scalet="0.5" type="toggle" local_off="false" ></control><control name="bGFiZWw4NQ==" x="84" y="10" w="83" h="25" color="yellow" type="labelh" text="cmVzdCB4IDAuNQ==" size="18" background="true" outline="false" ></control><control name="cmVjb3Jk" x="697" y="8" w="60" h="60" color="red" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="cGxheWJhY2s=" x="16" y="8" w="60" h="60" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false" ></control><control name="bGFiZWwxMw==" x="34" y="26" w="23" h="23" color="yellow" type="labelh" text="UA==" size="18" background="true" outline="false" ></control><control name="bGFiZWwxNA==" x="713" y="24" w="27" h="27" color="yellow" type="labelh" text="Ug==" size="18" background="true" outline="false" ></control><control name="ZW5hYmxlUmVjb3Jk" x="642" y="15" w="45" h="45" color="red" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" ></control><control name="bGVkUmVj" x="655" y="28" w="20" h="20" color="yellow" scalef="0.0" scalet="1.0" type="led" ></control></tabpage><tabpage name="c2F2" scalef="0.2" scalet="0.5" li_t="" li_c="gray" li_s="14" li_o="false" li_b="false" la_t="" la_c="gray" la_s="14" la_o="false" la_b="false" ><control name="bGFiZWw1Mg==" x="232" y="269" w="75" h="25" color="green" type="labelh" text="Q29udGVudA==" size="16" background="true" outline="false" ></control><control name="c2xvdA==" x="172" y="311" w="60" h="500" color="yellow" scalef="0.0" scalet="1.0" type="multitoggle" number_x="1" number_y="10" ex_mode="true" local_off="false" ></control><control name="c2xvdGJhbms=" x="513" y="256" w="120" h="60" color="yellow" scalef="0.0" scalet="1.0" type="multitoggle" number_x="2" number_y="1" ex_mode="true" local_off="false" ></control><control name="cmVhZA==" x="511" y="408" w="50" h="50" color="green" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" ></control><control name="d3JpdGU=" x="512" y="567" w="50" h="50" color="red" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" ></control><control name="ZW5hYmxlU2F2ZQ==" x="587" y="485" w="50" h="50" color="red" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" ></control><control name="bGFiZWwzMw==" x="95" y="83" w="102" h="25" color="green" type="labelh" text="U2F2ZSBGb2xkZXI=" size="18" background="true" outline="false" ></control><control name="cGF0aA==" x="94" y="107" w="531" h="25" color="green" type="labelh" text="U2V0IHRoaXMgaW4gc2F2ZS5yYiBwcm9ncmFt" size="16" background="true" outline="false" ></control><control name="YmFuaw==" x="529" y="219" w="80" h="25" color="yellow" type="labelh" text="U2xvdCBCYW5r" size="18" background="true" outline="false" ></control><control name="bGFiZWwzNg==" x="152" y="219" w="104" h="20" color="yellow" type="labelh" text="U2xvdCBTZWxlY3Q=" size="18" background="true" outline="false" ></control><control name="bGFiZWwzNw==" x="568" y="420" w="73" h="25" color="green" type="labelh" text="TG9hZCBGaWxl" size="14" background="true" outline="false" ></control><control name="bGFiZWwzOA==" x="488" y="495" w="87" h="25" color="red" type="labelh" text="RW5hYmxlIFNhdmU=" size="14" background="true" outline="false" ></control><control name="bGFiZWwzOQ==" x="567" y="578" w="80" h="25" color="red" type="labelh" text="U2F2ZSBGaWxl" size="14" background="true" outline="false" ></control><control name="bGFiZWw0MA==" x="130" y="324" w="25" h="25" color="blue" type="labelh" text="MQ==" size="14" background="true" outline="false" ></control><control name="bGFiZWw0MQ==" x="129" y="769" w="25" h="25" color="blue" type="labelh" text="MTA=" size="14" background="true" outline="false" ></control><control name="bGFiZWw0Mg==" x="129" y="720" w="25" h="25" color="blue" type="labelh" text="OQ==" size="14" background="true" outline="false" ></control><control name="bGFiZWw0Mw==" x="130" y="670" w="25" h="25" color="blue" type="labelh" text="OA==" size="14" background="true" outline="false" ></control><control name="bGFiZWw0NA==" x="130" y="620" w="25" h="25" color="blue" type="labelh" text="Nw==" size="14" background="true" outline="false" ></control><control name="bGFiZWw0NQ==" x="130" y="571" w="25" h="25" color="blue" type="labelh" text="Ng==" size="14" background="true" outline="false" ></control><control name="bGFiZWw0Ng==" x="130" y="521" w="25" h="25" color="blue" type="labelh" text="NQ==" size="14" background="true" outline="false" ></control><control name="bGFiZWw0Nw==" x="130" y="472" w="25" h="25" color="blue" type="labelh" text="NA==" size="14" background="true" outline="false" ></control><control name="bGFiZWw0OA==" x="130" y="422" w="25" h="25" color="blue" type="labelh" text="Mw==" size="14" background="true" outline="false" ></control><control name="bGFiZWw0OQ==" x="130" y="373" w="25" h="25" color="blue" type="labelh" text="Mg==" size="14" background="true" outline="false" ></control><control name="bGFiZWw1MA==" x="197" y="22" w="320" h="25" color="blue" type="labelh" text="UmVjb3JkIC8gUGxheWVyIHNhdmUgc2NyZWVu" size="24" background="true" outline="false" ></control><control name="bGVkU2F2ZQ==" x="651" y="498" w="20" h="20" color="red" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDI=" x="272" y="375" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDE=" x="272" y="326" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDEw" x="270" y="771" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDk=" x="272" y="722" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDg=" x="272" y="672" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDc=" x="272" y="623" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDY=" x="272" y="573" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDU=" x="272" y="524" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDQ=" x="272" y="474" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDM=" x="272" y="425" w="20" h="20" color="blue" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDEy" x="300" y="375" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDEx" x="300" y="326" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDIw" x="302" y="771" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDE5" x="300" y="722" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDE4" x="300" y="672" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDE3" x="300" y="623" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDE2" x="300" y="573" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDE1" x="300" y="524" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDE0" x="300" y="474" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="ZDEz" x="300" y="425" w="20" h="20" color="purple" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTI=" x="80" y="375" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTE=" x="80" y="326" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTEw" x="80" y="771" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTk=" x="79" y="722" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTg=" x="80" y="672" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTc=" x="80" y="623" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTY=" x="80" y="573" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTU=" x="80" y="524" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTQ=" x="80" y="474" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTM=" x="80" y="425" w="20" h="20" color="orange" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTEy" x="107" y="375" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTEx" x="107" y="326" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTIw" x="107" y="771" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTE5" x="107" y="722" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTE4" x="107" y="672" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTE3" x="107" y="623" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTE2" x="108" y="573" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTE1" x="108" y="524" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTE0" x="108" y="474" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="YTEz" x="107" y="425" w="20" h="20" color="brown" scalef="0.0" scalet="1.0" type="led" ></control><control name="bGFiZWw1MQ==" x="87" y="270" w="104" h="25" color="green" type="labelh" text="TGFzdCBBY2Nlc3M=" size="16" background="true" outline="false" ></control><control name="bWlzc2luZw==" x="494" y="634" w="191" h="25" color="yellow" type="labelh" text="IA==" size="16" background="true" outline="false" ></control><control name="ZW5hYmxlTG9hZA==" x="584" y="343" w="50" h="50" color="green" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" ></control><control name="bGFiZWw4Ng==" x="487" y="359" w="87" h="25" color="green" type="labelh" text="RW5hYmxlIExvYWQ=" size="14" background="true" outline="false" ></control><control name="bGVkTG9hZA==" x="649" y="360" w="20" h="20" color="green" scalef="0.0" scalet="1.0" type="led" ></control><control name="bGFiZWw4Nw==" x="152" y="823" w="101" h="25" color="yellow" type="labelh" text="Q3VycmVudCBCYW5r" size="16" background="true" outline="false" ></control><control name="YmFuazI=" x="237" y="855" w="101" h="25" color="purple" type="labelh" text="IA==" size="18" background="true" outline="false" ></control><control name="YmFuazE=" x="72" y="856" w="101" h="25" color="blue" type="labelh" text="IA==" size="18" background="true" outline="false" ></control><control name="bGFiZWw5MA==" x="240" y="324" w="25" h="25" color="purple" type="labelh" text="MTE=" size="14" background="true" outline="false" ></control><control name="bGFiZWw5MQ==" x="239" y="769" w="25" h="25" color="purple" type="labelh" text="MjA=" size="14" background="true" outline="false" ></control><control name="bGFiZWw5Mg==" x="239" y="720" w="25" h="25" color="purple" type="labelh" text="MTk=" size="14" background="true" outline="false" ></control><control name="bGFiZWw5Mw==" x="240" y="670" w="25" h="25" color="purple" type="labelh" text="MTg=" size="14" background="true" outline="false" ></control><control name="bGFiZWw5NA==" x="240" y="620" w="25" h="25" color="purple" type="labelh" text="MTc=" size="14" background="true" outline="false" ></control><control name="bGFiZWw5NQ==" x="240" y="571" w="25" h="25" color="purple" type="labelh" text="MTY=" size="14" background="true" outline="false" ></control><control name="bGFiZWw5Ng==" x="240" y="521" w="25" h="25" color="purple" type="labelh" text="MTU=" size="14" background="true" outline="false" ></control><control name="bGFiZWw5Nw==" x="240" y="472" w="25" h="25" color="purple" type="labelh" text="MTQ=" size="14" background="true" outline="false" ></control><control name="bGFiZWw5OA==" x="240" y="422" w="25" h="25" color="purple" type="labelh" text="MTM=" size="14" background="true" outline="false" ></control><control name="bGFiZWw5OQ==" x="240" y="373" w="25" h="25" color="purple" type="labelh" text="MTI=" size="14" background="true" outline="false" ></control></tabpage></layout>
recordplayercombined-RF.rb
#spRecordPlayer.rb
#Sonic Pi Record / Player control using TouchOSC written by Robin Newman, March 2018
#handles recording and playback, real time or double speed, key changes, metronome,
#10 synth choices, optional percussion. It is possible to loop recordings, and play them
#seamlessly if recorded using the inbuilt metronome. Adjustment can be made
#to the time between repeats.
#uses Ableton push2 style layout. Does not run well on a Pi3 as it taxes Sonic Pi quite heavily and requires
#low latency audio output. Works well on a Mac.
#release version 1.2
This file has been truncated. show original
The second example does not do live audio looping, but is good to learn from and could be adapted to handle live audio.
1 Like
Very cool, thanks for the references! They definitely helped with figuring out how to use record
and buffer
objects together! The language reference could use an example or two, I think
Based on the examples, I was trying something like this:
if not defined?($takes) then
$takes = {}
end
# Record or play a buffer from sound input
# Params:
# - n: name of the `buffer` to use
# - l: length (in beats) of the `buffer` to use
# - t: take number -> re-recorded if greater than the last recorded take
def brp(n, l, t)
k = [n, l]
b = buffer n, l
if t == 0 then
# Just audition, don't play the last take, don't record
synth :sound_in, sustain: l
sleep l
elsif ($takes[k] or 0) >= t then
# Play the last recorded take
sample b
sleep l
else
# Record another take (while playing it back)
$takes[k] = t
with_fx :record, buffer: b do
synth :sound_in, sustain: l
sleep l
end
end
end
live_loop :baseline do
sync :tock
with_fx :octaver do
brp :baseline, 4, 4
end
end
live_loop :melody do
sync :tock
brp :melody, 8, 4
end
I didn’t really have time to play with it much (it’s late already), but this interface feels promising to me. The idea being that the brp
can be chucked in anywhere sample
or synth
could and it keeps on repeating the last take
until you increment the take number for one of them to re-record it.
1 Like