Re: [LAD] drumreplacer license

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Marc R.J. Brevoort <mrjb@...>
Cc: Linux Audio Developers <linux-audio-dev@...>
Date: Friday, June 1, 2012 - 3:28 pm

--485b397dd0ef648cc904c16ad568
Content-Type: text/plain; charset=ISO-8859-1

On 31 May 2012 03:41, Kaspar Bumke wrote:

> Hey,

On 31 May 2012 09:38, Marc R.J. Brevoort wrote:

> Hi Kaspar,

On 31 May 2012 14:43, Kaspar Bumke wrote:

> Hi Marc,

On 31 May 2012 22:21, Marc R.J. Brevoort wrote:

> Hi Kaspar,

I copied the whole conversation to LAD just because I like lurking on there
and reading technical discussions I don't fully understand. Hope that's all
right with you.

You'll also notice that it's JACK audio in, but rather than JACK MIDI out,

That's weird, because it appears as a Jack MIDI program/device in Jack
(qjackctl) which I noticed right away because my MIDI-USB devices appear
under ALSA and it is a (minor) annoyance to deal with the two different
MIDIs and get them to connect. Most things still seem to default to ALSA
these days for better or for worse (maybe someone from LAD could chime in
here with their wealth of knowledge--accurate to 1/1000 of a second it says
in your comments, is that still the case? is that bad?).

Some explanation on how things work - do with it as you please.

Thanks so much the explanation. I may hit you up with more questions as I
dive more into the code.

Kind Regards,

Kaspar

--485b397dd0ef648cc904c16ad568
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 31 May 2012 03:41, Kaspar Bumke <kaspar=
.bumke@gmail.com
> wrote:

Hey,Just
tested out drumreplacer. Seems to work well. I am going to go through=20
the code and see if I can use it as a basis for a more advanced=20
drumreplacer. For now I was just making an Arch Linux AUR=20
package and was wondering about the license (have to put it in the=20
package). Is it just public domain or did I miss something?
Regards,Kaspar
=A0

On 31 May 2012 09:38, Marc R.J. Brevoort <m=
rjb@dnd.utwente.nl
> wrote:

Hi Kaspar,

Just tested out drumreplacer. Seems to work well. I am going to go through<=
br>
the code and see if I can use it as a basis for a more advanced
drumreplacer.

At present it's pretty basic. It does peak detection by looking if a=20
wave goes over its treshold level, then (if I remember correctly)
starts a counter to see how long it takes to get to another treshold
level to extract MIDI velocity. In other words, at the moment it works
entirely in the amplitude domain. This works pretty well for multi-track
recordings, but for existing stereo tracks, doing the work in the=20
frequency domain might work better.

For now I was just making an Arch Linux AUR package and was wondering about=

the license (have to put it in the package). Is it just public domain or di=
d
I miss something?

I usually think of my packages as GPL'ish, but granted, in this case I=
=20
probably forgot explicitly mentioning a licensing scheme, which means
at the moment it's officially under copyright law. Obviously far more
restrictive than I intended.

I have a slant towards GPL as this will help guaruantee that the
source code is going to remain accessible to the public to tinker with.
So as far as I'm concerned you can release it as GPL and keep this
email as evidence that I've given you written permission to do that.
Adding the generic LICENSE.txt file to the package should suffice.

Good luck. If you need any help explaining the code let me know. I'll d=
o my best (though it's 3 years back by now!)

Best,
Marc

On 31 May 2012 14:43, Kaspar Bumke <ka=
spar.bumke@gmail.com
> wrote:

Hi Marc,
I have a slant towards GPL as this will help guaruantee that the
source code is going to remain accessible to the public to tinker with.
So as far as I'm concerned you can release it as GPL and keep this
email as evidence that I've given you written permission to do that.
Adding the generic LICENSE.txt file to the package should suffice.
Cool, I marked it as GPL which means=20
GPLv2 or later. Are you OK with that? Common licenses are available by=20
default so they don't need to be in the package. I n=
eeded to add a stdlib.h include to=A0 src/lib/convertlib.h to make it compi=
le with gcc 4.7 by the way.
=A0Good luck. If you =
need any help explaining the code let me know. I'll do my best (though =
it's 3 years back by now!)

=A0
I have started looking through the code. The FLTK stuff is a bit=20
confusing to me so I think I will start out by trying to extract the=20
Jack process and plugging that into the simple command line jack client.
I want to make an OSC controlled back-end seperate from the GUI so that
one day maybe I could put it in an embedded system to make an open=20
source drum brain! I can see that you started out with a frontend and=20
backend directories but looks like you ended putting everything in the=20
frontend.
At present it's p=
retty basic. It does peak detection by looking if a=20
wave goes over its treshold level, then (if I remember correctly)
starts a counter to see how long it takes to get to another treshold
level to extract MIDI velocity. In other words, at the moment it works
entirely in the amplitude domain. This works pretty well for multi-track
recordings, but for existing stereo tracks, doing the work in the=20
frequency domain might work better.Ah=20
OK, cool.=A0 I am really glad I found your project as this is a basic=20
enough example for me to start understanding just how to simply get=20
audio in and MIDI out, once I have that down I will look at the signal=20
processing in more detail, do FFTs etc and maybe a neural network.. haha
who knows. You wouldn't happen to have any recommended reading on the=
=20
theory behind drum replacement techniques? Any tips on what you changed=20
from 0.1 to 0.2 that made that crucial difference in performance?
Kind Regards,Kaspar

=A0

On 31 May 2012 22:21, Marc R.J. Brevoort=
<mrjb@dnd.utwente.nl> wrote:

Hi Kaspar,

Cool, I marked it as GPL which means GPLv2 or later. Are you OK with that?<=
br>

Absolutely.

I needed to add a stdlib.h include to=A0 src/lib/convertlib.h to make it
compile with gcc 4.7 by the way.

I guess it's already starting to show its age a bit ;)

I have started looking through the code. The FLTK stuff is a bit confusing<=
br>
to me so I think I will start out by trying to extract the Jack process and=

plugging that into the simple command line jack client. I want to make an
OSC controlled back-end seperate from the GUI so that one day maybe I could=

put it in an embedded system to make an open source drum brain! I can see
that you started out with a frontend and backend directories but looks like=

you ended putting everything in the frontend.

Correct, I based the empty application on another one I did earlier but cou=
ldn't be bothered to do proper frontend-backend separation in its early=
stages. That's probably a mistake.

Ah OK, cool.=A0 I am really glad I found your project as this is a basic
enough example for me to start understanding just how to simply get audio i=
n
and MIDI out

You'll also notice that it's JACK audio in, but rather than JACK MI=
DI out, it's ALSA MIDI out instead. Reason is that when I wrote drumrep=
lacer, JACK MIDI was basically unsupported, even by JACK tools such as qjac=
kctl. Things probably have changed at least somewhat, three years down the =
line.

Some explanation on how things work - do with it as you please.

As you've noticed, most of the magic happens in UserInterface::jack_pro=
cess().

The peak scanning: As an input wave is being scanned faster than realtime, =
one can't simply send out MIDI at the moment a peak is detected. Peaks =
at the end of a wave snippet would be triggered too
quickly compared to peaks at the start of a wave snippet. Instead,
the output has to be scheduled so that the latency between wave
peak and MIDI trigger remains constant. (This is why the MIDI triggering
is done through Fl::add_timeout() instead of just playing the note).

If I recall correctly, the previous, 1-track version of drumreplacer didn&#=
39;t schedule notes at all and therefore to keep beats steady,
it needed to use very small buffers and always had to triggered its
notes immediately. Obviously this would result in poor performance.

More about the note triggering: One thing to keep in mind is that Fl::add_t=
imeout() is really a user-interface function. The delay is
specified as milliseconds, but in reality it's not quite that
accurate. Ideally, instead of a user interface timeout one would use
a sample-accurate MIDI note scheduler.

User interface controls:

- Sens. is sensitivity, the level at which the note will trigger.
- Res, the resolution - how often a note is allowed to retrigger.
=A0Related to variable "retrig" in the code.
- Mid ch, note, are the MIDI channel and note number being output
=A0when the audio surpasses the treshold
- Min veloc and Max veloc are the minimum and maximum velocity settings at =
which the note is played. If a note only reaches treshold value, it will be=
played ad minimum velocity; if it reaches maximum value (+1 or -1 as float=
), it will be played at the maximum given velocity.

One clever bit is that when a note is scheduled for playback, the actual ve=
locity at which it will be played isn't known yet because that is only =
determined *after* the treshold level is reached.
The note playback is scheduled, and at that time the velocity value is set =
to "minimum velocity".

But meanwhile, before the MIDI is sent out, the wave scanning proceeds- and=
may update the velocity to the highest found peak, until either the
resolution knob timeout occurs (after which peak detection is reset) or unt=
il the MIDI note schedule demands the note to be played immediately, in whi=
ch case it will be played at the highest velocity found between triggering =
the note and the actual playback event.

Hope this helps!

Best,
MarcI copied the whole conversation to LAD just beca=
use I like lurking on there and reading technical discussions I don't f=
ully understand. Hope that's all right with you.

You'll also notice that it's JACK audio in, but rather than JACK MI=
DI=20
out, it's ALSA MIDI out instead. Reason is that when I wrote=20
drumreplacer, JACK MIDI was basically unsupported, even by JACK tools=20
such as qjackctl. Things probably have changed at least somewhat, three=20
years down the line.That's weird, because it =
appears as a Jack MIDI program/device in Jack (qjackctl) which I noticed ri=
ght away because my MIDI-USB devices appear under ALSA and it is a (minor) =
annoyance to deal with the two different MIDIs and get them to connect. Mos=
t things still seem to default to ALSA these days for better or for worse (=
maybe someone from LAD could chime in here with their wealth of knowledge--=
accurate to 1/1000 of a second it says in your comments, is that still the =
case? is that bad?).

Some explanation on h=
ow things work - do with it as you please.Thanks so mu=
ch the explanation. I may hit you up with more questions as I dive more int=
o the code.

Kind Regards,Kaspar

--485b397dd0ef648cc904c16ad568--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

This is the only confirmed message in this thread.