Skip to Content

track outputs != main outputs

26 replies [Last post]
Thorgal
Offline
Joined: 04/17/2010

Hey!

I just noticed something : what comes out the track outputs sounds different from what comes out the main outputs.

Say you make a very simple pattern, e.g. using a ride sample regularly placed in the pattern, close enough in time so that the ride sample's tail overlaps with the next sample occurence when the pattern is played.

Listen to the result from the main hydrogen outputs, then listen again but from the ride track outputs directly (bypassing the main hydrogen outputs, you can redo the routing in e.g. qjackctl). There's definitely a big difference : when listening from the main outputs, you can hear that each sample occurence plays fully, meaning the sample's tail is not cut when the next occurence is played. This does not sound to be the case when listening directly from the track outputs, instead, it sounds rather staccato-like.

Why ?

EDIT: I am looking at the code right now and I can see that you don't apply the low pass resonance filter on the direct track outputs. I'll modify the code for myself and check that it's working fine. If anybody is interested, I'll post a patch.

EDIT2: I am not sure any longer it has anything to do with the issue described above ...

DrG
Offline
Joined: 04/17/2010

I've found another interesting thing with track outputs. They are pre-fader, which is a bit of a nuisance since I want to mix all my cymbals down to one stereo track in Ardour, but the only way I have to control the relative volume of each cymbal is to edit the gain for each layer of each instrument. I'm going to have a look at the code myself, if I find anything related to either of these issues I'll post back.

EDIT:

Now I've looked, the behaviour I described is intentional. I can understand why this is, but personally I don't like it. The way I see it is the faders in the Hydrogen mixer are my input faders when I'm recording into Ardour. It's just easier that way. Fixing it to work the way I wanted was pretty trivial though - that's the huge benefit of open source I guess! If anyone's interested I can post a patch.

Thorgal, I am getting the same behaviour as you. It's very odd but you're definitely right. Let me know if you find anything, and I'll do the same.

EDIT EDIT:

I know why it is.

Look in render_note_no_resample in sampler.cpp:
// to main mix
__main_out_L[nBufferPos] += fVal_L;
__main_out_R[nBufferPos] += fVal_R;

Now look at where it's sent to track outputs (this has my hack to make them post fader, but the argument still holds)

float* track_out_L = ( ( JackOutput* )__audio_output )->getTrackOut_L( nInstrument );
float* track_out_R = ( ( JackOutput* )__audio_output )->getTrackOut_R( nInstrument );
assert( track_out_L );
assert( track_out_R );
// Note: LPF is NOT applied here, but fader and pan are!
track_out_L[nBufferPos] = pSample_data_L[ nSamplePos ] * cost_track_L * fADSRValue;
track_out_R[nBufferPos] = pSample_data_R[ nSamplePos ] * cost_track_R * fADSRValue;

i.e. the master out is a global variable to which the current audio is added; the track outputs are initialised every time a new buffer is filled, hence you won't get the overlap of samples you get on the master out.

I don't know how to fix it yet... but we can work together....

Thorgal
Offline
Joined: 04/17/2010

Hey! thanks for looking into this as well! I came to the same conclusion last night after some wandering inside the C++ guts (by the way, I use snavigator for that, not too bad).

It will require some rework to achieve what we want ... damnit, I have little time for coding anything ... but let's see, if I have anything, I will post back. Yeah, that's the open-source spirit I guess ;)

Thorgal
Offline
Joined: 04/17/2010

DrG, your patch (post-fader track outputs) should be expanded into an option with a toggle button either on the mixer or in the preference dialog next to the "enable track output" option. WHat do you think ?

DrG
Offline
Joined: 04/17/2010

Yes I agree.

Trouble is I'm not really a C++ programmer, but I do know how to hack.... :-)

If I can work it out I can do it.

On the track outputs front, I've got a hack that works the way we think it should. Well I say works... it segfaults every other time I run it, and I'm getting some memory corruption somehow but the good news is that it no longer cuts the samples off (when it works, that is). So proof of ocncept anyway. (On the downside it has increased CPU usage a bit). No doubt it's down to some lack of understanding of something on my part, C++ never did make much sense to me... I'm off to do some googling...

Thorgal
Offline
Joined: 04/17/2010

It's really cool you are spending some time on that. I wish I could help but I am too pressed. So I built up a quick alternative for my drumming : I was fiddling around the soft called Addictive Drums (by XLN Audio). It runs fine as a VSTi using the dssi-vst host. I then use it inside rosegarden as a soft synth plugin where you can do a lot of MIDI editing. I import patterns from AD and reedit them quickly to my taste. The drumkits in AD are really cool! and you have tons of settings to play with (positioning of mics, compression, room reverb, etc). The time it takes to get the hang of it is way smaller than extending hydrogen with the capabilities we want. That sucks a bit but I don't have that precious time. The setup I just described works really nice!

DrG
Offline
Joined: 04/17/2010

That's good you've found an alternative. I've got a patch for Hydrogen if you want to try it. It's a bit hacky, but to be honest it was hacky before I started (it even said so in a comment in the code!) I've just used it to record my drum patterns into Ardour using the track outputs and I can't hear a difference between that and the main outputs any more.

It also allows the track outs to be either pre- or post-fader (via an option on the Preferences tab) - post fader track outputs have instrument gain, layer gain, LPF, ADSR, and fader settings applied. Pre-fader outputs work as before (ADSR and layer gain only). Both types will now not chop the tails off the samples.

I'm not sure how best to post the patch. I think I'll have to gzip it and put a download page up somewhere. If you're interested, give me a shout.

EDIT:

Patch (against 0.9.4 SVN 85) is here:
http://homepage.ntlworld.com/fatgerman/Hydrogen/DrGPatch.html

Thorgal
Offline
Joined: 04/17/2010

Great! I will look at it soon and try it out. Thanks for your effort on this! :)

Update: it seems to run as expected, so far so good! great job :)

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

Cool patch :-) thank you.
I will apply the changes to the strato_add version.

Wolke

DrG
Offline
Joined: 04/17/2010

Great! Glad to be of assistance. I think we must both be at a similar stage with our projects and thinking in a similar way to have found the same problem at the same time.. :) I was fortunate - this was my week off so I had time to fix it. I'm happy I could share it.

It's got me started now too.. I might be doing some more work on it, there are a few more features I'd like.. :)

EDIT: Wolke, that's another amazing coincidence... I was just looking at merging your patches into mine :) I guess only one of us needs to do it and if you've already started..... :)

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

I think for the momment it is easier when I built in your patch in my project. But I am not a real programmer. Maybe you can still improve my work. There are some ugly things. Especially in the Jack Time Master programming. I would be very happy with a professional editing.This is my first experience with programming.
And I know nothing about the shallow of c + + programming language.

Greetings Wolke

edit: 03/24/2008

Now your patch is included in the strato_add version.
Super it works perfect.
You can download it now from my website.

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

I have fix the crashes "metronome on, preview in SoundLibrary and dragdrop event" if jack audioengin is running.

i can not make a patch.
my hydrogen version is to different.

add this in:
========================
hydrogen.cpp //place this in the end of hydrogen.cpp

#ifdef JACK_SUPPORT
void Hydrogen::renameJackPorts()
{
audioEngine_renameJackPorts();
}
#endif
========================
hydrogen.h // in public place this

void renameJackPorts();

=====================================
PatternEditorInstrumentList.cpp // place line 587

586 pEngine->getSong()->get_instrument_list()->add( pNewInstrument );
+587 #ifdef JACK_SUPPORT
+588 pEngine->renameJackPorts();
+589 #endif
590 AudioEngine::get_instance()->unlock();
====================================
sampler.cpp // with the DrG patch

+385 //wolke this makes preview possible
+386 if (nInstrument < 0 ) nInstrument = 0;
+387 //wolke end
388 assert( __track_out_L[ nInstrument ] );
389 assert( __track_out_R[ nInstrument ] );

+550 //wolke this makes preview possible
+551 if (nInstrument < 0 ) nInstrument = 0;
+552 //wolke end
553 assert( __track_out_L[ nInstrument ] );
554 assert( __track_out_R[ nInstrument ] );

======================================

Now jack knows the new instruments.

Greetings Wolke

edit:
In PatternEditorInstrumentList.cpp insert at line 587 in original source.

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

I have made a patch for hydrogen 0.9.4 svn85
there are 3 more changes in the patch.

wolke

Thorgal
Offline
Joined: 04/17/2010

I will test this. By the way, I haven't tested DrG's patch thoroughly, I just made sure that things sounded as expected but did not push HG very much. As I said, I found a very promising alternative, as can be seen in the following picture :

[img]http://img296.imageshack.us/img296/6590/adrosegardenonlinuxhk7.jpg[/img]

josander
Offline
Joined: 04/17/2010

Hi,

some of this changes are absolutely generally very usable so I'll thank you for that! :-)

But will this changes go in to Hydrogen's trunk or is it Strato only? I 've used Hydrogen's svn for a long time now, and it seems to me that the trunk version and Strato version differs more and more and the song file is already altered (?). All this can be a mess.

So Comix, Thorgal, DrG and wolke: do you speak with each other, making it safe for freeriders like me to enjoy the fantastic Hydrogen drum sequencer with (possible some of the) improvements? :-)

Jostein

Thorgal
Offline
Joined: 04/17/2010

Hi Josander,

I fully understand your concern. Let me briefly summarize what happened :

1- I provided here a small bug fix to the SVN version (not merged, I am not an official dev), namely a correction for the right track output (was sent to the left output so no audio could be heard on the right channel)

2- I realized that track outputs were not treated the same way as the main outputs : samples were cut off when a new sample occurence had to be played along even within the same pattern. At the same time, DrG and I noticed that track outputs were pre-fader. DrG had time to provide a patch to fix the cutting off of the samples but also an enhancement, i.e. a new option for choosing whether track outputs shall be pre or post-fader .

3- Wolke had independent contributions that were enhancements together with a few bug fixes.

So as you can see, it's a mess : a mixture of bug fixes and enhancements. So I suggest bug fixes and enhancements are separated in two different set of patches. The ideal would be that bug fixes were merged to the SVN repos by an official dev. Enhancements could either be introduced in a SVN dev branch or discussed further with the main hydrogen code contributors (comix, etc).

In all this, I cannot do much myself due to very tight time schedules but I will keep an eye on this thread if further development occurs.

I hope my suggestions can help.

Happy drumming!
T.

josander
Offline
Joined: 04/17/2010

You are right. Enhancements from "the outside" have a tendency to mess with future or existing plans related to the current source code.

That said: I'm using the Strato version and enjoys better stability of my system.

Big thanks to all of you for your work and efforts :-)

Jostein

DrG
Offline
Joined: 04/17/2010

It's a tricky one. I'm getting no response on the Hydrogen-Dev list to anything I send to it. None of the developers appear to read this forum any more either. I agree that it's becoming a mess, but it needs one of the main developers to step in to stop it becoming so. Development on this project has apparently been getting slower and slower over the past few months anyway, and I'm starting to think it's just stopped.

If Comix or one of the main developers would just post here or contact one of us, I for one would be happy to discuss my mods with them and even do the appropriate submissions myself.

mauser
Offline
Joined: 03/30/2010

Hi,

as a result of the slow development i joined the development team this week.
I'm trying to apply the patches (bug fixes) on the mailing list first, but my time is very limited at the moment.. Furthermore i suppose that there are no active (core-)developers beside comix.

But i definitely want to avoid forks, so we have to think about how (and when) we could integrate your features. First of all it would help a lot if you could seperate bugfixes/enhancements (as thorgal already said in his great post).
If you report bug(fixes) to the mailing list, you should add a (detailed) description of the bug.. That makes it easier for us to apply the patch.
I can't say anything about the release plan (i simply don't know about it yet) so i can't say which features could be integrated..

mauser
Offline
Joined: 03/30/2010

@thorgal: 1) (the output-bug) should be fixed in svn since yesterday..

josander
Offline
Joined: 04/17/2010

nice, everything seem end to the very best for both users and developers of Hydrogen. :-)

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

Hello,
I am not interested to trigger a fork of the project.
Sorry if this disagreement occurred.
The strato version is only for the needs of my band.
Possibly it was wrong, the version here to disposal. (Link to my website)
Your work (hydrogen) is a great project. And I am very happy to use Hydrogen over 5 years.

Many thanks to comix and all the other developers!!

Moreover, I would be happy if I give you a little help at work.
But I do not know how. I am not a developer and have real problems with English.
Nevertheless, I would like to help.

Greetings wolke

DrG
Offline
Joined: 04/17/2010

Marvellous. I think we're all agreement - we don't want to have forks, that's not a good situation. I think it's come about because some of us have made changes which other had shown an interest in, and we had no way of getting these changes back into svn. Thanks for the post, it clears up a few worries. I will work out how best to post my changes to hydrogen-devel.

Thorgal
Offline
Joined: 04/17/2010

Hey! some action :)
@mauser : great you joined the dev team. How did you do that ? did you get in touch with comix ?

@all : the development link is alive again from the main website (Track system). I guess ppl can start using it if access is not too restricted.

mauser
Offline
Joined: 03/30/2010

Hey,

@wolke: Thanks for your help! You could contact me (mauser@smoors.de) and we can speak german.. And of course, a private fork is not a problem :)

@thorgal: i wrote a mail to comix and offered my help.

The Trac installation appears to be a little bit unstable, sometimes you get errors (they disappear after reloading the page). It seems that users have no right to edit the pages and the bugtracker. Don't ask me why, but i'll ask comix about that..
Once we have a working (and up-to-date) bugtracker, people could collect bugs and enhancements there. There is a bugtracker at the SF-project Page, but i think it would be nice if the trac-environment gets usable..

schivmeister
Offline
Joined: 04/17/2010

wohooo finally post-fader! looking forward =P

yervah
Offline
Joined: 04/17/2010

hey, if you have the latest version of dssi-vst-host, it's set to so that all linux apps using ladspa plugins will also see any vst plugins also.

This is from the download site:

File Release Notes and Changelog

Release Name: 0.7

Notes:
dssi-vst is a DSSI and LADSPA plugin wrapper for VST effects and instruments with GUI support. This is the 0.7 release.

Changes:
* dssi-vst now exposes a LADSPA descriptor as well as a DSSI
descriptor, and the install target now installs dssi-vst to the
system LADSPA directory as well as the DSSI one. This change
permits you to use dssi-vst to load VST effects in LADSPA hosts,
as well as to load VST effects and instruments in DSSI hosts as
before. When used in a LADSPA host, the VST GUI will not be
shown unless the host supports DSSI-style GUIs for LADSPA
plugins as well -- which most do not.