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.

Work in Progress / MIDI Plugin (Demo inside)

Author
Message
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 3rd Sep 2007 20:49 Edited at: 12th Nov 2007 23:50
*********************************
* Edit *
* New version can be found here*
*********************************

Hi all.
This is my first DBP plugin; it's not yet finished, but I figured, since school has started anew (final year already ), I could as well post what I've got this far (it's fully functional, just missing certain features) as I'll probably not have time to continue this for a while.

What's in there is, for the time being, basic midiOut commands, along with a 'beep-function' (which allows the programmer to manipulate the computers built-in oscillator).

I'm planning on adding midiIn support later, along with some bells and whistles for midiOut (like Set Pitch, etc. - you can do this using Send Midi ShortMsg though; it's just a bit more bothersome).

Included with the plugin is helpfiles for every belonging command, a list of standard MIDI patches (instruments) numbers, a keyword file and a DBA-include holding globals (constants didn't work due to the lacking of sensitivity to upper/lowercase) for the note values.

Here is a small example, making the program play an AMinor using the New Age patch until the user presses a key (requires the include file)

Updated demo source in post 6 below

So, try it out and drop me a line here if you do

As said, this is just a "pretest" version, so there might also be some bugs (nothing that I've discovered though).

"I kören hörs de brummande busarna Björnligan och Gondolen"

Attachments

Login to view attachments
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 3rd Sep 2007 21:07
nice a midi control plugin.
Interesting plugin.
Will get it a try this week

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Lucifer
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 4th Sep 2007 01:21
i get an error saying "invalid device identifier"


oh praise the lord, praise furry jesus
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 4th Sep 2007 18:04 Edited at: 4th Sep 2007 20:42
@Freddix: Thanks

@Lucifer: When did this happen?
If you just compiled my example source, it is probably because you have less than 10 (or 11, to be precise) midiOut ports.
In such an event, just change Open midiOut port(10) to Open midiOut port(1)

I'll try to make a bit better example tomorrow night.

You should be aware of the commands MidiOut Devices and Get MidiOut Device Name however. Check them out in the help.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
General about the error message: it means that the specified port to be opened doesn't exist.

"I kören hörs de brummande busarna Björnligan och Gondolen"
Lucifer
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 6th Sep 2007 20:06
Quote: "When did this happen?"


when i press any key after the "plugin initialized press any key"

i did change it from 10 to 1, i still get the same error


oh praise the lord, praise furry jesus
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 8th Sep 2007 12:33 Edited at: 8th Sep 2007 20:16
@Lucifer:
Hum... the only thing I can think of then, is that you've either only got one midiOut port (ID 0) (you should have at least one ) or that you didn't include the Midi_Includes.dba file - not including shouldn't give any error though, but just no sound.

You could try this anyways; if it still wont work I'd recommend that you'd debug the source (ie. put some Ans = MessageBox("Line number: " + here, "Checkpoint", 64) in where you think it might fail) and I'd be pleased if you could post the results .



"I kören hörs de brummande busarna Björnligan och Gondolen"
Lucifer
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 8th Sep 2007 16:28 Edited at: 8th Sep 2007 16:48
it worked, i was able to select from microsoft midi mapper and microsoft gs wavetable synth, when i selected that gs wavetable synth, it worked!

Edit: doesnt matter what patch i select, doesnt matter if i change the notes, everytime i press play i hear the sound, but way way to low pitched...


oh praise the lord, praise furry jesus
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 8th Sep 2007 20:20 Edited at: 8th Sep 2007 20:21
@Lucifer: Yeah, I noticed that.
The solution lies in encasing all the variables in the include file in a function and then call this in the beginning of your program.
I didn't think about that globals don't work directly from an included file (as constants does); anyways the main download archive has now been updated to contain a function called SetupMIDIConstants within the MIDI_Includes.dba file.

Thanks for pointing out theese... erm.. bugs

"I kören hörs de brummande busarna Björnligan och Gondolen"
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 20th Sep 2007 18:00
Hi again.

I tried to update this the other day, and now, all of a sudden, the exact same project that worked last time doesn't work with DBP upon recompiling (if using call dll it does though, so the problem lies in that the DBP compiler won't recognize the call names).

If anybody would happen to know what this is all about, please post.

"I kören hörs de brummande busarna Björnligan och Gondolen"

Login to post a reply

Server time is: 2024-11-24 01:45:28
Your offset time is: 2024-11-24 01:45:28