Comments (8)
There's definitely an issue. Crab canons should be reflecting the notes based on when they finish, not when they start.
from leipzig.
The following now works as I'd expect:
((lc/simple 2) (lc/crab (lm/phrase [1 0.5 0.5] [4 5 6])))
I've offset the result by the full length of the melody, not the time of the last note.
Another possibility to reduce confusion here would be to incorporate the lc/simple
offset into crab
itself. Would that better fulfil people's expectations?
from leipzig.
Another possibility to reduce confusion here would be to incorporate the lc/simple offset into crab itself. Would that better fulfil people's expectations?
That would match my usage. I'd like to transform a phrase and receive a phrase that I could play in its place. I don't know about others, but I'm not sure how I would use a phrase that starts before the given phrase.
from leipzig.
You may also consider doing a sort-by :time in crab. When I pass a long phrase with multiple sub-sequences to live/play, it seems to get confused if some of the notes it plays are not sorted. Looking at the code, I'm not exactly sure how this happens, but I had some issues until I wrapped my own usage with sort-by :time.
from leipzig.
So far, I'd only considered using crab in the context of canon, and so I
relied on canon sorting things after the transformation. That assumption
seems a little shaky on closer inspection.
Are you using crab on its own?
Chris
On 10 June 2013 05:51, Roger Allen [email protected] wrote:
You may also consider doing a sort-by :time in crab. When I pass a long
phrase with multiple sub-sequences to live/play, it seems to get confused
if some of the notes it plays are not sorted. Looking at the code, I'm not
exactly sure how this happens, but I had some issues until I wrapped my own
usage with sort-by :time.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-19179000
.
from leipzig.
I have a function here: https://github.com/rogerallen/explore_overtone/blob/master/src/explore_overtone/song_algorithm.clj#L143
that takes a phrase as input, randomly alters the phrase and returns it. It is much like what you do with canon, but a replacement, rather than appending. I'm just "noodling" around, so take this as just one datapoint on how some J Random User might use Leipzig. Always returning time sorted phrases might be in line with the principle of least astonishment. But, you also might be counting on that ordering in how you use it, I don't know.
(defn alter-phrase
[the-phrase]
(let [r (wrand [3 1 2])]
(case r
0 ((lc/interval (rand-melody-pitch-step)) the-phrase)
1 (sort-by :time (lc/crab the-phrase))
2 ((lc/interval (rand-melody-pitch-step)) (lc/mirror the-phrase))
)))
from leipzig.
That case does imply crab should be sorting. The way play works assumes
time is ordered, so crab currently returns technically invalid melodies.
Also, sorting ruins laziness, so keeping it out of canon allows infinite
canon.
I think I'm convinced sorting is best done on the transformation itself
i.e. crab.
On Jun 10, 2013 8:23 PM, "Roger Allen" [email protected] wrote:
I have a function here:
https://github.com/rogerallen/explore_overtone/blob/master/src/explore_overtone/song_algorithm.clj#L143that takes a phrase as input, randomly alters the phrase and returns it.
It is much like what you do with canon, but a replacement, rather than
appending. I'm just "noodling" around, so take this as just one datapoint
on how some J Random User might use Leipzig. Always returning time sorted
phrases might be in line with the principle of least astonishment. But,
you also might be counting on that ordering in how you use it, I don't know.(defn alter-phrase
[the-phrase](let [r %28wrand [3 1 2]%29]
%28case r
0 %28%28lc/interval %28rand-melody-pitch-step%29%29 the-phrase%29
1 %28sort-by :time %28lc/crab the-phrase%29%29
2 %28%28lc/interval %28rand-melody-pitch-step%29%29 %28lc/mirror the-phrase%29%29
%29))—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-19213620
.
from leipzig.
I've pushed the call to sort-by
back up into crab.
from leipzig.
Related Issues (12)
- Full stop HOT 5
- Windows 64bit and overtone.live HOT 6
- Handle intro snippet in "negative" time on jam loops HOT 3
- Duration messes up when the last note finishes before another
- Support CLJS HOT 5
- [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
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.