Midi In - MidiInOpen And Callback / Delegate Functions?

Jan 4, 2006

I'm using vb.net and have got the midi out functions working properly. I'm now looking to add midi in functionality to my project and I am confused about the use / syntax of MidiInOpen and the associated midiInProc placeholder function. I think I need to understand and use a Delegate function to point to my Midi in handling procedure but nothing works for me and I can't find a suitable example anywhere.

Does anyone have any advice or examples as to how to implement Midi In in vb.net using the Windows multimedia API please?

View 5 Replies


ADVERTISEMENT

A Callback Was Made On A Garbage Collected Delegate?

Jun 6, 2012

I am using vb.net 3.5 and application is interacting with VC++ dll.

code is:
Public Delegate Sub delProcess() //Globaly declare
im del As New delProcess(AddressOf Process) //Process is function which not returning

[code].....

View 1 Replies

C# - Registering A Delegate Function With An ISO C++ Callback (on Mono)

Apr 8, 2010

I am exposing some ISO C++ data types to .Net (mono on Linux to be precise).For the purpose of brevity, I shall refer to C# in my question, although my question relates to all of the .Net languages (with C# and VB.Net being my target languages). So far, I have worked out how to expose the ISO C++ data types in C# class(es) for use in mono -The only problem so far is how to deal with the C++ callbacks. In .Net languages (C# and Vb.Net), I believe 'delegates' are the callback equivalent.

Sticking with C# for now, can anyone recommend a way that I can register the C# delegate functions with my ISO C++ code.The ISO C++ code is a notification library, and I want to be able to "push" the notifications to the mono framework (i.e. C# delegates in this case).My underlying assumption is that the mechanism/steps to implement this would be the same for the .Net languages - I'll just have to code the actual delegates in the .Net language of choice - is that assumption correct?Last but not the least, is the question of thread saftey. The underlying ISO C++ code that I am exposing to .Net (mono to be more specific), is both re-ntrant and thread safe - do I have to do anything "extra" to call .Net delegate from my ISO C++ code?

View 1 Replies

VB6 DLL Takes Callback As Integer, Requires Delegate Reference Type?

Dec 21, 2009

I have an issue with a third-party COM+ DLL meant to be used from VB6, where it has a function to set a Callback for a hardware event. However, I'm using VB.NET, and AddressOf now returns a reference type instead of an integral type, which means that the setCallback function on the COM+ DLL apparently can't be used.

View 1 Replies

[2008] Midi Note Fetcher (harping Midi)

Jan 10, 2009

There is this software called Harping midi. You can view it here [URL] I would very much like to recreate this software but extend on it. For example. I would like to be able to pick up the "midi notes" and then translate that to guitar tabs. I would like it to have the same features (channel filters, tempo control) those sort of things. Where would I start???

View 1 Replies

Multicast Delegate: Represents A Multicast Delegate; That Is, A Delegate That Can Have More Than One Element In Its Invocation List?

Jan 30, 2010

from the documentation we have this: Multicast Delegate: Represents a multicast delegate; that is, a delegate that can have more than one element in its invocation list.

so am i right to say that Multicast delegate is no different from a normal delegate other than the fact that it has arguments. so System.Action is a 'normal' delegate whereas System.Action(T)(Byval obj as T) is a multicast delegate?

View 5 Replies

Delegate - BeginInvoke - EndInvoke - Clean Up Multiple Async Threat Calls To The Same Delegate?

Feb 9, 2010

I've created a Delegate that I intend to call Async.

[Code]...

View 2 Replies

Get A Error" Method 'Private Shared Sub Ping Does Not Have A Signature Compatible With Delegate 'Delegate Sub ?

Jun 1, 2010

Code:
Public Class SendPings
Shared Sub New()
AddHandler Post.Saved, AddressOf Post_Saved[code].....

I get a error" Method 'Private Shared Sub Ping(item As BlogEngine.Core.IPublishable, itemUrl As System.Uri)' does not have a signature compatible with delegate 'Delegate Sub WaitCallback(state As Object)'.

View 4 Replies

VS 2008 : Have A Class Where The Functions Of The Same Name Are Both Instance Functions And Shared Functions?

Dec 6, 2010

What I am trying to do is have a class where the functions of the same name are both instance functions and shared functions.

Public Shared Function Get...(byval xx as xx)

and

Public Function Get...

The Public Function uses a Property xx created in the constructor, whereas the Shared Function has the parameters (byval xx as xx).

View 1 Replies

Multithreading - Delegate Within A Delegate?

Mar 23, 2010

I am trying to write a VB.NET alternative to a C# anonymous function.I wish to call Threading.SynchronizationContext.Current.Send which expects a delegate of type Threading.SendOrPostCallback to be passed to it. The background is here, but because I wish to both pass in a string to MessageBox.Show and also capture the DialogResult I need to define another delegate within. I am struggling with the VB.NET syntax, both from the traditional delegate style, and lambda functions.My go at the traditional syntax is below, but I have gut feeling it should be much simpler than this:

Private Sub CollectMesssageBoxResultFromUserAsDelegate(ByVal messageToShow As String, ByRef wasCanceled As Boolean)
wasCanceled = False

[code].....

View 2 Replies

Convert MIDI To .wav Or .wma?

Sep 15, 2010

Is it possible to convert MIDI files (.midi or .mid) into a .wav or .wma file in Visual Basic.NET (2010)? If so:

1: How would this be done?

2: If the output format can be .wma, how can one write the tags (such as artist, album, etc.) to the file in VB.NET?

I am saying .wav or .wma because I know that Microsoft does not have any rights to the MP3 file or something like that.

View 11 Replies

C++ - Animating A Midi File?

Aug 21, 2009

[URL] what tool did this person use to analyze the midi file? was it a midi file? how did they turn it into this kind of animation?is it possible to make an application like this in vb.net?

View 2 Replies

Midi CallbackOnCollectedDelegate Detected?

Feb 23, 2012

Hi to all, i really need some help with a piece of code. Im developing an app, which receive midi TIMECODE (MTC) and shows it on a textbox. when i start the app, it runs ok, and shows the mtc on the textbox, but after a few seconds it crashes and shows an error:
"A callback was made on a garbage collected delegate of type 'MidiTesting!MidiTesting.MidiIn_Callback::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called."

[Code]...

View 16 Replies

MIDI Input To Run Vb Commands?

Jun 29, 2011

So for the past 3 days I've been perusing the internet for a way to run a command when a MIDI signal is sent into VB - where/how should I start? As a matter of fact, I haven't found any way to enable MIDI input, period.

View 3 Replies

Excel Maths Functions And Calls To All DLL Functions Documentation?

Jan 29, 2007

1) Is it possible to access the Excel mathematical functions without actually opening Excel?

I was thinking of through a DLL WinAPI call or maybe a delegate function or smaller program?

2) Does anyone know of a MS link or area that gives instruction on "how to" use every function of every Windows DLL at all?

Or for all those that Microsoft have chosen to document online at least.

View 1 Replies

Closing Question For MIDI Child?

Apr 26, 2010

I have setup a dialog result to ask a question on closing, if they would like to close then the child can close, if the child is needed to remain open then the child needs to stay open.

Private Sub BugAManagerTimerForm_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
If StopButtonPressed = False Then

[code]....

View 2 Replies

VS 2008 : Write MIDI To String?

Feb 18, 2012

Is it possible to load a content of a MIDI file into a string and then save the string back to another file? I have been trying for a while, but no luck...Although I have no error, and the new file, view with notepad, looks the same as the original, but it does not want to play..

Dim urlpath As String = (Application.StartupPath & "UserMIDILibrary"
Dim fname As String = Path.GetFileNameWithoutExtention(pathload)
fname = fname & ".mid"

[code]....

View 3 Replies

VS 2010 How To Make A Midi Creator

Aug 4, 2011

How would I go about programming a Midi Creator?

View 2 Replies

[2008] Midi Parser Console

Jan 23, 2009

I have found a midi parser, it WILL work, but first, I need to create a file called consol.I havent got a clue what language this will be in, or is in. I really don't know.

View 10 Replies

MIDI Sound In After Pausing & Resuming, It Sounds Different?

Nov 19, 2011

I'm trying to play a MIDI file in my VB.NET (VB 2010 Express) and things work well with the code from this other question here on Stack Overflow, which I translated from C to VB.However, I also need to PAUSE, while that code is only for open and stop. I edited the code like this:

Imports System.Runtime.InteropServices
Imports System.IO
''' <summary>

[code]...

View 1 Replies

Play The Usual MIDI Sounds In A VB Program?

Jan 14, 2010

I am looking for a way to play the usual MIDI sounds in a VB program. Similar to the beep program (ie console.beep, leading to timer1.start etc.)but instead of an annoying bleep, have a MIDI sound (like a flute, violin, clarinet, etc.). Is this possible in VB 2008?

View 10 Replies

Record From The Microphone, Then Convert It Into A Midi File?

Feb 3, 2011

i am wondering if it is possible to make a program with visual basic that records from the microphone, then converts it into a midi file.

View 2 Replies

Sending Data To MIDI Device On Computer

Jul 1, 2009

I need some sample code for sending data to the MIDI device on the computer? I'm not quite sure what the hardware's address is though.

View 2 Replies

Call For The Internal Sound Cards And/or Midi Synthesizer?

Jun 22, 2009

I just started programming in vb 2008 Using vb studio 2008 and vb 4.0 Running Windows XP Home Edition My question concerns the capabilities of vb to call for the internal sound cards and/or midi synthesizer.Can a module call the sound card for it to play MULTIPLE notes at the same time, notes of fixed frequency and duration?

I have tried programming vb 4 AND vb2008 for them to modify the default BEEP sound: using a code i found on internet:private declare Function Beep lib "kernel32" (byval soundFrequency as int32, byval soundDuration as int32) as int32

[Code]...

View 2 Replies

MIDI Audio Analysis (for A Guitar Hero Game)?

Feb 26, 2009

In Guitar Hero the notes are saved on a .mdi file how can read the file ( analysis not audio playback ) ?

Attached File(s)
American_Idiot_MIDI.zip (1K)
Number of downloads: 97

View 7 Replies

Music Synthesis In .Net Using DirectSound: Diving Deeper Than MIDI?

Sep 16, 2009

So I was working in the forums and on the side bar of some thread I saw this link: [URL]...It turned out to be almost entirely about MIDI, but it made me think that I really need to share some code I wrote a few months ago and see if perhaps there is reason to create what the above thread really asked for.Here's a little background on the following code:

Back in April or so of this year I was doing some spring cleaning and came across the old Yahama PSR-6 synthesizer keyboard I had received one year for Christmas when I was around eight. I remember I used to like the Bagpipe voice because at the low notes it made a good fart sound. For a Toys-R-Us/Radio Shack model keyboard, running on six D-Cell batteries, produced in the early to mid eighties, that was an impressive achievement. LOL Anyway, I always did want to learn to play piano (or keyboard) so I decided to literally dust the thing off, put batteries in it, and fiddle around a bit. A couple YouTube videos later and I was convinced that I wanted to do this. While I was waiting for the thing to ship and arrive, I thought that it really shouldn't be that hard to take a DirectSound SecondaryBuffer object and inject it with sound data which whas calculated based on the harmonic values of musical notes, thereby creating your own synthesizer.

First, I really had little idea what I was doing when I first set about doing this other than the general structure of calculating byte data for notes and stuffing them into a SecondaryBuffer object while it played. I had used direct sound a number of times in a number of ways, but always playing sound data that came from a source (file, stream, etc.). This would be my first attempt at generating sound data for the buffer.

Second, I'm a "code-as-you-learn-learn-as-you-code" kinda guy, so that means that I developed the initial project as I went. I would research a specific portion of the project (and there was a LOT of research to do! lol) and then code it and move on to the next. Of course, this eventually leads to a mess of a project in most cases where the foundation is a bit complex to begin with. So the code I'm posting is the second version of the concept. But even at that, I'm only going to post the primary user control at this point and hold back on the code for the test application I created with it (I will provide a download to the compiled app however). After getting the user control cleaned up (if not ideally redesigned), the second app became a "develop-as-you-go" project for the test application - so it is a bit of a mess now too; but mostly just to look at code-wise - it actually runs pretty well.

Third, there are still a few design issues that could be improved upon in the user control, and a few choices which were made for ease of coding that could be changed for performance. But because of this, other than for a couple of routines, most of the code should actually be pretty straight forward to anyone who's comfortable in VB already.

Ok, on to the example: we are going to create a MusicKeyboard control. This control will draw itself like a pinao keyboard and will render keys for the specified number of full octaves. Clicking a key will play the associated note in the specified voice. Voices will be created using a simple digital oscillator and optional even-noise generator on top of a sine wave form.

To get started, you'll first need to have the DirectX SDK installed. The latest one is available here:[URL]..displaylang=en however the example was created using the version from March 09. There should be no impact from using the newer version.

Once you have the SDK installed, create a new Windows Application and add a new User Control named MusicKeyboard to the project. Note that you could create a Windows Class Library project, but I personally like to develop in an Application for ease of testing and later convert to a class library.You'll need to drag a BackgoundWorker component from the toolbox onto the usercontrol and name it "SynthWorker". Set the worker's WorkerSupportsCancellation property to True.

Now you'll need to add the DirectX reference to the project. You can rightclick the project in the solution explorer and select Add Reference or go to My Project and the References Tab. From the list of .Net references,add Microsoft.DirectX.DirectSound.That should be all we need to get started. In the following posts we'll create a bunch of code files and get the keyboard noise-worthy.Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

View 8 Replies

Place Other Form(child) At The Center Of Midi Parent?

Jun 30, 2011

how can i place other form(child) at the center of midi parent in vb.net windows application i m gettin it at the top left position

View 3 Replies

Way To Program Buttons That Scroll Along Screen By Using A Midi File

Jan 17, 2009

I've encountered problems with programming a Guitar Hero game (Frets on Fire) because I just started visual basic, but I know a lot still. I am almost done with button pressing and picking and I can easily get the buttons to scroll, but is there a way to program the buttons that scroll along the screen by using a midi file, like in Frets on Fire. I just don't know how I can get the frets (buttons) to correspond with the song without spending hours programming one song by hand.

View 7 Replies

Detect MIDI Input - Software Don't Recognize Digital Piano?

Aug 11, 2009

I made a musical software. Its only to my personal use. And I have a digital piano (model: Cassio Privia PX-800), with USB conection. I need to know how my software can detect my digital piano and how to detect what key note was pressed. I tried this sample code: [URL](at the end of the page there are a icon to download the project) but no success.

View 1 Replies

Callback A Sub From A DLL?

Jun 19, 2012

I'm trying to use a .DLL which Callbacks a Function of my project, but I can't get it to work.

Declaration from .h file of .DLL
void DLL_EXPORT SetEntity_CallBack(bool Active, _
void (*Entity_Callback)(int Site, int Application, int ID, _

[Code].....

View 11 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved