I have an idea how to fix that but I'm leaving for a vacation trip until Monday. I'll get back to you then.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
I have an idea how to fix that but I'm leaving for a vacation trip until Monday. I'll get back to you then.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
raddevus wrote:
Indecisive Design Theory
This one? Monty Python - Splunge - YouTube[^]
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
Or maybe it blinked away?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
The Rubik's Cube used as the "solved"-icon on this thread doesn't look like it's solved :-D
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
You need to ask specific questions. By just posting your source code or asking for "guidance" people don't know what exactly you need help with. If you do have one or more specific questions then post them along with your source code in the Java forum so the Java people will see it.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
I missed that you formatted the output as hexadecimal. Change that line to:
If Status = 144 Then
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
You need to go into more detail with problem descriptions. "Not working" is not helping me understand. Does it not do anything any more or still the same problem as before or what?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
OK - try this:
Function MidiInProc(ByVal MidiInHandle As Int32, ByVal wMsg As Int32, ByVal Instance As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Integer
Dim Status As Byte
Dim Note As Byte
Dim Velocity As Byte
TextBox1.Invoke(New DisplayDataDelegate(AddressOf DisplayData), New Object() {wParam})
Status = (wParam And &HFF)
If Status = 90 Then
Note = (wParam And &HFF00) >> 8
Velocity = (wParam And &HFF0000) >> 16
m.PlayMIDINote(Note, Velocity)
End If
End Function
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
;)
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
Alienoiz wrote:
The textbox1 is just for showing the data that is being sent from the MIDI Keyboard into the PC!
Yes and I want to see that
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
No - not for a single key but for two different keys please, in sequence.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
Alienoiz wrote:
The keys i say are the keys from my piano MIDI keyboard (hardware piano keyboard)!... Not from PC´s keyboard!!!
Alright :laugh: Please post the contents of your TextBox1
after pressing and releasing a single key.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
In the code you linked a note gets played by a mouse left click. You say you play notes by pressing keys but I don't see any of that in your code. Can you show the code that handles key presses?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
On the page you linked in another post (Visual Basic MIDI Piano[^]) there are these two subs which I assume are still somewhere in your code:
Private Sub Down(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown, Button2.MouseDown, Button3.MouseDown, Button4.MouseDown, Button5.MouseDown, Button6.MouseDown, Button7.MouseDown, Button8.MouseDown, Button9.MouseDown, Button10.MouseDown, Button11.MouseDown, Button12.MouseDown, Button13.MouseDown, Button14.MouseDown, Button15.MouseDown, Button16.MouseDown, Button17.MouseDown, Button18.MouseDown, Button19.MouseDown, Button20.MouseDown, Button21.MouseDown, Button22.MouseDown, Button23.MouseDown, Button24.MouseDown
Jazz.MidiOut(&H90 + chan, Note(sender), 100)
End Sub
Private Sub Up(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseUp, Button2.MouseUp, Button3.MouseUp, Button4.MouseUp, Button5.MouseUp, Button6.MouseUp, Button7.MouseUp, Button8.MouseUp, Button9.MouseUp, Button10.MouseUp, Button11.MouseUp, Button12.MouseUp, Button13.MouseUp, Button14.MouseUp, Button15.MouseUp, Button16.MouseUp, Button17.MouseUp, Button18.MouseUp, Button19.MouseUp, Button20.MouseUp, Button21.MouseUp, Button22.MouseUp, Button23.MouseUp, Button24.MouseUp
Jazz.MidiOut(&H80 + chan, Note(sender), 0)
End Sub
Looks like it's supposed to start playing a note on KeyDown and stop playing it on KeyUp, without a predetermined duration, which you seem to have added. So I'm guessing all you need to do is to either remove the "Up"-sub and the event-wiring for it or comment out the single line it it. If it doesn't work then I have no idea.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
Chris, that sig is unacceptable. Please do something about it. @chris-maunder
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
The parcel service introduced a live tracking a few years ago where you see a street map with markers for your home and for the current position of the delivery car, along with the number of remaining stops before yours and an estimated time until delivery. So far, it hasn't been accurate a single time, not even close. You would assume they monitor their prediction success rate and adjust it accordingly. Apparently not. My parcel was announced by email to be delivered today between 1pm and 2pm. At 3pm I opened the live tracking and it said 19 stops remaining. At 3:15pm it said 25 stops remaining and at 3:30pm it said 29 stops remaining. :wtf: All the while the car was shown at exactly the same position it already was at at 3pm. Want to make a guess on their prediction algorithm? :rolleyes:
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
C'mon, it's not a programming question..
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
Mycroft Holmes wrote:
Following that logic would 240VAC be better than 120VAC
It is, at least in this regard. That's also why the the power grid operates on an even higher voltage and only gets transformed down shortly before reaching the consumer.
Mycroft Holmes wrote:
Now I'm looking for and efficient 3 phase battery solution.
No experience with that, sorry.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
With 12VDC instead of 120VAC with a constant P(consumer) (which is almost realistic with modern switching PSUs) the required current rises by a factor of 10. Which means the voltage drop across the power line rises by a factor of 10. Which means the power loss across the power line rises by a factor of 100 (P = U*I -> P = R*I*I -> P = R*I²). This is a bit simplified but good enough for illustration. Low voltage supply lines only make sense for either really small currents or really small distances. House supply is already too big, in both current and distance. In order to not turn the power line into the house heating unit you would have to increase its diameter considerably which is both expensive (copper) and unpractical in terms of installation.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
Alienoiz wrote:
i am not a coder..i just make these small gadgets to keep my head busy...
Why don't you start to learn it properly? Open the form designer. Right-click the CombBox for the note-duration and select Properties. In the properties pane click on the events-icon (small and easy to miss). Search for the SelectedIndexChanged-event in the list and make a double-click into the empty column to the right of it. Visual Studio switches to the source code and you will see a stub for the event-handler-function where you will only have to insert that one line from my previous message. Remove that line I underlined in the other function in my previous message. That should be it.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson