Disable notes not in musical key

Good morning,
I’m a guitarist covering the keyboard in church on Sunday.
I’m ok, but I occasionally hit the wrong notes!
Has anyone here written a Bome patch to restrict a keyboard to just the notes in a particular musical key?
i.e. disable midi “note on” messages for all the notes not in the key of A major (Bb, C, Eb, F and G).
I thought I’d ask before I have a go at writing one!
Cheers,
Charlie

Hi,
I haven’t done this but it should be pretty straight forward.

  1. Set the based note of the key you want to play to 0.

Then only allow note (on or off) from base note plus:

0,2,4,5,7,9,11

You could use the mod (%) operator to figure out the offset and only allow the notes with the mod operator as set from base offset above.
The example above is only for major scales.

The key issues (no pun intended) would be.

  1. How do you handle accidentals?
  2. Might be a bit boring to have no dissidence as this often makes music more interesting.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thanks Steve,

I’ll give this a go this evening and let you know how I get on.

I realise this might be quite limiting musically, but given my keyboard skills I think it will be an improvement!

Besides it still gives me 2nds, 4ths, 6ths, 7th, 9ths and 13th. That’s more than enough to be getting along with.

Cheers,
Charlie.

Major 7ths but on dominant 7ths.

1 Like

This should help.

Preset 0 handles switching of preset 1 (Normal Operation) and preset 2 (Set Base) with not 47 on MIDI CH 10. You might want to change this to triggers of your choosing.

Preset 1 handles Note Processing for notes in the base major scale only. It only puts out notes if they are base + 0,2,4,5,7,9 and 11.

Preset 2 sets the base note, so if you press C the base will be 0. If you press C# the base will be 1, etc.

I don’t have any MIDI thru paths in the router so nothing else will go through.
In-Scale-Only.bmtp (2.2 KB)

I set my aliases as follows:

image

You can learn more about aliases from this tutorial.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

This is fantastic, thank you.
Rather than using note 47 on channel 10 to set the key, would be possible to just use the last (high) octave on the keyboard to set the key?
I’m away from home tonight, so I don’t have access to a keyboard, but I’ve tried the translator in Cubase and it seems to be working brilliantly! I’m just having trouble setting the key this way.
Cheers,
Charlie

You can set the MIDI message for anything you would like. Just make you set the same for note-on (push) and note-off (release). The push message will enable the ‘Set Base’ preset and the release message will disable it and set the ‘Normal Operation’ preset.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Hi Steve,

Please can you take a look at this log file?
For some reason the ‘note off’ message is not returning the code to ‘normal operation.’

1: MIDI IN [Bome MIDI Translator 1 Virtual In]: 99 2F 64
2: IN 0.1 Note On on ch. 10 with note:47 (0x2F) and any velocity=100
3: OUT 0.1 Perform ‘Set’ with 1 parameters
4: IN 1.0 MIDI 99 2F 64, oo=0x99 pp=0x2F qq=0x64
5: IN 0.0 Perform Set(1)
6: RULE 1.0:2 expression: (rr=oo&224) = 128
7: RULE 1.0:7 expression: (tt=pp%12) = 11
8: RULE 1.0:8 expression: (uu=tt-gb) = 2
9: RULE 0.0:1 expression: (pp=pp+1) = 2
10: 1.0:10 Log Scale Note is 2
11: Deactivated preset 1: Normal Operation
12: RULE 1.0:12 assignment: (vv=0) = 0
13: RULE 1.0:14 condition satisfied: if uu==2 then vv=1
14: Activated preset 2: Set Base
15: RULE 1.0:14 assignment: (if uu==2 then vv=1) = 1
16: MIDI OUT [Bome MIDI Translator 1 Virtual Out]: 99 2F 64
17: OUT 0.0 activate only preset number pp (2)
18: OUT 1.0 MIDI 99 2F 64
19: MIDI IN [Bome MIDI Translator 1 Virtual In]: 90 2D 64
20: IN 2.0 Note On on ch. 1 with any note set “pp” to note=45 with any velocity=100
21: RULE 2.0:1 expression: (gb=pp%12) = 9
22: 2.0:2 Base set to 9
23: MIDI IN [Bome MIDI Translator 1 Virtual In]: 80 2D 40
24: MIDI IN [Bome MIDI Translator 1 Virtual In]: 89 2F 40

Cheers,
Charlie

At first glance it looks like you don’t have your Aliases set up correctly as you should not be getting MIDI input from Bome MIDI translator Virtual Port 1. It should only be an output and your instrument should be the input.

You can learn more about aliases from this tutorial.

As far as your MIDI routing, you might want to check out the tutorial on device selection. I set the devices at the project level but you might want to change that.

For more information about device selection, see this tutorial.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Oh, it looks like I needed to add another rule in case the offset is negative.

I added this.

if uu<0 then uu=uu+12

In-Scale-Only-a.bmtp (2.2 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thank you Steve