developing a sample slicer plugin - Ninjas

All your LV2 and LADSPA goodness and more.

Moderators: MattKingUSA, khz

rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

developing a sample slicer plugin - Ninjas

Post by rghvdberg »

Hi all,

The last few months I've been developing a sample slicer plugin with the DPF framework.

Ninjas
Ninjas Is Not Just Another Slicer
https://github.com/rghvdberg/ninjas

It's still early work but should be just about usable.
Here's what it looks like
Image

Build instructions
Dependencies
  • libgl1-mesa-dev
  • libx11-dev
  • libsndfile1-dev
  • libsamplerate0-dev
  • libaubio-dev
If you want a standalone jack binary install either libjack-dev or libjack-jackd2-dev

Code: Select all

git clone --recursive https://github.com/rghvdberg/ninjas.git
cd ninjas
make
notice the clone --recursivepart to pull in the DPF framework.

There is no make install, binaries will appear in <source dir>ninjas/bin/, just copy the binaries to a appropiate location.

Usage
  • load Ninjas in a suitable host.
  • click Diskette drive
  • load audio sample
  • set slice mode using the slider
  • set number of slices using the Slices knob.
  • Sample slices will be mapped to C4 (midi note 60) and up
  • Change the pitch of slice with pitchbend
  • Each slice has it's own ADSR and playmode settings. Use the righthand Slice Selector to select the slice you want to edit
Of course there are bugs and missing features, please file them at github https://github.com/rghvdberg/ninjas/issues .
There's a dedicated Matrix room (#ninjas:matrix.org) for Ninjas which is a good place to keep check on commits, report bugs and ask questions.

I hope people will find this plugin useful.

Regards,

Rob
Frank Carvalho
Established Member
Posts: 363
Joined: Sat Nov 17, 2012 3:36 pm

Re: developing a sample slicer plugin - Ninjas

Post by Frank Carvalho »

I love the user interface :-)
Vox, Selmer, Yamaha and Leslie amplifiers. Rickenbacker, Epiphone, Ibanez, Washburn, Segovia, Yamaha and Fender guitars. Hammond, Moog, Roland, Korg, Yamaha, Crumar, Ensoniq and Mellotron keyboards. Xubuntu+KXStudio recording setup.
ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: developing a sample slicer plugin - Ninjas

Post by ssj71 »

congrats on your first pre-release! :D

p.s. I didn't realize the name was recursive. Double points for that!
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
User avatar
Michael Willis
Established Member
Posts: 1458
Joined: Mon Oct 03, 2016 3:27 pm
Location: Rocky Mountains, North America
Has thanked: 70 times
Been thanked: 166 times
Contact:

Re: developing a sample slicer plugin - Ninjas

Post by Michael Willis »

I have no idea what this even does, but I love the part of the UI that looks like a floppy drive. I'm pretty sure my kids have no idea what that even is.
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: developing a sample slicer plugin - Ninjas

Post by rghvdberg »

ssj71 wrote:congrats on your first pre-release! :D

p.s. I didn't realize the name was recursive. Double points for that!
Actually you suggested this name.
I had Ninyas : yet another slicer.
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: developing a sample slicer plugin - Ninjas

Post by rghvdberg »

Michael Willis wrote:I have no idea what this even does, but I love the part of the UI that looks like a floppy drive. I'm pretty sure my kids have no idea what that even is.
Took me 12+ hours to trace that floppy :-D

The plugin is meant to rearrange parts of an audio sample.
Say you got a drumloop of 1 measure, 4 beats.
You set the slicer knob to 4 and then you can play the beats with (midi) keys C4, C#4, D4 and D#4.

There are two forms of slicing.
Raw, slices the sample purely on arithmetic. Length / slices.
Onsets, tries to find the nearest start of a note or beat to the slice.
Let's say my sample is 100 long and I slice it up in 4 parts. Start of each slice 1, 25, 50 and 75.
The onset detection finds notes at 3, 20, 27, 54, 72 and 80
The slices will then start on 3, 27, 54 and 72.
The onset to slices mapping is a bit crude and needs more thought and work.

Each slice has his own adsr and playmode. You can change playmode on the fly. Fun with long samples.
Also midi pitchbend changes the pitch of the samples.
Come to think of it. With some clever automation in a DAW you could even use this to scratch...

The 4 x 4 button grid on the right you use to select the sample you wanna edit. Check how the adsr and playmode reset to each slices.

Hope this explains some more.
I'll make a demo video soon.
mendo
Established Member
Posts: 28
Joined: Sun Sep 04, 2016 9:28 pm

Re: developing a sample slicer plugin - Ninjas

Post by mendo »

This is really great.

Unfortunately, Ardour did not recognise it.

Code: Select all

[ERROR]: LV2: Failed to instantiate plugin https://github.com/rghvdberg/ninjas
In Qtractor, it says:

Code: Select all

lilv_lib_open(): error: Failed to open library.lv2/ninjas.lv2/ninjas_dsp.so (.lv2/ninjas.lv2/ninjas_dsp.so: Fehler beim Mappen des Shared Objects)
What could be the reason?
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: developing a sample slicer plugin - Ninjas

Post by rghvdberg »

mendo wrote:This is really great.

Unfortunately, Ardour did not recognise it.

Code: Select all

[ERROR]: LV2: Failed to instantiate plugin https://github.com/rghvdberg/ninjas
In Qtractor, it says:

Code: Select all

lilv_lib_open(): error: Failed to open library.lv2/ninjas.lv2/ninjas_dsp.so (.lv2/ninjas.lv2/ninjas_dsp.so: Fehler beim Mappen des Shared Objects)
What could be the reason?
I'll check. Thanks for the heads up.
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: developing a sample slicer plugin - Ninjas

Post by rghvdberg »

I can't reproduce the error mentioned above.
Could you post the output of

Code: Select all

ldd ninjas_dsp.so
TIA
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: developing a sample slicer plugin - Ninjas

Post by rghvdberg »

Another thing. Currently it won't run in Ardour. Crash as soon as you load a file.
Probably has to do with dynamic linking.
I'm a noob, so I have to figure out how to link statically.
This is not a problem in qtractor btw.

Found a second bug when slicing and setting all slices to loop forward. Gonna have to dig a bit in the code what's going wrong. Seems the loop points (slice start and end) aren't set up perfectly.
simonvanderveldt
Established Member
Posts: 37
Joined: Mon Sep 04, 2017 9:30 pm

Re: developing a sample slicer plugin - Ninjas

Post by simonvanderveldt »

rghvdberg wrote:Another thing. Currently it won't run in Ardour. Crash as soon as you load a file.
Probably has to do with dynamic linking.
I'm a noob, so I have to figure out how to link statically.
This is not a problem in qtractor btw.

Found a second bug when slicing and setting all slices to loop forward. Gonna have to dig a bit in the code what's going wrong. Seems the loop points (slice start and end) aren't set up perfectly.
Please at least keep the option to link dynamically. or preferably don't do static linking at all.
I'm guessing the issue is caused by a binary download (Ardour in this case)? Don't understand why projects keep building those instead of letting the distro's do it properly.
Last edited by simonvanderveldt on Tue Jan 02, 2018 5:40 pm, edited 1 time in total.
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: developing a sample slicer plugin - Ninjas

Post by rghvdberg »

aaahaaap wrote: Please at least keep the option to link dynamically. or preferable don't do static linking at all.
I'm guessing the issue is caused by a binary download (Ardour in this case)? Don't understand why projects keep building those instead of letting the distro's do it properly.
You guessed right :-)
First lemme learn how to link statically please :-)
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: developing a sample slicer plugin - Ninjas

Post by rghvdberg »

Update
  1. fixed the slicing / looping bug
  2. plugin is linked statically now BUT this only works on kxstudio :?
    I edited https://github.com/rghvdberg/ninjas/blo ... akefile.mk

    I replaced

    Code: Select all

     $(shell pkg-config --cflags --libs aubio)
    with

    Code: Select all

    $(shell PKG_CONFIG_PATH=/opt/kxstudio/lib/pkgconfig pkg-config --static --libs aubio)
    This requires the installation of 'aubio-static'
For now I'll keep it this way.

Next up is displaying the onsets detected by aubio in the lcd display.
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: developing a sample slicer plugin - Ninjas

Post by rghvdberg »

I think it's pretty usable at the moment. I'd like people to test it.
Comments welcome :-)

I've set up a github release page where you can download binaries and source.
https://github.com/rghvdberg/ninjas/rel ... re-release

The binaries are compiled on Ubuntu 16.04 with KXStudio repositories added.
You'll need libsamplerate and libsoundfile to run the plugin.

The tarballs contains:
  • ninjas (jack app)
  • ninjas.lv2
  • ninjas-vst.so
Copy the files to an appropriate location. Typically the ninjas.lv2 folder (as a whole) goes in ~/.lv2 and
ninjas-vst.so goes in ~/.vst. You can copy the ninjas binary to ~/bin.

Usage
  • load Ninjas in a suitable host or use the ninjas binary
  • click Diskette drive
  • load audio sample
    note : file handling is done by libsndfile, for all file formats supported by libsndfile refer to http://www.mega-nerd.com/libsndfile/#Features
  • set number of slices using the Slices knob
  • set slicing method using the slider
  • Raw: slices up the sample in equal parts
  • Onsets: snaps the slice start and end to the nearest detected onset
  • Sample slices will be mapped to C4 (midi note 60) and up
  • Change the pitch of a slice with pitchbend
  • Each slice has it's own ADSR and playmode settings. Use the righthand Slice Selector to select the slice you want to edit
Ninjas looks like this:
Image

Build instructions
Dependencies
  • libgl1-mesa-dev
  • libx11-dev
  • libsndfile1-dev
  • libsamplerate0-dev
If you want a standalone jack binary install either libjack-dev or libjack-jackd2-dev

Note : when you download the sources, you'll notice the dpf folder is empty.

Code: Select all

cd ninjas
git clone https://github.com/DISTRHO/DPF.git dpf
make
There is no make install, binaries will appear in ~ninjas/bin/, just copy the binaries to an appropriate location.
stanlea
Established Member
Posts: 700
Joined: Wed Apr 25, 2012 9:49 pm
Has thanked: 41 times
Been thanked: 23 times

Re: developing a sample slicer plugin - Ninjas

Post by stanlea »

Thanks
Post Reply