Jump to content

SullX

Members
  • Posts

    7
  • Joined

  • Last visited

    Never

About SullX

  • Birthday 01/01/1

Profile Information

  • Gender
    Not Telling

SullX's Achievements

MIDIbox Newbie

MIDIbox Newbie (1/4)

0

Reputation

  1. Thank you both for your thorough explanations. I now plan on utilizing the MIOS software to do what I require, but I still plan to write my own program to do this also. MIOS is going to help a great deal with hammering out bugs in the program and timing issues with my own program. As far as I can see there is only one other problem.. This is how I am seeing it: the time between the NOTE ON event and the NOTE OFF event will be the length of time a particular joint will be in the extended state, and the time between the NOTE OFF event and the NOTE ON event will be the length of time a particular joint will be in the contracted (flexed) state. This is good. But I also need the capability of adjusting the rate at which each joint extends/contracts. In other words, I need to be able to vary (with the midi code) the time it takes for a particular joint to move from its extended position to its contracted position. I have been thinking about this and it doesn't seem (at least to me) that there is an easy way to do this with the NOTE ON/OFF commands. So, I was thinking that in the program that I end up writing, I could have it interpret the volume for Channel 1 as the rate at which the joints move from one state to another (contracted and extended). This wouldn't allow us to vary the rate of the joints expansion and/or contraction midway through the MIDI file but there is no need for this anyway (no animation of going from walking to running is need, for example). It should suffice to simply set the rate of joint movement for each MIDI file at the beginning (eg low volume == slow joint movement ; high volume == fast joint movement). What are your thoughts?
  2. Lyle, your explanation of the code is phenomenal! I have been studying the midi code from various websites and had put a lot together but you have cleared up a LOT of questions I had. I highly appreciate your efforts! Two questions: First, is there anyway to simplify this code and remove all the extra channels? Only one midi channel is needed to play the note correct? Secondly, how can i make the NOTE OFF event execute over a period of time, similar to the NOTE ON event. Particularly, when I am using a synthesizer (one with a musical score such as the Power Tab Editor) how can I give a note the proper command that will cause the MIDI NOTE OFF event to execute over a period of time. The second question is the most important as I dont want to have to go in and script in by hand how long each NOTE OFF event should take. It would be nice to do it in the synth program. Thanks again!
  3. Thanks for your help. We have built a quadrupedal robot with 12 joints (four legs each with a foot, elbow/knee, and hip joint). The goal is eventually to test a mathematical theorem predicting behaviors of neurons in an n-legged creature. We will use our robot along with reconfigurable pattern generators based on nonlinear electronic circuits to test this theory. This MIDI however has no application to that part of the project. Before we begin developing these nonlinear circuits to test out this theorem we need to script movements (locomotion) for the robot. We need to figure out the proper timing for the extension and contraction of each leg of our quadruped, and the timing of each of these events in a single leg with reference to the other legs (in this way we can write a script that will cause the robot to accurately gallop, run, or walk, etc). The timings will then be implemented in the creation of the circuit that will eventually control this robot and test the theory. So, this is where MIDI comes in. MIDI provides a very easy and user friendly way to write a script that could control the movements of a robot and the timing of each. We, therefore, don't need streaming input. That is why the .mid file type was attractive. We could, instead, write a program that interprets its own defined script. But MIDI provides a much more intuitive and user friendly environment for writing a movement (animation) script for the robot. The nitty gritty: The robots twelve joints contract and expand when their relative pneumatic pistons are pressurized. For each piston there is a corresponding valve that when activated pressurizes the piston. So we have a twelve valve system. Currently each valve is hooked up to a key on a very old piano keyboard. Each key basically acts as a current switch, and when it is pressed it provides a current to the valve which causes the pressurization of the piston etc. We want to write a program in C that can be loaded onto a microprocessor that will translate a MIDI file (.mid) that is loaded in the ram of the controller. Each note in the .mid would correspond to a particular valve, and the length of the note would control to the rate at which the valve pressurizes the piston. But before we write the program for the microcontroller we would like to simply write a program in C that interprets a .mid that we write and then translates it into the activating of twelve place holders over a certain length of time. These place holders obviously represent the 12 valves and 12 of the bits on the microprocessor we will eventually use to activate the valves. I hope this project description helps you help me. If you need me to elaborate on anything else, just ask. Thanks again.
  4. It seems I dont understand the capabilities of MIOS or a sequencer. Perhaps you could explain how I can use the sequencer to interpret all of the above code? We wish to be able to create a midi file that can be used for playback later in the robot (do not need to stream). Are you suggesting another approach rather than writing a program in C that interprets a .mid and translates it into activating the bits on a microcontroller that controls our valve system?
  5. I think you are misunderstanding what I am attempting. I need to understand the MIDI code at the most fundamental level. This way I can write a program in C that can interpret the MIDI code (like the MIDI bytes I posted above) and take actions based on specific MIDI bytes. I don't believe a MIDI sequencer is of use to me for this particular situation, but I know very little about them so I could be wrong. If someone could help me interpret the above code I would highly appreciate it. (I found this article http://www.qzx.com/pc-gpe/midi.txt which helped some but I could use further assistance). Thanks
  6. Thanks for your response stryd_one. So I have been working through the code for some *.mid files. The code below is for a midi file that plays a middle C whole note. The note in the below code appears on line 0050 it is the 30 bit. If you look at the far right column you can see a pattern ( 0h.@.0 ), this happens every time a note is struck. But the @ character is different if the note length is different (whole note half note) etc. 0000: 4D 54 68 64 00 00 00 06 00 01 00 03 02 D0 4D 54 MThd..........MT 0010: 72 6B 00 00 00 0B 00 FF 51 03 07 A1 20 00 FF 2F rk......Q... ../ 0020: 00 4D 54 72 6B 00 00 00 33 00 B0 07 7F 00 C0 18 .MTrk...3....... 0030: 00 B0 65 00 00 B0 64 00 00 B0 06 18 00 B1 07 7F ..e...d......... 0040: 00 C1 18 00 B1 65 00 00 B1 64 00 00 B1 06 18 00 .....e...d...... 0050: 90 30 68 96 40 80 30 00 00 FF 2F 00 4D 54 72 6B .0h.@.0.../.MTrk 0060: 00 00 00 2A 00 B2 07 7F 00 C2 21 00 B2 65 00 00 ...*......!..e.. 0070: B2 64 00 00 B2 06 18 00 B3 07 7F 00 C3 21 00 B3 .d...........!.. 0080: 65 00 00 B3 64 00 00 B3 06 18 00 FF 2F 00 e...d......./. Is there anyone who can assist me in interpreting the rest of this code? What information is contained within the first four lines? And what other information is dispersed between lines 0050 and 0080 (other than what I discussed above)? Thanks for your help, seems like a great community.
  7. My goal is to write a program in C that will accept MIDI byte's (MIDI input) and will interpret/translate the MIDI bytes into commands that activate certain bits on a microcontroller (move them to the high position). To begin however I just want to write a simple code in C that will interpret the MIDI code and will display the different functions within each byte of MIDI. For example, after receiving a MIDI byte and interpreting it the program prints to the screen all the information that was stored in that byte (note, note length, attack velocity, etc.). Once this step is complete I wish to translate the information within the MIDI byte to commands for a microcontroller. For example: middle C quarter note indicates for one of the bits on the microcontroller to activate for 0.25 seconds. With all that said I need some direction as to where I can learn about MIDI output (MIDI code). I need to understand what all is communicated with each byte of MIDI, and what determines the note, attack speed, and all the other info contained within the output. I am fairly new to MIDI so any help is appreciated. If you are curious as to why I wish to write a program, it is because I eventually wish to control (animate) a quadrupedal robot with the MIDI score. Each bit on the microcontroller that is activated will activate a particular pneumatic piston over a certain period of time causing the joint to contract.
×
×
  • Create New...