From: Comix <co...@gm...> - 2007-06-27 23:05:42
|
On 6/26/07, Jakob Lund <jl...@im...> wrote: > Dear Drumheads. HI Jakob > I wrote two small patches for Hydrogen previously. With a classical "scratch > your own itch" approach to development, I would like try fixing some of the > problems that I'm having using the program, but are not on the roadmap that > Alex laid out. Perhaps it seems like I'm taking my hands too full --- but > really, I don't think It's that bad, *and* if I could get it to work, it'd be > dead cool (H) > > I'll need some tips along the way though, and it would be nice to get feedback > before I start to write code! Here's what it's all about: > > My first interest in Hydrogen is the timing and synchronization with other > JACK apps --- Ardour is, of course, the first reference when it comes to > JACK, and another one I really want to use together with Hydrogen is > Freewheling ( a wierd / wonderful live looping application ). The first > patch I wrote for Hydrogen already made it possible to accept changes in tempo > and song position from the JACK transport system, and that seems to work o.k. > right now, at least with Ardour. > > Along the same line, I would like to try to enable Hydrogen to *send* these > messages to other JACK apps ( in JACK, an application can be either `slave' > or `timebase master'. Hydrogen acts as `slave' when the `Jack Transport' > button is active, and I would like to add a `master' option as well ) but > this is when I get into some problems that I think have to do with the > *fundamental design of the timeline* in Hydrogen, and, as far as I can tell, > the internal representation of this timeline will have to change > fundamentally, in order for me to succeed in adding the extra option... > > The problem is that Hydrogen doesn't really know the length of a `bar'... It > just knows the Patterns and PatternGroups. The latter are collections of > Patterns that start at the same time, and they are the columns in the "song > editor" part of the UI. If every pattern is 4 beats long, and the song is in > 4/4, it works great, and the PatternGroups are the barlines --- I'm guessing > this is what happens in 95% of the use cases. > > The trouble start when: > * Patterns of different length are inserted in the same PatternGroup. Then the > behaivour of the program seems a bit random... It doesn't crash or make ugly > noise, but some patterns are cut off, or silence is inserted, somehow. > * If there is a two-bar pattern in one PatternGroup, and a one-bar pattern in > the next, the two-bar pattern only takes up one `bar' in the UI, which, I > think, seems illogical and buggy... > > To remedy all this, I *just about* figured out a way of storing the starting > times of patterns in a song in a way that it's o.k. if patterns are not the > same length, and one pattern can start in the middle of another one playing. > AND the sequencer will know which notes / patterns to play at any given time. > > When I start messing with all this, the entire program will of course stop > working at first, and It'll have to be repaired everywhere where the timeline > information is accessed... What I fear the most is the parts of the program > that I *don't know* interact with the timeline. I foresee trouble in these > three places: > > 1. The UI, where patterns are inserted into the song > 2. The Sequencer, that plays each note from each pattern in the song and > 3. The file format writer and reader, that also need to know the song > structure!! > > I want to know if I missed any? I also wonder if anyone is up to attacking > this, or at least giving me some hints -- I guess there are plenty of other > things to do before the long-awaited 9.4 release!! > > I think that making the changes I suggest could make Hydrogen a more musical > program, and also make the code easier to maintain, and maybe even faster. I'm too sleepy (1:00 am) now to answer you :) You're right, hydrogen internals are a bit too restrictive about that and there's the need to introduce the concepts of tempo and bar lenght. Tomorrow I'll write more... Good night drummers! -- Alessandro <Comix> Cominu http://comix.hydrogen-music.org |