Jump to content

Featured Replies

Posted

Hello Opusmodus team and community,

I'm working on a simple live-coded techno drum loop using live-coding-midi, and while the loop plays and repeats, it's not looping seamlessly — the playback seems to stutter or lose sync at the loop boundary.

Despite matching total durations across parts (kick = 16 quarter notes, snare = 4 hits, hats = 64 sixteenths), something isn't syncing correctly at the loop point. I suspect it's an issue with the alignment of the final bar or a nuance in how live-coding-midi handles timing across instruments.

Is there something I'm missing in how Opusmodus expects score lengths to be structured for seamless looping?

Do I need to pad rests or explicitly align the last bar to a total duration?

Is :start 1 :end 4 the issue even though it's 4 full bars?

Any guidance, corrections, or examples of fully working seamless loops using live-coding-midi would be greatly appreciated!

Thank you 🙏

Here’s the minimal working example I'm using:

;; Kick: 4-on-the-floor (quarter notes)

(setf kick (make-omn

:length (gen-repeat 16 'q)

:pitch (gen-repeat 16 'c2)

:velocity '(fff)))

;; Snare: hits on beats 2 and 4 of each bar

(setf snare (make-omn

:length '(q - q - q - q - q - q - q - q -)

:pitch '(d2 d2 d2 d2)

:velocity '(ff)))

;; Hi-hats: 16th notes across 4 bars

(setf chh (make-omn

:length (gen-repeat 64 's)

:pitch (gen-repeat 64 'gb2)

:velocity '(f)))

(def-score techno-loop

(:time-signature '(4 4)

:tempo 128

:start 1

:end 4)

(kick :omn kick :port "Bus 1" :channel 1 :sound 'gm :program 0)

(snare :omn snare :port "Bus 1" :channel 2 :sound 'gm :program 0)

(chh :omn chh :port "Bus 1" :channel 3 :sound 'gm :program 0))

(live-coding-midi (compile-score 'techno-loop))

I did a test with 'gm sound and I don't hear and delays.

;; Kick: 4-on-the-floor (quarter notes)
(setf kick (make-omn
            :length (gen-repeat 16 'q)
            :pitch (gen-repeat 16 'c2)
            :velocity '(fff)))

;; Snare: hits on beats 2 and 4 of each bar
(setf snare (make-omn
             :length '(q - q - q - q - q - q - q - q -)
             :pitch '(d2 d2 d2 d2)
             :velocity '(ff)))

;; Hi-hats: 16th notes across 4 bars
(setf chh (make-omn
           :length (gen-repeat 64 's)
           :pitch (gen-repeat 64 'gb2)
           :velocity '(f)))

(def-score techno-loop
    (:time-signature '(4 4)
     :tempo 128
     :start 1
     :end 4)
  (kick :omn kick :sound 'gm :channel 10 :sound 'gm :program 0)
  (snare :omn snare :channel 10 :sound 'gm :program 0)
  (chh :omn chh :channel 10 :sound 'gm :program 0))
(live-coding-midi (compile-score 'techno-loop))

i have a similar problem with the below code, that creates a one-bar-electro-style beat.

i looped this code with the live-coding tool and recorded the midi to ableton.

if you import the attached midi-file into ableton, you should see that starting from the second 16th note all the notes start a little bit too early, at the end of the beat there are short notes that where never programmed in the opusmodus-script and when the beat starts again in the next bar its too late.

as i-m a total opusmodus-newbie i wouldn-t be surprised if this comes from errors in my script...

EDIT: I also attached a screenshot of the recording in Ableton.

;; 1 bar of electro rhythms

(setf bd-rhythm (polygon-rhythm '(0 3 6 10) 16 0 ))

(setf snare-rhythm (polygon-rhythm '(4 12) 16 4 ))

(setf closed-hh-rhythm (polygon-rhythm '(0 1 2 3 4 5 6 7 8 9 10 11 13 15) 16 0))

(setf open-hh-rhythm (polygon-rhythm '(14) 16 14))

(setf clap-rhythm (polygon-rhythm '(4 12) 16 4))

;; Accents for the rhythms

(setf bd-velocity (list 'ff 'f 'mf))

(setf sn-velocity (list 'ff 'mf))

(setf closed-hh-velocity (list 'p 'mf 'ff 'mf))

(setf open-hh-velocity 'f)

(setf clap-velocity (list 'mf 'ff))

;; Set midinotes for "Vinyl SP From Mars" Sample Pack

;; Why do i need to set midinote 'c2 in Opusmodus to generate a 'c1 for Ableton?

(setf bd-midinote 'c2)

(setf snare-midinote 'ds2)

(setf closed-hh-midinote 'fs2)

(setf open-hh-midinote 'g2)

(setf clap-midinote 'e2)

;; create midi-data for the beat-loop out of the rhythms, accents and midi-notes

(setf bd-beat (rhythm-map bd-midinote bd-velocity bd-rhythm))

(setf sn-beat (rhythm-map snare-midinote sn-velocity snare-rhythm))

(setf clap-beat (rhythm-map clap-midinote clap-velocity clap-rhythm))

(setf closed-hh-beat (rhythm-map closed-hh-midinote closed-hh-velocity closed-hh-rhythm))

(setf open-hh-beat (rhythm-map open-hh-midinote open-hh-velocity open-hh-rhythm))

;; create score and send it to Ableton via the IAC Bus

(def-score drums

(:key-signature 'atonal

:time-signature '(4 4)

:tempo 140 )

(Bass-Drum :omn bd-beat :port "IAC Bus 1" :channel 1)

(Snare :omn sn-beat)

(Clap! :omn clap-beat)

(Closed-Hihat :omn closed-hh-beat)

(Open-Hihat :omn open-hh-beat)

)

Electro Beat Loop.mid

Bildschirmfoto 2025-04-10 um 20.02.03.png

  • Author
2 hours ago, opmo said:

I did a test with 'gm sound and I don't hear and delays.

;; Kick: 4-on-the-floor (quarter notes)
(setf kick (make-omn
            :length (gen-repeat 16 'q)
            :pitch (gen-repeat 16 'c2)
            :velocity '(fff)))

;; Snare: hits on beats 2 and 4 of each bar
(setf snare (make-omn
             :length '(q - q - q - q - q - q - q - q -)
             :pitch '(d2 d2 d2 d2)
             :velocity '(ff)))

;; Hi-hats: 16th notes across 4 bars
(setf chh (make-omn
           :length (gen-repeat 64 's)
           :pitch (gen-repeat 64 'gb2)
           :velocity '(f)))

(def-score techno-loop
    (:time-signature '(4 4)
     :tempo 128
     :start 1
     :end 4)
  (kick :omn kick :sound 'gm :channel 10 :sound 'gm :program 0)
  (snare :omn snare :channel 10 :sound 'gm :program 0)
  (chh :omn chh :channel 10 :sound 'gm :program 0))
(live-coding-midi (compile-score 'techno-loop))

Thank you so much for your quick response!

I'm still noticing the issue on gm—while it's less apparent when using General MIDI, there's still a slight pause right before the loop returns to bar one, almost as if the BPM is slightly out of sync with the loop itself. I've restarted Opusmodus and tried several different approaches, but I'm still experiencing this unwanted behavior on my system.

Just to clarify, I'm a beginner—so it's possible I'm overlooking something simple. I’d really appreciate any further insights or suggestions!

Thanks again for your help.

Yes, I noticed the slight shift as well. Then, I selected MIDI 2.0 in the Logic setup, and the live recording was perfectly in sync.

What you could do is extend the score to the desired length, send it to the MIDI player, and save it. Then, open the MIDI file in your DAW.

Life MIDI recording in Logic with MIDI 2.0 setup:

Screenshot 2025-04-11 at 17.03.29.png

To retrieve all the controllers and related components, we delay the start slightly. This is what you observe during Live Coding when a loop is active.

Live Coding is designed for a different functionality, so if you intend to use it for recording, I recommend setting the desired score length directly in your def-score instance.

The start delay:

Screenshot 2025-04-11 at 19.05.54.png

  • Author
On 4/10/2025 at 8:31 PM, Maestro2025 said:

Thank you so much for your quick response!

I'm still noticing the issue on gm—while it's less apparent when using General MIDI, there's still a slight pause right before the loop returns to bar one, almost as if the BPM is slightly out of sync with the loop itself. I've restarted Opusmodus and tried several different approaches, but I'm still experiencing this unwanted behavior on my system.

Just to clarify, I'm a beginner—so it's possible I'm overlooking something simple. I’d really appreciate any further insights or suggestions!

Thanks again for your help.

Hi Admin and everyone else,

Hope you're having a good week.

Following up on our previous exchange regarding the slight off before loops repeat in Live Coding mode. I'm still consistently experiencing this on my system, even when using General MIDI as suggested.

To help me troubleshoot whether this is specific to my setup or if I'm perhaps misunderstanding something fundamental, would you perhaps be able to share a very simple code example (maybe a basic drum loop) that demonstrates perfectly seamless looping on your end?

Alternatively, if any other forum members reading this have a moment, could they perhaps try running the code I posted previously and confirm if they experience any slight gap or hesitation before the loop restarts?

Thanks again for your time and any further assistance the community can offer. I really appreciate the help as I learn Opusmodus.

Best regards,

Hello,

i did run your code and also experienced the timing issue, when the loop restarts. To me it seems the slight off in the Live-Coding-Instrument is by design because of the below quote:

On 4/11/2025 at 7:14 PM, opmo said:

To retrieve all the controllers and related components, we delay the start slightly.

  • Author
3 hours ago, mstep said:

Hello,

i did run your code and also experienced the timing issue, when the loop restarts. To me it seems the slight off in the Live-Coding-Instrument is by design because of the below quote:

Thank you @mstep , I appreciate you checking and confirming.

While I understand the technical basis, my primary use for Live Coding looping in this case is real-time idea generation, where even a small timing gap disrupts the musical flow and makes judging rhythmic ideas difficult. For this workflow, seamless looping is essential.

  1. Is there any way to adjust the start delay in Live Coding? @opmo

  2. Are there alternative methods within Opusmodus to achieve truly seamless looping using live coding? @opmo

Any insights or potential workarounds for achieving perfect real-time loop timing would be greatly appreciated.

Thanks again for your help!

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy