Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > API > Midi API


Reply
 
Thread Tools Display Modes
  #1  
Old 08-30-2000, 07:18 PM
amram71
Guest
 
Posts: n/a
Default Midi API


How the *beep* do I use Midi api.
What I really want to know is where to store the sounds. I downloaded the Drum Machine at Planet-Source-Code. (contest winner)
If anyone can take the time to tell me where all the sounds are stored in that app, i would appreciate it. thankx

Reply With Quote
  #2  
Old 08-31-2000, 05:36 PM
BillSoo's Avatar
BillSoo BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default Re: Midi API

I took a quick look at the code and it appears that the sounds are stored in an array:

' Application Defined Structure Used For Playback, Editing etc...
Type Kit
bNoteOn As Boolean
PercName As Integer
PercVol As Integer
MidiMsg As Long
End Type

' Massive Array Of 100, 16 Step Pattern,s (16 Track... Rows Are Tracks).
Public Ptrns(15, 1599) As Kit



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
  #3  
Old 08-31-2000, 10:13 PM
amram71
Guest
 
Posts: n/a
Default Re: Midi API

I saw that, but how are the sounds of each instrument stored in the array. Does the computer have each sound stored in Memory?

Reply With Quote
  #4  
Old 09-01-2000, 01:09 PM
BillSoo's Avatar
BillSoo BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default Re: Midi API

This code in the mnuNew_Click event seems to populate the array:

...
' Build The Default Pattern Array.
For R = 0 To 15
Select Case R
Case 0: N = 35
Case 1: N = 37
Case 2: N = 38
Case 3: N = 39
Case 4: N = 40
Case 5: N = 42
Case 6: N = 44
Case 7: N = 46
Case 8: N = 45
Case 9: N = 47
Case 10: N = 48
Case 11: N = 50
Case 12: N = 49
Case 13: N = 51
Case 14: N = 54
Case 15: N = 56
End Select
For C = 0 To 1599 ' 100, 16 Step Patterns In One BIG Array.
Ptrns(R, C).bNoteOn = False
Ptrns(R, C).PercVol = 127
Ptrns(R, C).PercName = N
Ptrns(R, C).MidiMsg = &H7F0099 + (N * &H100)
Next
Next
...

MidiMsg seems to contain the info for generating the sound.

"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
  #5  
Old 09-01-2000, 07:40 PM
amram71
Guest
 
Posts: n/a
Default Re: Midi API

Thanks, I understand it!

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->