Posted September 22, 20195 yr Hello all, I'm coming from the javascript development world. Here are few musical ideas. Is there a way to implement them thanks to Opusmodus ? - play a sequence of notes in 30 seconds: in javascript, it could be pseudo-coded like this: setTimeout(function(){ play('c4 d4 e4 f4 g4'); }, 3000); - play a sequence of notes at a specific event. in Javascript/jQuery, it is very easy to code anonymous functions that would wait for a specific event to be triggered. Some examples I have in mind: play 'do ré mi' at bar 4 $('4th bar').on(function() { play('c5 d5 e6');}); play 'do ré mi' each time note f5 is played $('f5').on(function() { play('c5 d5 e6');}); repeat the note + octave when f5 is played $('f5').on(function(this) { play(this + this.octave(1));}); In other words: is it possible to trigger an anonymous function with opusmodus, so that a musical phrase will be played at specific event ? Thanks for clarification, best !
September 23, 20195 yr SLEEP is the function you are looking for. (sleep time) ; in seconds The 1st expression will play for 10 second. The 2nd for 4 seconds. (progn (ps 'gm :cl (list (gen-repeat 100 '((s c4 d4 e4 f4 g4))))) (sleep 10) (ps 'gm :fl (list '(q c5 d5 e5 f5 g5 a5 b5))) (sleep 4) (ps 'gm :fl (list '(w cs6))) )
September 23, 20195 yr but SLEEP is not very precise - would be nic to have in OPMO a real precise trigger, like with OSC (for external players...) 🙂
September 23, 20195 yr the NUMBER is precise, but ... 😉 ...but the great thing is, you are very flexible (and open) in OPMO/lisp... and you can trigger also other software/externals from OPMO/lisp via OSC, i LOVE IT 🙂
September 23, 20195 yr Every function which use a time wait (Threads, OSC and other libraries) using SLEEP - very precise indeed. 🙂
September 23, 20195 yr my colleagues from the computermusic laboratory advised me not to steer external things via internal SLEEP, but also to control the TIME / delay via OSC. perhaps also has to do with the fact that for me different things must be controlled in parallel and synchronized. i don't know...
September 23, 20195 yr Hello, Ok thanks ! I understand how to mitigate my first use case with SLEEP. But what the second one ? how to play a musical phrase at specific event, like for example when "f5" is played Thanks again !
September 24, 20195 yr you have many way to do that in OM, have a look to pattern-map for example or substitute-map... SB.
September 26, 20195 yr > but SLEEP is not very precise The Common Lisp standard actually says that the number of seconds specified as arguments for sleep is approximate: > Causes execution to cease and become dormant for approximately the seconds of real time indicated by seconds, whereupon execution is resumed. CLHS: Function SLEEP WWW.LISPWORKS.COM Anyway, it seems that at least on a Mac the imprecision is rather regular, see the following discussion with empirical tests. Time to sleep under different platforms LISP-HUG.LISPWORKS.NARKIVE.COM Anyway, for realtime scheduling in a musical context one needs likely a proper scheduler for that. Best, Torsten
September 26, 20195 yr thanks! a. p.s. Quote Anyway, for realtime scheduling in a musical context one needs likely a proper scheduler for that. ... that's why i have some other solutions for my needs...
Create an account or sign in to comment