You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...which contains a <PianoKeyboard>' component and a ' component, both using the useMIDINotes hook within themselves, and they both work individually if I turn one off by commenting it out, but if I try to send MIDI to both of them at the same time only the first component that is receiving an input is working. Is it possible to send the same MIDI data from the same channel to two or more useMIDINotes components in the same view/page?
They both work great individually, but only one seems to work at a time, not both...
It seems as if I can do this if I am not using the same hook twice in the same component. If I use useMIDINote and useMIDINotes together they do not seem to step on each others toes. But if I use useMIDINotes twice in tow different child components then that seems to be where the incompatibility lies. Not sure if that is ultimately the issue, but I can indeed have the two different hooks co-exist, but not the same hook twice, it would seem...
These two components work together if used in the same parent component. This one:
...but the previous one and this following one do not work together in the same parent component:
constKeyboard=(props)=>{constnotes=useMIDINotes(props.input,{channel: 1})constnoteNumbers=notes.map((event)=>event.note).join(', ')// const Octaves = [...Array(parseInt(props.octaves, 10)).keys()]constOctaves=props.octavesreturn(<Container{...props}>{Octaves.map((octave)=>{return(<><Zone1Grid{...props}><Zone1WhiteKeyGrid{...props}><C{...props}octave={octave}noteNumbers={noteNumbers}>{(props.notes.includes(`b#${octave}dim`)||// ...and a whole lot more...this component is big...
I wonder if it's the case that the useMIDINotes hook needs to use the UniqueID thing that the useMIDINote hook uses...not sure how that would be added, though. Maybe two or more instances of the useMIDINotes hook are stepping on each other in the same parent component because of that 🤔
The text was updated successfully, but these errors were encountered:
Hi @nickroberts404! XD
I have a component that looks like this:
...which contains a
<PianoKeyboard>' component and a
' component, both using theuseMIDINotes
hook within themselves, and they both work individually if I turn one off by commenting it out, but if I try to send MIDI to both of them at the same time only the first component that is receiving an input is working. Is it possible to send the same MIDI data from the same channel to two or moreuseMIDINotes
components in the same view/page?They both work great individually, but only one seems to work at a time, not both...
It seems as if I can do this if I am not using the same hook twice in the same component. If I use
useMIDINote
anduseMIDINotes
together they do not seem to step on each others toes. But if I useuseMIDINotes
twice in tow different child components then that seems to be where the incompatibility lies. Not sure if that is ultimately the issue, but I can indeed have the two different hooks co-exist, but not the same hook twice, it would seem...These two components work together if used in the same parent component. This one:
...and this one:
...but the previous one and this following one do not work together in the same parent component:
I wonder if it's the case that the
useMIDINotes
hook needs to use theUniqueID
thing that theuseMIDINote
hook uses...not sure how that would be added, though. Maybe two or more instances of theuseMIDINotes
hook are stepping on each other in the same parent component because of that 🤔The text was updated successfully, but these errors were encountered: