Skip to content

Commit

Permalink
add midi clock options
Browse files Browse the repository at this point in the history
  • Loading branch information
paradajz committed Aug 18, 2022
1 parent cdba2c2 commit 1ed7578
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/definitions/block/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ const sections: Dictionary<ISectionDefinition> = {
{ value: ButtonMessageType.NoteOffOnly, text: "Note Off Only" },
{ value: ButtonMessageType.ControlChange0Only, text: "CC/0 only" },
{ value: ButtonMessageType.Dmx, text: "DMX" },
{ value: ButtonMessageType.BpmInc, text: "BPM Inc" },
{ value: ButtonMessageType.BpmDec, text: "BPM Dec" },
],
label: "Message type",
helpText: ``,
Expand Down
1 change: 1 addition & 0 deletions src/definitions/block/encoder/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const sections: Dictionary<ISectionDefinition> = {
{ value: EncodingMode.NRPN14bit, text: "NRPN/14-bit" },
{ value: EncodingMode.PresetChange, text: "Change preset" },
{ value: EncodingMode.Dmx, text: "DMX" },
{ value: EncodingMode.Bpm, text: "BPM" },
],
label: "Message type",
helpText: `Specifies the MIDI message which will be sent by the encoder. If Change Preset type is used,
Expand Down
6 changes: 6 additions & 0 deletions src/definitions/block/global/GlobalForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
:field-definition="sections.RunningStatus"
@modified="onSettingChange"
/>
<FormField
v-if="showField(sections.MIDIClock)"
:value="form.midiClock"
:field-definition="sections.MIDIClock"
@modified="onSettingChange"
/>
<FormField
v-if="showField(sections.UsbToDinThru)"
:value="form.usbToDinThru"
Expand Down
12 changes: 12 additions & 0 deletions src/definitions/block/global/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ const sections: Dictionary<ISectionDefinition> = {
helpText: `This setting applies only to DIN MIDI out. When enabled,
MIDI output bandwidth increases due to lower amount of bytes being sent. This setting can cause issues on older MIDI gear so it's best to leave it disabled.`,
},
MIDIClock: {
showIf: (formState: FormState): boolean => !!formState.dinMidiState,
block: Block.Global,
key: "midiClock",
type: SectionType.Setting,
section: 0,
settingIndex: 15,
component: FormInputComponent.Toggle,
label: "Send MIDI clock",
helpText: `This setting applies only to DIN MIDI out.
When enabled, MIDI clock will be sent out at default BPM of 120. The tempo can be changed with buttons or encoders.`,
},
DinMidiState: {
block: Block.Global,
key: "dinMidiState",
Expand Down
9 changes: 9 additions & 0 deletions src/definitions/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export enum ButtonMessageType {
Dmx = 24,
ProgramChangeOffsetInc = 25,
ProgramChangeOffsetDec = 26,
BpmInc = 27,
BpmDec = 28,
}

export enum EncodingMode {
Expand All @@ -103,6 +105,7 @@ export enum EncodingMode {
NRPN14bit = 7,
CC14bit = 8,
Dmx = 9,
Bpm = 10,
}

export enum LedControlMode {
Expand Down Expand Up @@ -137,6 +140,8 @@ export const HideButtonVelocityOnTypes = [
ButtonMessageType.NoteOffOnly,
ButtonMessageType.ControlChange0Only,
ButtonMessageType.Dmx,
ButtonMessageType.BpmInc,
ButtonMessageType.BpmDec,
];

export const HideButtonMidiIdOnTypes = [
Expand All @@ -150,6 +155,8 @@ export const HideButtonMidiIdOnTypes = [
ButtonMessageType.Dmx,
ButtonMessageType.ProgramChangeOffsetInc,
ButtonMessageType.ProgramChangeOffsetDec,
ButtonMessageType.BpmInc,
ButtonMessageType.BpmDec,
];

export const HideButtonMidiChannelOnTypes = [
Expand All @@ -168,6 +175,8 @@ export const HideButtonMidiChannelOnTypes = [
ButtonMessageType.Dmx,
ButtonMessageType.ProgramChangeOffsetInc,
ButtonMessageType.ProgramChangeOffsetDec,
ButtonMessageType.BpmInc,
ButtonMessageType.BpmDec,
];

export const HideAnalogMidiIdOnTypes = [AnalogType.Button, AnalogType.Dmx];
Expand Down

0 comments on commit 1ed7578

Please sign in to comment.