Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Oct 5, 2024
1 parent 13fb777 commit 110fa14
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Midi/MidiListener.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,31 @@ const MIDIListener = () => {
})
}
const initLeds = (output: Output) => {
console.log(1)
if (output) {
console.log(2)
Object.entries(midiMapping[0]).forEach(([key, value]) => {
console.log(3)
const buttonNumber = value.buttonNumber
console.log(4, buttonNumber)
if (value.command !== 'scene' && value.command && value.command !== 'none' && buttonNumber !== -1) {
console.log(5)
if (output) {
console.log(6)
try {
console.log(7)
output.send([parseInt(`0x${value.typeCommand}`) || 0x90, buttonNumber, parseInt(value.colorCommand || commandColor, 16) || 99])
} catch (error) {
console.log(8)
console.error('Error sending MIDI message:', error)
}
}
} else if (value.command === 'scene') {
console.log(9)
if (output && buttonNumber !== -1) {
console.log(10)
try {
console.log(11)
output.send([parseInt(`0x${value.typeSceneInactive}`) || 0x90, buttonNumber, parseInt(value.colorSceneInactive || midiSceneInactiveColor, 16) || 60])
} catch (error) {
console.error('Error sending MIDI message:', error)
Expand Down

0 comments on commit 110fa14

Please sign in to comment.