Comments (6)
Magic! It's almost perfectly in sync now. Thank you as always!
from cl-patterns.
With the recent changes to it, by default the clock skips any events that are "expired", i.e. occur in "the past". If *latency*
is 0
then the clock has no time to calculate events from a pattern, so all events it generates will technically occur in the past. If you want the clock to play all events even if they're "expired", you can do this:
(setf (slot-value cl-patterns:*clock* 'cl-patterns::play-expired-events) t)
Then even if the latency is 0 it will still play all events. However, you may still get warnings from SuperCollider (i.e. "late 0.004638016" and similar) when it plays them. It's also possible that with 0 latency there may be more "jitter" between events since the clock processes events in batches and the backend will be told to play them as soon as it receives them. For example:
(pb :test
:instrument :kick ;; or any percussive sound
:dur 1/8
:pfindur 4)
If you play that pattern with *latency*
set to 0
you should hear the jitter between notes. You can compare it to when *latency*
is at its default 1/10
value which sounds much smoother and consistent, as expected.
If you're curious, the "skip expired events" change to the clock was made in order to prevent tons of events from being played after the user recovers from an error. i.e. if you do:
(pb :test
:instrument :default
:dur 1
:x (p/ 1 (pseq (list 1 2 3 0)))
:pfindur 4)
...you'll get an error every 4th event on this pattern since it's attempting to divide by 0. If you wait a bit and then choose the SKIP-EVENT
restart you'll likely get a bunch of late messages and maybe hear a few of the events. You probably won't hear them all since they're being told to end as soon as they've started. However if you do (cl-collider::server-query-all-nodes)
you'll be able to see all of those notes still running in the background. They will stay running even though you never hear them because of this bug in scsynth where notes that are short enough aren't cleaned up. Just something to be aware of; if you notice scsynth using an abnormal amount of CPU, it may be these "ghost notes" lingering.
from cl-patterns.
Oh, also, unfortunately the ALSA MIDI backend doesn't support timestamps yet. So SC and MIDI likely won't be 100% in sync even with *latency*
set to 0
... Though it's possible they may still sound synced enough for your purposes.
But yeah, MIDI timestamps are definitely something I should fix when I'm able to; I'll leave this issue open as a reminder to do that.
from cl-patterns.
Ahh, actually it looks like even with play-expired-events
set to t
the MIDI backend will throw errors because it's trying to sleep a negative amount. Fortunately this won't be too hard to fix; one moment.
from cl-patterns.
Fixed in c27c6e0 :)
from cl-patterns.
Also I did see that the ALSA MIDI backend was erroneously adding *latency*
to the event timing even though the clock already includes latency in its calculations. I fixed that in 37dc8f2 which should bring the backends even more in sync with each other.
from cl-patterns.
Related Issues (20)
- Support NamedControl for cl-collider HOT 1
- Can't use list with a single value as midinote HOT 6
- [Feature Request] Allow CC only patterns HOT 2
- About *alsa-midi-instrument-map* HOT 3
- Error "There is no class named COMMON-LISP-USER::PBIND-PSTREAM." HOT 2
- Set default quant to 1
- pnary doesn't work with prest HOT 1
- stretch doesn't work HOT 2
- The lock in ipstream-stream is made a non-recursive, but is used as recursive
- Changing arguments interactively HOT 12
- Add 12-tone matrix generator HOT 16
- :tempo key HOT 1
- Plazy fails with repeats=1 HOT 1
- Some systems failed to build for Quicklisp dist HOT 1
- Some systems failed to build for Quicklisp dist HOT 2
- Instantaneous tempo changes HOT 3
- Saving output to file HOT 2
- Using print representation of symbols HOT 5
- Can't change tempo of running clock loop HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cl-patterns.