Skip to Content

Recording multiple patterns

80 replies [Last post]
wolke
wolke's picture
Offline
Joined: 03/30/2010

hi again.
i have an good idea for the delete and record function.
generally you define how many ticks into future from the current position the notes will deleted. e.g 49 ticks 1/4 beat. so into every instrument you record a new note the notes in front of the new will deleted. important for each instrument separately. than it's not so dangerous to damage the whole pattern.
i know the important code places. so i can try to implement this.

pablomme
Offline
Joined: 04/17/2010

The problem is that if you don't record anything, nothing is deleted, no?

wolke
wolke's picture
Offline
Joined: 03/30/2010

>The problem is that if you don't record anything, nothing is deleted, no?
hmm yes!
but now i have written such a function.
now you can choose between 1/64 - 1/1 beat length pre delete. this means, you delete all notes from your current position with the given length. near pattern end this delete only the rest of current pattern.
there a 2 modi 1 delete only prenotes from current instrument you played, modi 2 delete pre notes from all instruments if you play an instrument.
this function you can activate with using the entry's witch end with fp (full pattern) in config combobox.
for the moment you have to configure this in preferences general configure tab. this is not so nice. because h2 always restart the audio driver if you press the ok button to accept the config dialog.
anyway the function itself works fine here.
this will be changed in next time.
also i plan to implement a clear whole pattern button. so it's faster to erase pattern content. maybe no button only a keyboard shortcut do the same work. i am unsure.

at working on the pre delete function i found a generally record problem.
the bug also occurs in h2 trunk.
1. set beat length > 8
2. activate quantize ( only to hit exactly the beats not relevant for this bug)
3. try to record a note exactly at bar 5!
the note will record at bar 1. int column in add realtime note is just for this one position = 0. i test this with different patternsize always bar 5 is 0.
imo, something goes wrong with % and lookahead and columns into the add realtime note function. but i am not really sure.

ok blahblah :) test rev 785

pablomme
Offline
Joined: 04/17/2010

>>The problem is that if you don't record anything, nothing is deleted, no?
>hmm yes! but now i have written such a function. now you can choose between 1/64 - 1/1 beat length pre delete. this means, you delete all notes from your current position with the given length. near pattern end this delete only the rest of current pattern.

I think this wouldn't be very useful. Suppose that you play something and you hit one note too early. When you record on top and play it correctly, the early note will still be there, because you are deleting notes that come after what you're recording, but not before! Plus having to choose a pre-delete length sounds complicated from a user perspective.

I made my destructive-record mode work (or so it seems); see the attached patch, which applies on top of r783. To toggle between destructive/non-destructive mode, right-click on the record button.

With a punch-in feature this should provide the functionality I'm looking for. And if one can select individual instruments to be recorded/erased, it should also work more or less like you intend, if I understand your point correctly.

> at working on the pre delete function i found a generally record problem. the bug also occurs in h2 trunk. 1. set beat length > 8 2. activate quantize ( only to hit exactly the beats not relevant for this bug) 3. try to record a note exactly at bar 5!

I haven't tried this, but it looks like this needs fixing!

wolke
wolke's picture
Offline
Joined: 03/30/2010

>I think this wouldn't be very useful. Suppose that you play something and you hit one note too early. When you record on top and play it correctly, the early note will still be there, because you are deleting notes that come after what you're recording, but not before! Plus having to choose a pre-delete length sounds complicated from a user perspective.

i plan to add an post delete time. post means the time diff. from current trigger time. so you also erase notes they are to early on time line. than you can create a zone around the current played note witch will delete.

in moment it's a bit complex to test your patch because today i have work on flac file support for my sample editor. so i don't want to revert my svn. there are a lot changed files since last commit. i hope next days i found time to test you patch.

wolke
wolke's picture
Offline
Joined: 03/30/2010

lol :-)) the pacman button is great!! if i test the first time my function on work i think its looks like a pacman game.

yehhhh your function works fine. its nearly the same like my function with setting "1/1 fp". think if i implement my "post delete time setting" you have really the same function. and of course is really true. maybe my function is a bit ambiguous. but i always think h2 is an really easy to use application e.g. like xine. so you can use a beginner modus and do more easy manipulation but also if you need its possible to do more powerful detailed manipulations.

i think, it would be cool to mix our 2 implementations. toggle the function on/off will do with your great left click mutant pacman button. and default setting is 1/1 fp with post delete all notes before current position (currently not in svn) . that's really the same like in your function.
what do you think.

edit:
oh; ok i found out an biger difference. your function delete always one time on first trigger into the pattern. ok this is really important to prevent damage in a similar fp mode.
my idea: 2,5multi-mode .
1. default your mode. the first hit in pattern will delete the complete pattern
2. my non fp mode with post delete time for e.g single instrument recording.
2,5 my fp mode without post delete time to prevent damage on the new recorded notes.

edit:
try svn 788. i merge them to one function.

if you activate destructive mode, two combo boxes pop up in pattern editor panel. default is [once fp] [ off ] that mean one hit in full pattern mode. this is similar to your function and default. in 1. combobox you can choose between 8 fp (full pattern) and 9 only just played instrument time settings the last one is called "once" and means, delete only on the first trigger the full pattern. the 2. combobox is only relevant in just played instrument mode. this is the time behind the current recording position (post delete).

wolke

pablomme
Offline
Joined: 04/17/2010

>lol :-)) the pacman button is great!! if i test the first time my function on work i think its looks like a pacman game.

Heheh.. Well, it's clear what it means, it eats your notes!

>your function delete always one time on first trigger into the pattern. ok this is really important to prevent damage in a similar fp mode.

I don't understand, could you explain a bit more? My function tries to delete notes just before they are sent to the play buffer, so it should catch just the notes being played between the present and nframes frames into the future. Did I miss something important?

On my side, I've just managed to implement punch in/punch out on my destructive-record method. I'll have a look at r788 and see if I can make it work with that.

wolke
wolke's picture
Offline
Joined: 03/30/2010

>On my side, I've just managed to implement punch in/punch out on my destructive-record method. I'll have a look at r788 and see if I can make it work with that.

cool, i make a small change in rev 789. 2. combobox is only visible if this settings needed

>I don't understand, could you explain a bit more? Did I miss something important?

hmm, i think on this -> m_bJustRecorded.

i think you only delete if this is false. if true no more delete action.
i hope i am right. because i won't rewrite the function :-).

pablomme
Offline
Joined: 04/17/2010

Ok, looking at the diffs my changes are not doing what I intended, since you have moved the deletion loop from audioEngine_updateNoteQueue to addRealtimeNote.

The difference between your method and mine is that yours deletes around new notes, while mine deletes anything that is going to played back independently of what you record --even if you don't record anything. That's why my loop should be in audioEngine_updateNoteQueue and yours in addRealtimeNote.

The reason why there is a note->m_bJustRecorded is that some of the notes you record get deleted immediately, so the program needs to flag new notes momentarily to make sure they are kept. The flags are then reset when the audio engine restarts, so the notes don't count as new any more and are deleted if you do another destructive recording on top.

Now I realise that this is not very clever for pattern-record mode, because when you loop the notes will still be flagged as new, I should also reset the flag once the note is played back.

What I'll do is move my loop back to where it was, then add the punch in/out functions and try to make them work with your method too.

Regarding controls, I think we don't want comboboxes popping out - instead, everything should be in the context menu of the record button. Also, there should be only one length setting for your mode: the full length of the interval, instead of the lengths of the forward and backward intervals separately.

wolke
wolke's picture
Offline
Joined: 03/30/2010

hi ho, now i understand the different.

2 things i don't like so much and we can do better.
1.if you have activated the destructive mode in audioEngine_updateNoteQueue all notes will deleted indifferent what happened. in song mode its really critcal because you can damage more than only one pattern.
2. audioEngine_updateNoteQueue is, if sequencer is playing all the time busy.
so we lost performance respectively process time.

my idea is if you have activated the destructive mode its better that notes only will deleted if we play into this pattern. so you can use this without a punch in / out function in song mode, and you don't overwrite respectively delete all pattern if you doun't play.

we can mute the all notes with m_bJustRecorded = false into the current pattern if destructive mode and record is on. and only if yozu start playing the nots will deleted. that what my function do in moment.

i know the place in sampler .cpp its only one line code more into an existing function for the mute group feature.
what dou you think?

pablomme
Offline
Joined: 04/17/2010

> if you have activated the destructive mode in audioEngine_updateNoteQueue all notes will deleted indifferent what happened. in song mode its really critcal because you can damage more than only one pattern.

But that is the intention. You want a safety net to avoid losing data, but that should be provided by an undo function, not by restricting useful functionality of the destructive record mechanism.

> audioEngine_updateNoteQueue is, if sequencer is playing all the time busy. so we lost performance respectively process time.

The deletion loop is of the same size as the note-queueing loop, and each iteration is much lighter (especially if you turn on humanize, for example, because you have to generate a normally-distributed random number each time!). Plus each removed note removes weight from the note-queuing loop. I don't think this would affect performance in any measurable way.

> my idea is if you have activated the destructive mode its better that notes only will deleted if we play into this pattern. so you can use this without a punch in / out function in song mode, and you don't overwrite respectively delete all pattern if you doun't play.

I'll send you the punch in/out patch in a little while, then you can let me know if you find this is still a concern.

pablomme
Offline
Joined: 04/17/2010

Ok, here is the punch-in/out patch on top of r789. I've restored my destructive-record method, which now corresponds to the first option in the predelete combobox (it shouldn't go there at all, and the options should be rearranged entirely; this is just temporary), and prevented the two methods from interfering with each other.

To select the punch-in/out region, right-click and drag on the time ruler in the song editor (same as for setting note lengths). To deselect, simply right-click anywhere on the time ruler (without dragging). Whole patterns are selected, which doesn't give all the flexibility that one could possible have, but it's quite useful nonetheless.

I've tried it and it works well. You can play along to the song outside of the punch region, and notes are recorded inside it only.

BTW, I'm not sure what you use m_bJustRecorded for in your method?

wolke
wolke's picture
Offline
Joined: 03/30/2010

great :-D. this really works like a dream. and you right. no performance problem in audioEngine_updateNoteQueue . so for the first time its a really good recording enhancement. maybe in next weeks we found out what is really useful and what is more or less redundant.

tank you for this really productive co-operation. i hope that some other people find this function also so useful. and maybe this can move to hydrogen 0.9.5.
for the moment no function from this branch can move to actually 0.9.4 trunk version. since beta3, h2 0.9.4 is not so far from rc1.

your patch is commited in rev 791

wolke
wolke's picture
Offline
Joined: 03/30/2010

hm, i found out that my modes won't work correctly anymore.
i try to fix this.
do you change somthing with m_bJustRecorded?

on rec: once
delete nothing anymore.
if its work it have to delete all non m_bJustRecorded notes from pattern begin to the patttern end. but only for the just triggered instrument.

edit:
sorry, forget this. i fond the error. it was mine.

pablomme
Offline
Joined: 04/17/2010

Hey, thanks! When I have a bit of time I'll try to record a full song and see if there are any usability glitches in real life.

One annoying bug I'm getting is that sometimes when I open hydrogen it segfaults as soon as I trigger the hi-hat pedal. Then I retry a few times and eventually it works flawlessly.. odd!

Another bug (in my code) is that sometimes some old notes are left without deleting them. I must have made a very silly mistake somewhere..

Anyway, I'll let you know if I find something interesting.

wolke
wolke's picture
Offline
Joined: 03/30/2010

hmm, think the bug is known. and also crash the trunk version. but if you can reproduce this bug, it can be useful for us to know the procedure. in moment there is a long mail tread in devel mailing list over a startup bug with jackdmp and midi. i can't follow them because i don't use jackdmp und have only occasional a startup crash ( 1 of 100 or less) witch i can not reproduce.

pablomme
Offline
Joined: 04/17/2010

> there is a long mail tread in devel mailing list over a startup bug with jackdmp and midi.

Usually I use the ALSA driver, though. Do you think it's the same bug?

MySaviour
Offline
Joined: 04/17/2010

Hi, I'm using "new_fx_rack_and_sample_fun" which I installed sometime last year. Now I would really need it, and everything works just fine, except exporting songs. Hydrogen just shuts when I'm pressing the export button. Is this some known bug or is there something wrong in just my program?

wolke
wolke's picture
Offline
Joined: 03/30/2010

please install the latest trunk version or better the undo branch version.
we have fix some bigger bugs on the export function since last year.
also we have improve the export function. its possible to export tracks and also to export flac and ogg files.

MySaviour
Offline
Joined: 04/17/2010

Is there some instructions how to do this? I don't even know how I installed the branch in the first place :) Just followed the code I guess..

wolke
wolke's picture
Offline
Joined: 03/30/2010

1. svn co http://svn.assembla.com/svn/hydrogen/branche/midi-clock to-your-folder

2. cd to-your-folder
3. sh make_helper make
4. cd build
5. sudo make install

you need cmake instead of scons.

edit 1.30.2011:
you get an error message if you try to execute "sh make_helper make" instead type:

./make_helper m

aka
Offline
Joined: 04/17/2010

... but how to get it?

I urgendly need a possibilty to record whole songs.
I read your discussion here, and just understood half of the technical aspects. I`m musician not computerprogrammer.
Is there any way for me to reconstruct on my Mac what you guys did to get that songmoderecording-thing. Any "First-than"Plot? Could you pls write some?
Greetz from Germany,
aka

wolke
wolke's picture
Offline
Joined: 03/30/2010

linux only!
follow the instructions 1 -5 one post above your post :).

kitoo
Offline
Joined: 04/17/2010

I've been looking for this feature as well! I'd followed the instructions for installing the svn as indicated in this link: http://trac.assembla.com/hydrogen/wiki/development%3Aqt4compile

It seems that hydrogen requires libjack-dev wich in my ubuntu studio (maverick) installs the jackd1 package. Latest ubuntu studio uses jackd2 by default and I wonder if there's a way to compile hydrogen using libjack-jackd2-dev to support this version.

I see the installation instruction you propose in the early post is a bit different than the one in the link. What would be the most convenient way to do it, given my situation (I'm a newbie in compiling)?

This is a great feature!

Thanks!

wolke
wolke's picture
Offline
Joined: 03/30/2010

hmm, if you compile hydrogen from source it makes no difference if you have installed jack1 or jack2 packages.

kitoo
Offline
Joined: 04/17/2010

I tried it and it worked! Thanks! But this is not the case for building the debian package as indicated in the link from my previous message. Is there a work around for this? Having the deb file instead would make it easier to share it and install it in other computers.

I appreciate any help!

wolke
wolke's picture
Offline
Joined: 03/30/2010
kitoo
Offline
Joined: 04/17/2010

Yeah, that's the link I mentioned in my first post. The thing is that when I build the deb package, it is built with jackd1. So, how can I build the deb file using jackd2 instead?

When I compile hydrogen, it automatically detects I'm using jackd2, but this is not the case when building a deb package, and I don't know how to tell it to do so.

Thanks!

wolke
wolke's picture
Offline
Joined: 03/30/2010

ahhhohhh, :) sorry i misunderstand you.

into your h2 build directory go to linux/debian and edit control.
change libjack-dev against libjack-jackd2-dev and try again.

kitoo
Offline
Joined: 04/17/2010

It worked great! Thanks a lot!