Comments (3)
The live/jam
fn is handy because it takes a var
and loops it, dereferencing the var over and over again so that you can edit it live e.g. (live/jam (var melody))
.
Sometimes, however, melodies start in negative time, i.e. the time series of notes has an initial note or notes with a negative time e.g. [{:time -1 :duration 1/2 :pitch 2} {:time -1/2 :duration 1/2 :pitch 1} {:time 0 :duration 1 :pitch 0}]
. This is not (necessarily) a mistake - some melodies have lead-in notes that start before the emphasis on the first beat of the bar.
When we try and use var/jam
on a melody that starts in negative time, however, those notes are horribly mangled. This is because we only redereference the var just as we need it, and by the time we get to that loop, those notes are already in the past.
There are two possible solutions I can think to this:
- Filter out negative notes, which is simple but cuts out these notes altogether.
- Transplant negative notes to the end of the melody so that the lead-in notes are still played at the right time.
I prefer the latter solution, though I'm open to suggestions.
from leipzig.
In play
you set the time=0 origin with (melody/after (overtone/now))
It seems like you would want to set 0 to some time in the future, enough to handle the negative values. The "real world" convention is one measure in the future...people count "1 2 3 4" but we know they are really indicating "-4 -3 -2 -1"
So, something like:
(melody/after (+ (overtone/now) (* beats-per-measure beats-per-millisecond)))
Will you drop the notes on replay or play them? My intuition says drop them.
from leipzig.
Hmm, there are disadvantages to both dropping and keeping:
- Dropping - those notes aren't available anymore, so you can't work on them or use them in a performance.
- Not dropping - the loop will now have an uneven length.
I'd also considered transplanting the lead-in notes to play in parallel with the end of the loop. That would produce the right effect on an unchanging loop, though it might act a bit oddly as you edit it.
from leipzig.
Related Issues (12)
- [Feature Request] Velocity support HOT 9
- `leipzig.melody/then` argument order HOT 1
- [question] Stringed instruments? HOT 2
- [question] syncing leipzig compositions with quil visuals HOT 4
- Is clojure / clojurescript dep really needed?
- All tracks return future pending map
- how to implement retrograde? HOT 8
- Full stop HOT 5
- Windows 64bit and overtone.live HOT 6
- Duration messes up when the last note finishes before another
- Support CLJS HOT 5
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 leipzig.