Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Midi windchimes No media

Author
Message
NoteJam
21
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 26th Apr 2005 14:37
This program sounds a bit like a windchime. It uses no media midi output.

Scroll down and to right, click view source code button. Why does my source code button end up over there, and everyone elses ends up closer to center of screen?
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 26th Apr 2005 17:32
Great example of howto hack the midi ports - nice work .

The source button being on the right hand side might just be because you have no signature.


Van-B

Quote: "How could I condescend you?, you don't even know what it means!"

Van-B's mom.
TEH_CODERER
22
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 26th Apr 2005 20:13
Source buttons are always over there. Nice code.

NoteJam
21
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 27th Apr 2005 05:14
Ok,
Then how do you guys post your code?

Do you use that code button in the message area?
How do we use that? Do we just click it one time, then paste our code in the message area?, or do we need to do it on both sides of the code?
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 27th Apr 2005 06:05
Get the code in the clipboard, press the code button, then press return to start a new line then paste the code. After that press the code button again to close the style thingy, then it'll appear as a 'code snippet'.


Van-B

Quote: "How could I condescend you?, you don't even know what it means!"

Van-B's mom.
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 27th Apr 2005 17:17
Quote: " Great example of howto hack the midi ports - nice work"

Thanks.


Play Nice! Play Basic! Version 1.06
NoteJam
21
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 28th Apr 2005 04:27
I have noticed my code is in need of a bit of improvement, as the dll calls are not quite right.
Each place where there is a 0 in the dll call the varible type should of been declared with a as long I think.
There is also a missing varible at the end of the 0,0,0 in the call that should be a varible return.

Its varible type should also be defined in the area where there are lines as long, etc.

Think it might be a bit more clear to add a remark after event=144 saying note on or note off message on channel 1.

Also I have found that a midi port of 0 is port 1, so I am making use of port 2.

So the remark for ports should be changed to read -1 = midi mapper 0 to ? your ports.

Lucky for me the sloppy dll calls worked, but this program as is should not be published as an example on how to correctly make the dll calls.
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 28th Apr 2005 05:09 Edited at: 28th Apr 2005 05:11
Quote: "Each place where there is a 0 in the dll call the varible type should of been declared with a as long I think."

No. The third parameter (first 0) is an (optional) address of a callback function (not possible with DBpro), the fourth parameter is the instance of that callback (n/a in DBpro) and the last parameter contains flags for the callback function (n/a in DBpro)

Quote: "There is also a missing varible at the end of the 0,0,0 in the call that should be a varible return."

No. In order to get a value back from a DLL function (if a function returns a value, that is) you call it like this
result = Call Dll(1, "midiOutShortMsg", HMO, Message)
MidiOutShortMsg returns either
0 = No error
70 = The application sent a message without a status byte to a stream handle.
67 = The hardware is busy with other data.
5 = The specified device handle is invalid.


Quote: "but this program as is should not be published as an example on how to correctly make the dll calls."

*Cough*


Play Nice! Play Basic! Version 1.06
MX7
21
Years of Service
User Offline
Joined: 12th Jun 2004
Location:
Posted: 28th Apr 2005 15:07
NoteJam
21
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 29th Apr 2005 04:17
Ok,
Thanks for your code and comments. Oh, nuts, I put that comment in several places on the forum, going to take me a while to straigten it all out now

Callback not possible with dbp? That is bad news, as the midi tutorials I read say its needed for midi recording.
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 29th Apr 2005 04:23 Edited at: 29th Apr 2005 04:24
Quote: "Callback not possible with dbp?"

Not natively, no. But I've heard something through the grapevine...


Play Nice! Play Basic! Version 1.06
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st May 2005 18:08
took me forever to get it to work. I'm looking at possible problems with my ports then I finally find where the trouble was at. midi was on mute, along with my cd audio and line2/mic. dumb computer had half my crap on mute.

PETA - People for the Eating of Tasty Animals

Login to post a reply

Server time is: 2026-06-11 11:46:27
Your offset time is: 2026-06-11 11:46:27