[Resolved] Change raw bytes from the alsa sequencer to FluidSynth

Discussion of all things Raspberry Pi / Raspberry Pi 2 related

Moderators: MattKingUSA, khz

Post Reply
Wombozo
Established Member
Posts: 3
Joined: Thu Oct 17, 2019 7:56 pm

[Resolved] Change raw bytes from the alsa sequencer to FluidSynth

Post by Wombozo »

Hi guys,
I have a MIDI keyboard (Impulse Novation 49) and my goal is to have a "decent" piano using a RaspPi 3 and controllers on my MIDI keyboard.

So basically I have jackd and fluidsynth using alsa_seq as midi driver and jack as audio driver running :

Code: Select all

/usr/bin/fluidsynth -a jack -m alsa_seq -i -l -s --gain=1.0 --reverb=2.42 --chorus=0.42 /usr/share/sounds/sf2/FluidR3_GM.sf2
/usr/bin/jackd -R -P89 -dalsa -dhw:0 -r44100 -p1024 -n3
I made a udev rule to aconnect my keyboard to fluidsynth whenever my keyboard is plugged :

Code: Select all

root@Piano-controller:~# aconnect -l
client 0: 'System' [type=kernel]
    0 'Timer           '
    1 'Announce        '
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 20: 'Impulse' [type=kernel,card=1]
    0 'Impulse MIDI 1  '
	Connecting To: 128:0
    1 'Impulse MIDI 2  '
client 128: 'FLUID Synth (356)' [type=user,pid=356]
    0 'Synth input port (356:0)'
	Connected From: 20:0
So far so good, I have piano sounds in my headphones. The thing is, I have no control whatsoever of the volume (gain, velocity or whatever) and so many buttons on my keyboard ! I was wondering if I could somehow "interface" and changing the raw data coming from my keyboard to my synthesizer.

So the jack_midi_dump command returns nothing. The only "output" I can have is with the aseqdump utility. I'm a big noob in sound with linux..
I heard though about the "mididings" utility.
I tried something like that :

Code: Select all

 mididings "Transpose(3) >> Channel(1)"
But nothing seems to work, even with args (no output)...

With aseqdum, I see all the notes coming, and that I have a fader sending data..

Code: Select all

root@Piano-controller:~# aseqdump -p 20
Waiting for data. Press Ctrl+C to end.
Source  Event                  Ch  Data
 20:0   Control change          0, controller 41, value 55
 20:0   Control change          0, controller 41, value 56
 20:0   Control change          0, controller 41, value 57
 20:0   Control change          0, controller 41, value 58
 20:0   Control change          0, controller 41, value 59
 20:0   Control change          0, controller 41, value 60
 20:0   Control change          0, controller 41, value 61
My question is : how can I change the gain (or even other parameters with mididings for instance) using faders on my keyboard ? I don't want to restart the fluidsynth server with different "gain" parameter, but rather find a way to interface between my keyboard and the synthesizer... I thought that changing the bytes as mididings could do would do the stuff but it does not work somehow.. Can I have any help ?

PS : I hesitate to buy a sustain pedal because I'm afraid it wouldn't work somehow with fluidsynth. Would it ?
Last edited by Wombozo on Sun Oct 20, 2019 6:25 pm, edited 1 time in total.
User avatar
thumbknuckle
Established Member
Posts: 51
Joined: Sun Oct 19, 2014 6:16 pm
Location: Western Massachusetts
Contact:

Re: Change raw bytes from the alsa sequencer to FluidSynth

Post by thumbknuckle »

I use a keyboard controller with Fluidsynth on a Raspberry Pi. Sustain pedal works, volume control on the keyboard works. I did not do anything to mess with either, they are outputting their default values the way they came from the factory.

Volume is controller number 7. Sustain pedal is controller number 64.
Faster than a laser bullet.
Louder than an atom bomb.
Wombozo
Established Member
Posts: 3
Joined: Thu Oct 17, 2019 7:56 pm

Re: Change raw bytes from the alsa sequencer to FluidSynth

Post by Wombozo »

Well I don't have any volume controller on my keyboard.. I onlly have a selection MIDI / Mixer but I can't press the Mixer button becuase it says on the digital screen that I need the "automap" program.. Apparently yes switching to the mixer mode would amake the faders ffect the gain. Any ideas ?
User avatar
thumbknuckle
Established Member
Posts: 51
Joined: Sun Oct 19, 2014 6:16 pm
Location: Western Massachusetts
Contact:

Re: Change raw bytes from the alsa sequencer to FluidSynth

Post by thumbknuckle »

MIDI faders output CC messages, which consist of the channel, controller number, and value. If you want Fluidsynth to interpret that as a volume control configure the slider you want to use as your volume control to send messages on controller 7. The data you are getting with aseqdump says you are sending controller 41 messages. You want to change that to controller 7.

see pages 19 and 39: http://www.novation.hu/uploads/4/0/8/2/ ... -guide.pdf

here's a list of standard MIDI mappings from some dude on the internet: https://nickfever.com/Music/midi-cc-list
Faster than a laser bullet.
Louder than an atom bomb.
Wombozo
Established Member
Posts: 3
Joined: Thu Oct 17, 2019 7:56 pm

Re: Change raw bytes from the alsa sequencer to FluidSynth

Post by Wombozo »

Works like a charm. Nothing else to say, thank you very much for your time thumbknuckle :)
Post Reply