Skip to content

Commit

Permalink
ok bro
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Oct 5, 2024
1 parent b827acb commit b2bdd6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Midi/MidiListener.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const MIDIListener = () => {
if (midiOutput === '') setMidiOutput(outputs[inputs.length - 1]?.name)
const output = outputs[inputs.length - 1]

Object.entries(midiMapping[0]).forEach(([_key, value]) => {
Object.entries(midiMapping[0]).forEach(([key, value]) => {
const buttonNumber = value.buttonNumber
if (!value.command || value.command === 'none' || buttonNumber === -1) {
if (output && buttonNumber !== -1) {
Expand All @@ -219,7 +219,7 @@ const MIDIListener = () => {
if (output && buttonNumber !== -1) {
try {
// output.send([0x90, buttonNumber, parseInt(value.colorCommand || commandColor, 16) || 99])
output.send([parseInt(`0x${midiMapping[0][buttonNumber]?.typeCommand}`) || 0x90, buttonNumber, parseInt(midiMapping[0][buttonNumber]?.colorCommand || commandColor || '3C', 16)])
output.send([parseInt(`0x${midiMapping[0][parseInt(key)]?.typeCommand}`) || 0x90, buttonNumber, parseInt(midiMapping[0][parseInt(key)]?.colorCommand || commandColor || '3C', 16)])
} catch (error) {
console.error('Error sending MIDI message:', error)
}
Expand All @@ -228,7 +228,7 @@ const MIDIListener = () => {
if (output && buttonNumber !== -1) {
try {
// output.send([0x90, buttonNumber, parseInt(value.colorSceneInactive, 16) || 60])
output.send([parseInt(`0x${midiMapping[0][buttonNumber]?.typeSceneInactive}`) || 0x90, buttonNumber, parseInt(midiMapping[0][buttonNumber]?.colorSceneInactive || midiSceneInactiveColor || '3C', 16)])
output.send([parseInt(`0x${midiMapping[0][parseInt(key)]?.typeSceneInactive}`) || 0x90, buttonNumber, parseInt(midiMapping[0][parseInt(key)]?.colorSceneInactive || midiSceneInactiveColor || '3C', 16)])
} catch (error) {
console.error('Error sending MIDI message:', error)
}
Expand Down

0 comments on commit b2bdd6e

Please sign in to comment.