IoT 15: Make Jazz Beats with Linux

Last Updated on May 13, 2022

First Published on May 11, 2022

I made a tune of dance beats with Linux. In addition to this, I also made a tunes of jazz beats. In this post, I describe about the system on making jazz beats, especially the difference from making dance beats.



Saloon 0500


Recording Date: April 27 (Guitar Play) and 30, 2022. Composer, Programmer, Editor, and Guitar Player: Kenta Ishii. Copyright © 2022 Kenta Ishii. All Rights Reserved.


YouTube (Music Video in My Channel)


YouTube (Auto-generated Cannel)


SoundCloud


Apple Music


Spotify


Initially, I annotated on this tune as "Blues Beats", but I changed it to "Jazz Beats". Tones like a double bass with a bow fill with the space. I think it also has the taste of traditional Japanese music. I don't know this release becomes popular though, and the sound of a kick drum is very tight rather than house music. I could strengthen kick beats, but I need to make the headroom of the peak to add my guitar play. RMS = the sound power is apparently less than my previous release, "Fog in The Warm", because of bright tone (strong attack) of my guitar, Les Paul SL (Melody Maker). Note that I set the peak at -0.5dB to fit with the notation of SoundCloud. I used Audacity v2.4.2 to add silence, adjust the peak, and make a MP3 file. However, Audacity v3.0.0 or above seems to have several conflicts on developing, and make sure to check the story online.


Besides, how to make 8-bit blur with GIMP 2.10.24 for the track art. Pixelate, reduce color gradation, and smooth like AI for an old picture. Your memory used to become vivid, but blurred.


i. Resize Image to 341*256 (from 4000*3000)

ii. Color Balance: Shadows - Cyan-Red 25

iii. Saturation: Scale 2.5 and Interpolation Color Space Native

iv. Resize Image to 3996*3000 with Cubic Interpolation


I used Shotcut version 22.04.25 to make the music video. I made with 1080p (FHD). I also encoded this video with H.264 High Profile, and customized to higher quality (I remember 72%) on the codec than default at 55% (44100Hz sample rate and 386kb/s bitrate on the audio). This video has apparently better resolution on both still and dynamic than my previous music video.


-------------------------------------------------------------------


First of all, I'm using Ubuntu, a Linux distro, and I updated the version of Ubuntu from 20.04 LTS to 21.10 because of the temporary failure on Advanced Linux Sound Architecture (ALSA), and an available patch for 21.10 timely. I couldn't use 44100Hz sampling with my USB interface, UCA222, on the kernel having this issue. I'm standing on a user of Linux, but not an arm-strong developer. I can't say the detail of this issue. However, I think the issue occurred by updated code from the upstream (original) Linux kernel that may not be tested well. Distros of Linux used to update their own kernels while referring the upstream, and the process of updating may be automated even for the stable version. We would know the upstream isn't perfect, and need the careful process of updating the kernel of a distro.


* Kernel sources of Ubuntu can be installed via Git, and check the Wiki page. About developing the upstream, I don't have any opinion because I'm a user. Note that, in my opinion, members since the early 90's are making the upstream holding their own Linux culture. The time when main developers hand Linux, an alternative to the Unix family, to others may come, but the name, Linux, wouldn't be handed. I tried to make my one (there is no file system, so it's an software development kit, SDK) for Raspberry Pi, and I recognized making an operation system is a very tough work. Caution that your computer life only in front of a display in your room would cause no sense of real dimensional direction and distance even if you are accustomed to yoga practice. Anyway, the upstream is just a concept car in auto shows. They're leading the trend, but applying to a real system is relied on distro's manager.


# In Terminal, Check Kernel Version

uname -r


-------------------------------------------------------------------


Major differences on making between dance beats and jazz beats are MIDI sequencers and drum machines. Besides, QjackCtl has a major update on connecting ports. I used GTK Wave Cleaner to remove noise on clips that record my guitar play.


1. MIDI Sequencer

Through updating the version of Ubuntu, MusE seems to have a problem on connecting virtual MIDI ports on the system. I decided to use Qtractor. I build Qtractor from the source Note that I additionally installed packages, "libmad0" and "libmad0-dev" to build Qtractor (you would need other packages in your case). The saved data is with XML format, and you can edit the data directly to change track names, etc. Qtractor can set the status of JACK transportation (such as JACK Master) by a button drawing arrows on the upper right side next to the horrible face for the panic. Qtractor can add LV2 plugins to each tracks, and I added plugins to some tracks. MIDI notes and audio can be recorded after pressing the "R" button on a track and confirming the red circle on the upper side has been pressed, then click the blue arrow next to the red circle. You should initially name a track to manage well afterwards, particularly for MIDI and WAV files of recorded clips. MIDI tracks also can become the drum mode (note marks become diamond shaped marks with no length, and the piano roll displays percussion names on notes No. 35 to No. 81 instead of note names). MIDI clips can create without recording (right click an empty track > "Clip" > "New"). The MIDI clip can add notes (the pencil button > "Edit On").


# In Terminal, Check Package of Qtractor

apt show qtractor


2. Drum Machine

I used drumkv1 instead of Hydrogen. I used the standalone drumkv1, but not as a LV2 plugin with Carla because of an issue on loading a preset samples. The standalone drumkv1 doesn't have a selector for a MIDI channel, and I used a MIDI channel filter in Carla and received MIDI messages through Carla to the standalone drumkv1. The drumkv1 is a sampler, and I applied white and pink noise made of FFmpeg. To make a new preset, click the "New Preset" button on the upper left corner of the window, type a name on the text box, and click the "Save Preset" button next to the text box.



It's my wind sweep. Typical hand clap is the combination of 3 to 4 clips of clap sound, having different timing to start each clap a little, but I use a clip of single clap sound to emphasize the beat. The sound of a real kick drum has a little change of frequency that causes catchy sound, but I emphasize the tightness of the sound rather than hearing easily. I think this type of kick beats are used in jazz.


# In Terminal, Install Packages

sudo apt install drumkv1 drumkv1-lv2 ffmpeg

# Make Sine Wave with PCM Singed 16-bit Little Endian

cd ~/Desktop

mkdir samples

cd samples

ffmpeg -f lavfi -i "sine=frequency=220:sample_rate=44100:duration=1,volume=8" -c:a pcm_s16le sine_220.wav

ffmpeg -f lavfi -i "sine=frequency=110:sample_rate=44100:duration=1,volume=8" -c:a pcm_s16le sine_110.wav

ffmpeg -f lavfi -i "sine=frequency=55:sample_rate=44100:duration=1,volume=8" -c:a pcm_s16le sine_55.wav

# Make Noise

ffmpeg -f lavfi -i "anoisesrc=sample_rate=44100:amplitude=1.0:color=white:duration=1" -c:a pcm_s16le noise_white.wav

ffmpeg -f lavfi -i "anoisesrc=sample_rate=44100:amplitude=1.0:color=pink:duration=1" -c:a pcm_s16le noise_pink.wav

# Combine Sine and Noise

ffmpeg -i sine_220.wav -i noise_white.wav -filter_complex "amix=inputs=2:duration=first:dropout_transition=1:weights=2 1" snare.wav

ffmpeg -i sine_220.wav -i noise_pink.wav -filter_complex "amix=inputs=2:duration=first:dropout_transition=1:weights=1 2" handclap.wav


In addition, I created pink noise for 7 seconds to make wind sweep.


I also used FFmpeg to cut DC bias of recorded tracks.


# High-pass Filter to Cut DC Bias

cd ~/Desktop/tracks

for i in *.wav; do ffmpeg -i "$i" -af "highpass=f=20" -c:a pcm_s16le -y "filtered_$i"; done;

for i in filtered_*.wav; do mv "$i" "${i#filtered_}"; done;


3. QjackCtl


GUI for connecting ports in QjackCtl makes a major change.



I also show the connection in Carla.



# In Terminal, Check Package of QjackCtl

apt show qjackctl


4. GTK Wave Cleaner


The process to remove noise has been already described on the item No.9 of the IoT 13. You can change settings to remove noise ("Settings" > "Denoise"), but I don't change any setting to remove noise. Qtractor records audio as a WAV file, and it's good to apply this tool to recorded audio clips of Qtractor. Note that I select the region (1 to 2 seconds) for the sample of noise that my Les Paul SL (Melody Maker) is at full volume without string grounding by your palm before playing.


# In Terminal, Install Package

sudo apt install gwc


5. Others


For normalizing, I used another tool. Note that this tool can be used to adjust the peak of the track by using the "--peak" option.


# In Terminal, Install Package

sudo apt install normalize-audio

# Normalize

for i in *.wav; do normalize-audio --amplitude=-12dBFS --limiter=-6dBFS "$i"; done;


I installed Calf Studio Gear, LV2 plugins. Note that Carla that I build doesn't draw the dynamic graph in the GUI of Calf Equalizer 8 band or Calf Compressor, and this issue has been already known as a bug. Whereas, Qtractor draws the graph. Qtractor can make JACK buses of both audio and MIDI (just change name of bus in "View" > "Buses" to create one). By routing buses, Qtractor can act as a plugin host. However, you need to connect between output and input buses with taking care of bus looping that causes loud resonance sound that also makes XRUNs. MIDI mapping can be done in the properties menu of each plugin (Select a track, "Track" > "Track Properties" > "Plugins" > Right click a plugin > "Properties" > Left click a small round button on each parameter > "MIDI Controller"). Each bus can add plugins, but these don't have MIDI mapping. Carla is graphical and I recommend that you use Carla for plugins for avoiding failure on audio connection.


# In Terminal, Install Package

sudo apt install calf-plugins


It's the Bash script to lunch the session.


#!/bin/bash

qjackctl -s &

sleep 8

drumkv1_jack drumkv1_sample/preset_1.drumkv1 &

sleep 8

qtractor saloon_0500_qtractor/saloon_0500_qtractor.qtr &

sleep 8

carla saloon_0500.carxp &

sleep 8

jack-keyboard &

sleep 12

aj-snapshot -drx saloon_0500.xml

#jack_capture --port system:playback_1 --port system:playback_2 -jt saloon_0500.wav


List of Applications and Version Information:


a. QjackCtl: 0.9.4

b. drumkv1 (drumkv1_jack in Terminal): 0.9.23

c. Qtractor: 0.9.26 (Build from Source)

d. Carla: 2.4.2 (Build from Source at Ubuntu 20.04 LTS)

e. jack-keyboard: 2.7.2

f. aj-snapshot Version: 0.9.9 (Build from Source at Ubuntu 20.04 LTS)

g. jack_capture Version: 0.9.73

h. Gtk Wave Cleaner: 0.22-04


Anyway, I'll create more tunes. I'll update details of making tunes if any significant change occurs.

Please free to contact me by E-mail if you have any opinion or comment on this site.
Link: E-mail Adress
Push the "Search!" button to show results. How to search for a word?