{
 "timestamp": "2026-06-18T15:07:28.849Z",
 "code": "# Source: https://in-thread.sonic-pi.net/t/a-choose-based-automatic-music-generator/9594\n# Author: Tianjh\n# Title: A \"Choose\"-Based Automatic Music Generator\n# Captured: 2026-04-24\n\nuse_random_seed 0\nuse_bpm rrand(90, 130)\nsynths = [:piano, :saw, :square, :tri, :supersaw]\nuse_synth choose(synths)\nm = [:g3, :a3, :b3, :c4, :d4, :e4, :f4, :g4]\ntimes = [0.5, 1]\nc = choose(m)\nt = choose(times)\n\nin_thread do\n loop do\n sample :bd_ada\n sleep 1\n end\nend\n\nloop do\n play c\n if c == :c4 || c == :e4 || c == :g3 || c == :g4 then\n c = choose([m[0], m[3], m[5], m[7]])\n elsif c == :f4 || c == :d4 || c == :b3\n c = choose([m[5], m[4], m[2]])\n elsif c == :a3\n c = choose([m[0], m[2], m[3]])\n end\n sleep choose(times)\nend\n",
 "duration": 30000,
 "name": "comm-in-thread-forum__40_choose_generator",
 "desktop": {
 "wavPath": "/Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/desktop-recordings/desktop_2026-06-18T15-06-13-992Z_comm-in-thread-forum__40_choose_generator.wav",
 "stats": {
 "duration": 31.369333333333334,
 "peak": 0.5386,
 "rms": 0.1265,
 "clipping": 0,
 "sampleRate": 48000,
 "channels": 2
 },
 "ok": true,
 "pitch": {
 "count": 35,
 "median_spacing_s": 0.73,
 "midi": [
 60,
 55,
 67,
 64,
 64,
 64,
 64,
 64,
 67,
 60,
 67,
 64,
 64,
 55,
 55,
 67,
 60,
 64,
 55,
 60,
 67,
 67,
 67,
 67,
 67,
 64,
 55,
 60,
 67,
 55,
 55,
 60,
 60,
 67,
 60
 ],
 "pc": [
 0,
 7,
 7,
 4,
 4,
 4,
 4,
 4,
 7,
 0,
 7,
 4,
 4,
 7,
 7,
 7,
 0,
 4,
 7,
 0,
 7,
 7,
 7,
 7,
 7,
 4,
 7,
 0,
 7,
 7,
 7,
 0,
 0,
 7,
 0
 ],
 "names": [
 "C4",
 "G3",
 "G4",
 "E4",
 "E4",
 "E4",
 "E4",
 "E4",
 "G4",
 "C4",
 "G4",
 "E4",
 "E4",
 "G3",
 "G3",
 "G4",
 "C4",
 "E4",
 "G3",
 "C4",
 "G4",
 "G4",
 "G4",
 "G4",
 "G4",
 "E4",
 "G3",
 "C4",
 "G4",
 "G3",
 "G3",
 "C4",
 "C4",
 "G4",
 "C4"
 ],
 "method": "onset",
 "confidence": 1,
 "inconclusive": false,
 "compare": "midi"
 }
 },
 "web": {
 "wavPath": "/Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/2026-06-18T15-06-15-019Z_inline_audio.wav",
 "stats": {
 "duration": 29.696,
 "peak": 0.3273,
 "rms": 0.0766,
 "clipping": 0,
 "sampleRate": 48000,
 "channels": 2
 },
 "ok": true,
 "pitch": {
 "count": 34,
 "median_spacing_s": 0.74,
 "midi": [
 60,
 55,
 67,
 64,
 64,
 64,
 64,
 64,
 67,
 60,
 67,
 64,
 64,
 55,
 55,
 67,
 60,
 64,
 55,
 60,
 67,
 67,
 67,
 67,
 67,
 64,
 55,
 60,
 67,
 55,
 55,
 55,
 60,
 67
 ],
 "pc": [
 0,
 7,
 7,
 4,
 4,
 4,
 4,
 4,
 7,
 0,
 7,
 4,
 4,
 7,
 7,
 7,
 0,
 4,
 7,
 0,
 7,
 7,
 7,
 7,
 7,
 4,
 7,
 0,
 7,
 7,
 7,
 7,
 0,
 7
 ],
 "names": [
 "C4",
 "G3",
 "G4",
 "E4",
 "E4",
 "E4",
 "E4",
 "E4",
 "G4",
 "C4",
 "G4",
 "E4",
 "E4",
 "G3",
 "G3",
 "G4",
 "C4",
 "E4",
 "G3",
 "C4",
 "G4",
 "G4",
 "G4",
 "G4",
 "G4",
 "E4",
 "G3",
 "C4",
 "G4",
 "G3",
 "G3",
 "G3",
 "C4",
 "G4"
 ],
 "method": "onset",
 "confidence": 1,
 "inconclusive": false,
 "compare": "midi"
 },
 "toolFailReason": null,
 "errors": []
 },
 "spectrogram": {
 "l2_mel_db": 18.5240478515625,
 "mfcc_distance": 138.10533142089844,
 "frames_compared": 2785,
 "spectrogram_png": "/Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/compare_2026-06-18T15-06-51-002Z_comm-in-thread-forum__40_choose_generator_spectrogram.png",
 "desktop_peak_freq_hz": 195.98758872784458,
 "web_peak_freq_hz": 390.9954202586207,
 "per_beat": null
 },
 "spectrogramError": null,
 "reportPath": "/Users/mrityunjaybhardwaj/Documents/projects/sonicPiWeb/.captures/compare_2026-06-18T15-06-51-002Z_comm-in-thread-forum__40_choose_generator.md",
 "reconciledPitch": null,
 "eventParity": {
 "report": {
 "verdict": "STRUCTURE-MATCH",
 "isPrng": true,
 "reasons": [
 "Significant layers present on both sides (PRNG piece — counts/choices vary by )."
 ],
 "rows": [
 {
 "synthdef": "sonic-pi-tri",
 "desktop": 89,
 "web": 89,
 "ratio": 1,
 "significant": true,
 "status": "match",
 "desktopOnset": 0,
 "webOnset": 0
 },
 {
 "synthdef": "sonic-pi-basic_mono_player",
 "desktop": 63,
 "web": 62,
 "ratio": 0.9841269841269841,
 "significant": true,
 "status": "match",
 "desktopOnset": 0,
 "webOnset": 0
 }
 ],
 "fxRows": [],
 "desktopTotal": 152,
 "webTotal": 151,
 "totalRatio": 0.99,
 "orderMatch": true,
 "desktopOrder": [
 "tri",
 "basic_mono_player"
 ],
 "webOrder": [
 "tri",
 "basic_mono_player"
 ],
 "sequenceParity": {
 "match": true,
 "epsilonMs": 15,
 "notesChecked": true,
 "rows": [
 {
 "synthdef": "sonic-pi-tri",
 "desktopOnsets": [
 0,
 0.5,
 1,
 1.5,
 1.75,
 2,
 2.25,
 2.75,
 3.25,
 3.5,
 3.75,
 4,
 4.5,
 5,
 5.5,
 6,
 6.25,
 6.75,
 7,
 7.25,
 7.75,
 8,
 8.25,
 8.5,
 9,
 9.5,
 10,
 10.25,
 10.5,
 10.75,
 11,
 11.25,
 11.5,
 11.75,
 12.25,
 12.75,
 13,
 13.25,
 13.5,
 13.75,
 14.25,
 14.5,
 14.75,
 15,
 15.25,
 15.5,
 16,
 16.5,
 17,
 17.25,
 17.75,
 18.25,
 18.5,
 18.75,
 19,
 19.25,
 19.5,
 19.75,
 20.25,
 20.5,
 21,
 21.5,
 21.75,
 22.25,
 22.75,
 23,
 23.25,
 23.5,
 23.75,
 24.25,
 24.5,
 24.749,
 25.249,
 25.499,
 25.999,
 26.249,
 26.499,
 26.749,
 26.999,
 27.499,
 27.749,
 28.249,
 28.499,
 28.749,
 29.249,
 29.749,
 29.999,
 30.249,
 30.749
 ],
 "webOnsets": [
 0,
 0.5,
 1,
 1.5,
 1.75,
 2,
 2.25,
 2.75,
 3.25,
 3.5,
 3.75,
 4,
 4.5,
 5,
 5.5,
 6,
 6.25,
 6.75,
 7,
 7.25,
 7.75,
 8,
 8.25,
 8.5,
 9,
 9.5,
 10,
 10.25,
 10.5,
 10.75,
 11,
 11.25,
 11.5,
 11.75,
 12.25,
 12.75,
 13,
 13.25,
 13.5,
 13.75,
 14.25,
 14.5,
 14.75,
 15,
 15.25,
 15.5,
 16,
 16.5,
 17,
 17.25,
 17.75,
 18.25,
 18.5,
 18.75,
 19,
 19.25,
 19.5,
 19.75,
 20.25,
 20.5,
 21,
 21.5,
 21.75,
 22.25,
 22.75,
 23,
 23.25,
 23.5,
 23.75,
 24.25,
 24.5,
 24.75,
 25.25,
 25.5,
 26,
 26.25,
 26.5,
 26.75,
 27,
 27.499,
 27.749,
 28.249,
 28.499,
 28.749,
 29.249,
 29.749,
 29.999,
 30.249,
 30.749
 ],
 "comparedLen": 89,
 "timingMatched": true,
 "firstMismatchIdx": -1,
 "maxDevMs": 1,
 "noteMatched": true,
 "matched": true
 },
 {
 "synthdef": "sonic-pi-basic_mono_player",
 "desktopOnsets": [
 0,
 0.5,
 1,
 1.5,
 2,
 2.5,
 3,
 3.5,
 4,
 4.5,
 5,
 5.5,
 6,
 6.5,
 7,
 7.5,
 8,
 8.5,
 9,
 9.5,
 10,
 10.5,
 11,
 11.5,
 12,
 12.5,
 13,
 13.5,
 14,
 14.5,
 15,
 15.5,
 16,
 16.5,
 17,
 17.5,
 18,
 18.5,
 19,
 19.5,
 20,
 20.5,
 21,
 21.5,
 22,
 22.5,
 23,
 23.5,
 24,
 24.499,
 24.999,
 25.499,
 25.999,
 26.499,
 26.999,
 27.499,
 27.999,
 28.499,
 28.999,
 29.499,
 29.999,
 30.499,
 30.999
 ],
 "webOnsets": [
 0,
 0.5,
 1,
 1.5,
 2,
 2.5,
 3,
 3.5,
 4,
 4.5,
 5,
 5.5,
 6,
 6.5,
 7,
 7.5,
 8,
 8.5,
 9,
 9.5,
 10,
 10.5,
 11,
 11.5,
 12,
 12.5,
 13,
 13.5,
 14,
 14.5,
 15,
 15.5,
 16,
 16.5,
 17,
 17.5,
 18,
 18.5,
 19,
 19.5,
 20,
 20.5,
 21,
 21.5,
 22,
 22.5,
 23,
 23.5,
 24,
 24.5,
 25,
 25.5,
 26,
 26.5,
 27,
 27.499,
 27.999,
 28.499,
 28.999,
 29.499,
 29.999,
 30.499
 ],
 "comparedLen": 62,
 "timingMatched": true,
 "firstMismatchIdx": -1,
 "maxDevMs": 1,
 "noteMatched": true,
 "matched": true
 }
 ],
 "reasons": [
 "tri: 89 onsets match within ε (max Δ 1ms), notes match",
 "basic_mono_player: 62 onsets match within ε (max Δ 1ms), notes match"
 ]
 }
 },
 "note": "STRUCTURE-MATCH · onset-seq match · d152/w151"
 }
}