MIDI Keyboard constantly registers a low note

I’ve plugged in my MIDI keyboard to my laptop and set it up for MIDI on Sonic Pi, and instead of responding to what I play on the keyboard when the program is run the cue/log says it’s playing note 0, pretty much every tick, with a velocity of 127. I’m unable to play anything else. I’ve tried resetting the MIDI devices but it keeps on happening. Also, I’ve tried playing notes while having Logic Pro open and it doesn’t seem to run into this issue on there.

Specs:

Sonic Pi 3.0.1
macOS 10.12
Novation Launchkey 49

Any help would be greatly appreciated. Thanks!!

Hi, sorry you’re having issues. Could you try/answer the following to provide a bit more context?

  1. Could you first update to the latest release v3.1 and try with that.
  2. What do you mean by “pretty much every tick”.
  3. Could you share a copy of the cue log so we can see what’s going on?

I updated to 3.1, still the same issue.

Here’s the log:

=> Starting run 1

=> Defining fn :drum1

=> Defining fn :drum2

=> Defining fn :drum3

=> Defining fn :drum4

=> Defining fn :live_loop_drums

=> Loaded sample “/Applications/Sonic Pi.app/etc/samples/drum_bass_hard.flac”

=> Defining fn :live_loop_time

=> Defining fn :live_loop_synthcontrol

=> Loaded sample “~/Desktop/sonicpi/proj1/wav/2 kick1.wav”

=> Defining fn :live_loop_synth1

{run: 1, time: 0.2206, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 0.0}
└─ sample “/Applications/Sonic Pi.app/etc/samples”,
“drum_bass_hard.flac”, {rate: 0.5}

{run: 1, time: 0.0}
└─ sample “~/Desktop/sonicpi/proj1/wav”,
“2 kick1.wav”, {amp: 0.0, pan: 0.9145, pan_slide: 1.6, lpf: 100}

{run: 1, time: 0.0, thread: :live_loop_synth1}
└─ synth :blade, {note: 75.0, pan: 1}

{run: 1, time: 0.5245, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 0.8284, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 1.1323, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 1.4364, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

=> Loaded sample “/Applications/Sonic Pi.app/etc/samples/drum_snare_hard.flac”

{run: 1, time: 1.7405, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 2.0443, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 1.6, thread: :live_loop_synth1}
└─ synth :blade, {note: 75.0, pan: -1}

{run: 1, time: 1.6}
└─ sample “/Applications/Sonic Pi.app/etc/samples”,
“drum_snare_hard.flac”, {rate: 0.55}

{run: 1, time: 2.3484, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 2.6522, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 2.9563, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 3.2603, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 3.5643, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 3.2, thread: :live_loop_drums}
└─ sample “/Applications/Sonic Pi.app/etc/samples”,
“drum_bass_hard.flac”, {rate: 0.5}

{run: 1, time: 3.2, thread: :live_loop_synth1}
└─ synth :blade, {note: 75.0, pan: 1}

{run: 1, time: 3.868, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 3.6, thread: :live_loop_drums}
└─ sample “/Applications/Sonic Pi.app/etc/samples”,
“drum_bass_hard.flac”, {rate: 0.5}

{run: 1, time: 4.1724, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 4.4762, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 4.7803, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 5.0841, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 4.8, thread: :live_loop_drums}
└─ sample “/Applications/Sonic Pi.app/etc/samples”,
“drum_snare_hard.flac”, {rate: 0.55}

{run: 1, time: 4.8, thread: :live_loop_synth1}
└─ synth :blade, {note: 75.0, pan: -1}

{run: 1, time: 5.3879, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 5.6923, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 5.996, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 6.2999, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 6.604, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 6.4, thread: :live_loop_drums}
└─ sample “/Applications/Sonic Pi.app/etc/samples”,
“drum_bass_hard.flac”, {rate: 0.5}

{run: 1, time: 6.4, thread: :live_loop_synth1}
└─ synth :blade, {note: 75.0, pan: -1}

{run: 1, time: 6.4, thread: :live_loop_time}
└─ sample “~/Desktop/sonicpi/proj1/wav”,
“2 kick1.wav”, {amp: 0.0, pan: 0.5292, pan_slide: 1.6, lpf: 100}

{run: 1, time: 6.9079, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 7.212, thread: :live_loop_synthcontrol}
└─ synth :piano, {note: 0.0, amp: 1.5}

{run: 1, time: 6.8, thread: :live_loop_drums}
└─ sample “/Applications/Sonic Pi.app/etc/samples”,
“drum_bass_hard.flac”, {rate: 0.5}

=> Stopping all runs…

=> Stopping run 1

=> Completed run 1

=> All runs completed

=> Pausing SuperCollider Audio Server

Hi, thanks for this but that’s the output log. The contents of the cue log below would be much more helpful to see. What are you seeing in that when you hit your keyboard? Also what code are you running?

Every time I plug in my keyboard my cue log gets flooded by this:
/midi/launchkey_49_launchkey_incontrol/1/1/note_on [0, 127]

I get similar messages with appropriate note number and velocity if I play any notes on the keyboard.
I can’t copy the cue log, I’m sorry.

MPT = “/Users/USRN/Desktop/sonicpi/proj1/wav”

define :drum1 do
sample :drum_bass_hard, rate: 0.5
sleep 1.6
sample :drum_snare_hard, rate: 0.55
sleep 1.6
end

define :drum2 do
sample :drum_bass_hard, rate: 0.5
sleep 0.4
sample :drum_bass_hard, rate: 0.5
sleep 1.2
sample :drum_snare_hard, rate: 0.55
sleep 1.6
end

define :drum3 do
sample :drum_bass_hard, rate: 0.5
sleep 0.4
sample :drum_bass_hard, rate: 0.5
sleep 0.8
sample :drum_bass_soft, rate: 0.5
sleep 0.2
sample :drum_bass_hard, rate: 0.5
sleep 0.2
sample :drum_snare_hard, rate: 0.55
sleep 1.6
end

define :drum4 do
sample :drum_bass_hard, rate: 0.5
sleep 0.4
sample :drum_bass_hard, rate: 0.5
sleep 0.8
sample :drum_bass_soft, rate: 0.5
sleep 0.2
sample :drum_bass_hard, rate: 0.5
sleep 0.2
sample :drum_snare_hard, rate: 0.55
sleep 0.18
sample :drum_bass_hard, rate: 0.5
sleep 1.42
end

define :drum5 do
sample :drum_bass_hard, rate: 0.5
sleep 0.4
sample :drum_bass_hard, rate: 0.5
sleep 0.8
sample :drum_bass_soft, rate: 0.5
sleep 0.2
sample :drum_bass_hard, rate: 0.5
sleep 0.2
sample :drum_snare_hard, rate: 0.55
sleep 0.2
sample :drum_snare_hard, rate: 0.35
sleep 0.2
sample :drum_snare_hard, rate: 0.25
sleep 0.2
sample :drum_snare_hard, rate: 0.15
sleep 1
end

with_fx :reverb, mix: 0.5, amp: 1.5 do
live_loop :drums do
drum1
choose([drum2, drum3, drum4])
end
end

with_fx :reverb, mix: 0.5, amp: 0.3 do
with_fx :ixi_techno, mix: 0.8 do
live_loop :glitch do
sleep 0.4
sample [:glitch_perc1, :glitch_perc2, :glitch_perc3, :glitch_perc4].choose
sleep [1.2, 0.4, 2].choose
end
end
end

with_fx :gverb, mix: 0.3 do
live_loop :time do
n = sample MPT, 1, amp: 4, cutoff: 100, pan_slide: 1.6
sleep 6.4
end
end

live_loop :synthcontrol do
use_real_time
note, velocity = sync “/midi/launchkey_49_launchkey_incontrol/1/1/note_on”
synth :piano, note: note, amp: velocity / 127.0 + 0.5
end

with_fx :reverb, mix: 0.5, amp: 0.5 do
live_loop :synth1 do
use_synth :blade
play 75, pan: [-1, 1].choose
sleep 1.6
end
end

For now, is there any way to make my code bypass note number 0 on my MIDI keyboard? It looks like it should work otherwise.

Ah, ok - this makes much more sense.

Essentially your keyboard is sending lots of messages to Sonic Pi which it is printing out as they arrive. This is something specific to your keyboard. Perhaps it’s in a special mode where it is configured to send these messages out.

As far as I can see you have two options:

  1. Configure your keyboard not to send automatic messages
  2. Only listen for messages where the note is not 0 using a conditional clause in your sync

I can’t help with 1, but 2 can be achieved with the following:

live_loop :synthcontrol do
  use_real_time
  note, velocity = sync "/midi/launchkey_49_launchkey_incontrol/1/1/note_on"
  synth :piano, note: note, amp: velocity / 127.0 + 0.5 if note != 0
end

Unfortunately there’s currently no way of filtering the messages that appear in the cue log. This is something I hope to add in a future version.

2 Likes

I’m so sorry! Turns out this is my mistake. My keyboard shows up as two devices: launchkey_49_launchkey_midi and launchkey_49_launchkey_incontrol. I switched the two and it works.

1 Like