Page 4 of 4 FirstFirst ... 234
Results 61 to 78 of 78

Thread: midi bytes

  1. #61
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,062
    Rep Power
    8

    Default

    I forgot to say (reading back my post) that the fast array of notes are edited while they are pushed out; saying that (some) of the FM parameters are changed constantely during the sound cloud that gets pushed out. So there is a gradual sound color change during the sound to sound (something quite rare for old fashioned synth). This is done by a constant stream of midi data bytes that contain very little note on/ off commands, but many sound editing data.

  2. #62
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default pushing notes

    I had tried the wesite a few days ago and it did not come up. What I think you should look at is a class called ByteArrayOutputStream, though what it does is backwards from what one might think. There is a tremendous amount of study involved, which you are grossly underestimating. There are two basic approaches. One is to get the existing PASCAL program to write a file, a basic midi file which could then be played with enough work. The concept of doing the work with Java code is appealing. This is a potenially more powerful approach, but most people do not have the discipline or musical kraftwerk to be able to work directly in code.

    Finding filters already written in Java is something that could be done but would require deep and involved immersion in not only Java but mathematics of signal processing as well. Something that is not likely to be immediately productive from what I have found. The way midi works loads the system needlessly though a dedicated sound card may reduce that powerfully and gracefully. I think the direction we need to go here is composition in midi, but shipping the music in a format that is more amenable to the nature of processing. There are literally dozens of formats. For core information I would start at FLAC - there you will see what is actually involved in writing a driver.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #63
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default website came up

    now that I can see what I am dealing with it is a notch or three above what could have been but all my advices apply. Even better now that it is clear that we have one who can be instructed that this work under discussion takes not only discipline but as well measured allowance for partial achievment.

    I have been in one or two commercial film ... we are different but I realize what it is like to try to achieve realistic effort as narrowly contradistincted vis-a-vis a carefully crafted cavalier approach we see so often in contemporary culture. I have really had it with those folks big time so I will spend some effort looking at your Java slideshow on the cited link.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  4. #64
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default let's do this

    Now that I know I am dealing with a professional, what you need to do is look at this book: Manning: Maximum MIDI

    No discssion, no dis-cussin - this is where it's at. This publisher is exceptional in a field noted for works that are too often drain on the budget but cannot deliver the technical kraftwerk necessary to accomplish the work.

    Be prepared for a deep, involved study of technical issues,...
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  5. #65
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,062
    Rep Power
    8

    Default

    Thanks for your compliment, Nick, but the contradiction is that I do not want to get involved in midi! For me midi is over and I will move on to audio after solving the pascal thing. You might be right maybe I do underestimate some technical issues down to road. But the pascal thing did work and what I see in the pascal code I can imagine in java..... but who knows I might be mistaken.

    I believe to have my midi_out working soon (I´ll keep you posted). After I have a test tone played by sending it byte by byte to the port I will continue with the translation process (setting a clock and transferring the several sound block one by one).

    The other reason that I con not work with a midi file is that the program via foot switch is inter active and the sound blocks run mainly on random numbers, so a file would be to static.

    So for the future midi: no
    but audio, java programming and technical issues: yes
    So will keep talking, and who knows maybe norm joins in again on some other project?

    turning back to code and beethoven´s Waldstein (an other kind of code)

  6. #66
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Smile The Road Ahead.

    ( Sorry, I was trying to bait ftr. ) Norm's highly technical expertise but there are some,... I don't know what artists call it issues in the fire of the soul,.... that only ftr seems to understand. Really, what I would like to see is some overview from not just one but several masters with decade plus field experience on JNI and how these things go generally on where to look for signal processing. We are not likely to get deep unless we do that. There is an expansible metaverse available in harmonics and scripting, composing or as you wish to call it using a programming linguistic in place of physical keyboard is potentially powerful.

    The compliment was just to show recognition of a thankful change for the better. Do me a favor, save us both a lot of wasted words: Go try the book.... We go from there. If I try to explain why, I attract critics from other languages. To drive the physical device and the drivers, you will very + very + very likely end up with a pre-package package at the Java to actual machine interface. The site you cited was saying all the right things. Java is just a layer in several layers. I want to work on this, I was looking for a project for FLAC anyway. I am gaining enough skills that I may be able to write the Java level for several music formats, in which case I would give it to FLAC under Creative Commons.

    What I want you to study in the short term is using in Integer keyed TreeMap of DataBlocks. You write the DataBlock in any way that holds about 4k of midi data. I will show you how to chain them together. You tell midi you have the data by implementing several interfaces. An interface is the cover of a musical score with some ( read very few ) partially filled stanzas, just enough so you know what you need to write. How to do the byte to typed datatypes is known computer science. It is just that we have found if you do other's work for them it only results in wasted time and effort.

    I just write code for other people because I keep it for myself, it makes handy utilities.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  7. #67
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,062
    Rep Power
    8

    Default

    For the moment I am getting this when compiling some code
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
    at de.humatic.mmj.MidiSystem.openMidiInput(MidiSystem .java:362)
    which seams to contradict (how can an array [0] be out of bounds):
    is nothing all ready to little in computer science?

  8. #68
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,062
    Rep Power
    8

    Default

    found solution, had to init coremidi
    de.humatic.mmj.MidiSystem.initMidiSystem("mmj src", "mmj dest");

  9. #69
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,062
    Rep Power
    8

    Default

    I am about to try the midi_out

  10. #70
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default sounds of the void

    Last edited by Nicholas Jordan; 07-27-2008 at 01:30 AM. Reason: addtional information found
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  11. #71
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,062
    Rep Power
    8

    Default Thread solved, for the moment

    I needed some time to try things, but in principle I did find my midi_out on a mac comp. The source of the remodeled code presented is of Nils Peters, link, humatic - htools (small miditest java application). The package de.humatic.mmj.* is an interesting alternative to the java version of midi (see api). The constructor, at my remodeled code, midiforFbo1(int indxin, int indxout, boolean mj) lets you set the sun’s (mj=false) or the other package (mj=true) as the driving source. There is still a small issue concerning the first options because I could not here midi_out still. If anybody has an idea to fix that….? For the moment I am using the not sun version which works fine. The link to the Pascal program will be the small code fragment:
    Java Code:
    public void midi_out (int bt)  {
                try{
    	   mo.sendMidi(new byte[]{(byte)(bt)}); 
                } 
                catch (Exception ex){}
            }
    This would send out just one single midi byte. Nils Peters already said that, that would not make much sense because midi rarely is just one single byte and probably that is why he implemented the byte[] array. So when using the tone on code in the old fashioned Pascal code way

    Java Code:
    public void midi_toon (int cn, int tn, int dyn) {
    midi_out (cn);
    midi_out (tn);
    midi_out (dyn);
    }
    Should, theoretically, work, tough it isn’t because the tone gets squeezed off after a second (who knows why?). So the correct way, which works, would be:

    Java Code:
      public void midi_toon (int cn, int tn, int dyn) {
               sendJavaMidi(cn, new byte[]{(byte)tn, (byte)dyn});
            }
    I have to look into the old Pascal code to see if I could use the correct second version.

    Partly, theoretically, the very first question at the beginning of the thread:
    I’d like to do some very basic midi things:
    How can one read and write a single midi byte in java?

    Is solved! I have gone, together with nick, a long way, but here it is.
    Feel free to comment on the sun part of the program, or the single midi out part, but for the moment I am done.
    Turning to nick´s remarks about single processing of audio. I did do that in an other work called Stromenti Spezzati (where I use small, live recored samples of the flute and violin, which are put out in a changed version in real time), written for the famous Boston Musica Viva. In the work I used the MAX-MSP application see Cycling '74 || downloads but that is a whole different story (thread).

    THANKS

    Java Code:
    package miditry;
    
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.File;
    
    import de.humatic.mmj.*;
    import javax.sound.midi.*;
    import java.util.Vector;
    
    public class midiforFbo1 implements MidiListener, MidiSystemListener {      	
    	private MidiInput mi;
    	private MidiOutput mo;
    	private MidiDevice myInPort, myOutPort;
            
    
    	private Receiver receiver;
    			
    	
            
            private boolean outputEnabled, hex = true, mmj=true;
    					
            
            private String[] hexChars = new String[]{"0","1", "2", "3", "4", "5","6","7",
                                                        "8","9","A", "B","C","D","E","F"};
            private String[] macindev;
                     
            private String[] macoutdev;
       
    	private javax.sound.midi.MidiDevice.Info[] ins;
    	private javax.sound.midi.MidiDevice.Info[] outs;
    			     
    
    			javax.sound.midi.MidiDevice.Info[] dev = 
                                  javax.sound.midi.MidiSystem.getMidiDeviceInfo();  // general midi device data
    			int numIns = 0;
    			int numOuts = 0;
                            
                            
                            
            public midiforFbo1(int indxin, int indxout, boolean mj)  {
          	 mmj=mj;
             getmidiInfo();
             SetmidiOutdevice(indxout);
             SetmidiIndevice(indxin);
             
            midi_toon(144,  90, 200);
             
             if (mmj) {
                        mi.close();
                        mo.close();
                      
                        
                  }
                  else {
                       myInPort.close();
                       myOutPort.close();
                  }
                  
            }              
                            
            private void getmidiInfo() {              
                           if (mmj){
                               
                            de.humatic.mmj.MidiSystem.initMidiSystem("mmj src", "mmj dest");
    		
    			de.humatic.mmj.MidiSystem.addSystemListener(this);
                            
                            de.humatic.mmj.MidiSystem.getDevices();
                            
                            int macouts = de.humatic.mmj.MidiSystem.getNumberOfOutputs();
                            int macins = de.humatic.mmj.MidiSystem.getNumberOfInputs();
                           
                            int count;
                            count = de.humatic.mmj.MidiSystem.getInputs().length;
                            macindev = new String[count];
                            macindev = de.humatic.mmj.MidiSystem.getInputs();
                            for (int i = 0; i < count; i++) {		//sets array size
                                System.out.println("the macindev " + i + " name " + macindev[i]);
                            }
                            count = de.humatic.mmj.MidiSystem.getOutputs().length;
                            macoutdev = new String[count];
                            macoutdev = de.humatic.mmj.MidiSystem.getOutputs();
                            for (int i = 0; i < count; i++) {		//sets array size
                                System.out.println("the macoutdev " + i + " name " + macoutdev[i]);
                            }
                         
    		
                            } else {
                                   for (int i = 0; i < dev.length; i++) {		//sets array size
                                        try{
    					if (javax.sound.midi.MidiSystem.getMidiDevice(dev[i]).getMaxTransmitters() != 0) numIns++;  
    					if (javax.sound.midi.MidiSystem.getMidiDevice(dev[i]).getMaxReceivers() != 0) numOuts++;
                                        } catch (javax.sound.midi.MidiUnavailableException me){}
                                   }
    			
                                    ins = new javax.sound.midi.MidiDevice.Info[numIns];   // creates both info arrays
                                    outs = new javax.sound.midi.MidiDevice.Info[numOuts];
                                    numIns = 0;
                                    numOuts = 0;
                            
                            
                                    for (int i = 0; i < dev.length; i++) {
    				try{
    					if (javax.sound.midi.MidiSystem.getMidiDevice(dev[i]).getMaxTransmitters() != 0)   // stores all device info
    						ins[numIns++] = javax.sound.midi.MidiSystem.getMidiDeviceInfo()[i];        // ins[], outs[] 
    					if (javax.sound.midi.MidiSystem.getMidiDevice(dev[i]).getMaxReceivers() != 0) 
    						outs[numOuts++] = javax.sound.midi.MidiSystem.getMidiDeviceInfo()[i];
    				} catch (javax.sound.midi.MidiUnavailableException me){}
                                    }
                                    for (int i = 0; i < numIns ; i++) 
                                    System.out.println("recievers numb " + i + " name  " + ins[i]);
                                    for (int i = 0; i < numOuts ; i++) 
                                    System.out.println("transmiters numb " + i + " name  " + outs[i]);  		
                                    }
            }
    
    
    	
    	private MidiInput openInput(int index) {
    		
            	MidiInput mi = de.humatic.mmj.MidiSystem.openMidiInput(index);
                    
    		MidiInputListener mil = new MidiInputListener(mi);
    		
    		return mi;
    		
    	}
    		
    
    	private MidiOutput openOutput(int index) {
               
                        return de.humatic.mmj.MidiSystem.openMidiOutput(index);
    		
    	}
    
    
    	private void SetmidiIndevice (int index) {
    		  			if (mi != null) {
    						mi.close();
    						mi = null;
    					}
                                            if (mmj)  {
    					mi = openInput(index);
    					System.out.println(" device info (in) " + mi.getDeviceInfo());
                                            }
                                            else {
    					try{
    						if (myInPort != null) {
    							myInPort.close();
    							myInPort = null;
                                            }
    						System.out.println("opening in " + ins[index] + " index " + index);
    						myInPort = javax.sound.midi.MidiSystem.getMidiDevice(ins[index]);
                                                    myInPort.open();
    						Transmitter t = myInPort.getTransmitter();
    						t.setReceiver(new MidiIn(ins[index].toString()));
    					}catch (MidiUnavailableException mue){
    						System.out.println("can't open MidiIn : " +mue.toString());
    					}
                                            }
    	}
    
    	private void SetmidiOutdevice (int index) {
                                                if (mo != null) {
    						mo.close();
    						mo = null;
                                                }
                                            if (mmj)  {
    					mo = openOutput(index);
    					System.out.println("device inf (out) " + mo.getDeviceInfo());	
                                            }
                                            else {
                                                  try{
                                                        if (myOutPort != null) {
    							myOutPort.close();
    							myOutPort = null;
                                                        }
                                                        System.out.println("opening out " + outs[index] + " index " + index);
                                                        myOutPort = javax.sound.midi.MidiSystem.getMidiDevice(outs[index]);
                                                        myOutPort.open();
                                                        receiver = myOutPort.getReceiver();
                                                  } 
                                                  catch (MidiUnavailableException mue){
    						System.out.println("can't open MidiOut : " + mue.toString());
                                                  }
                                          }                             
            }
            
            
            
            
            public void midi_out (int bt)  {
                try{
    	   mo.sendMidi(new byte[]{(byte)(bt)}); 
                } 
                catch (Exception ex){}
            }
    
            
            public void midi_toon (int cn, int tn, int dyn) {  
                
                if (mmj)
                mo.sendMidi(new byte[]{(byte)cn, (byte)tn, (byte)dyn}); 
                else
                sendJavaMidi(cn, new byte[]{(byte)tn, (byte)dyn}); // note off 128 dyn=0
                
                System.out.println("toon on ");
            }
    
            void sendJavaMidi(int status, byte[] data) { 
    		
    		if (receiver == null) return;
    		
    		try{
    
    			MidiMessage msg = null;
    
    			if (status == 0xF0) {
    
    				msg = new javax.sound.midi.SysexMessage();
    
    				try{ ((SysexMessage)msg).setMessage(0xF0, data, data.length); }catch (InvalidMidiDataException imde){return;}
    
    			} else if (status >= 250) {
    
    				msg = new ShortMessage();
    
    				try{((ShortMessage)msg).setMessage(status); }catch (InvalidMidiDataException imde){return;}
    
    			} else {
    			
    				msg = new ShortMessage(); 
    
    				try{((ShortMessage)msg).setMessage(status, data[0], data[1]); }catch (InvalidMidiDataException imde){return;}
    			
    			}
    
    			if (msg == null) return;
    
    			receiver.send(msg, 0); 
    
    		}catch (Exception e){}
    
    	}
            
            private class MidiIn implements Receiver{
    		
    		private String name;
    		
    		private MidiIn(String portName) { name = portName; }
    
    		public void close(){}
    
    		public void send(MidiMessage msg, long timeStamp) {
    
    			if (msg.getStatus() == 254) return;
    			
    			System.out.println("Input from: "+name);
    			
    			for (int i = 0; i < msg.getMessage().length; i++) {
    				if (!hex) System.out.print(msg.getMessage()[i]+" ");
    				else {
    					System.out.print(hexChars[(msg.getMessage()[i] & 0xFF) / 16] );
    					System.out.print(hexChars[(msg.getMessage()[i] & 0xFF) % 16]+"  ");
    					if (msg.getLength() > 4 && (i+1) % 16 == 0) System.out.println("");
    				}
    			}
    			System.out.println("");
    		
    		}
    		
    	}
            
            public void midiInput(byte[] data){
    		
    		for (int i = 0; i < data.length; i++) {
    			//System.out.print((data[i] & 0xFF)+"  ");
    			System.out.print(hexChars[(data[i] & 0xFF) / 16] );
    			System.out.print(hexChars[(data[i] & 0xFF) % 16]+"  ");
    			if (data.length > 5 && i % 15 == 0) System.out.println("");
    		}
    		System.out.println("");
    		
    	}
            
            public void systemChanged() {
    		
    		
    		
    	}
            
            
            private class MidiInputListener implements MidiListener {
    		
    		private MidiInput myInput;
    		
    		private MidiInputListener(MidiInput in) {
    			
    			myInput = in;
    			
    			in.addMidiListener(this);
    			
    		}
    		
    		
            
                    public void midiInput(byte[] data){
    		
    		for (int i = 0; i < data.length; i++) {
    			//System.out.print((data[i] & 0xFF)+"  ");
    			System.out.print(hexChars[(data[i] & 0xFF) / 16] );
    			System.out.print(hexChars[(data[i] & 0xFF) % 16]+"  ");
    			if (data.length > 5 && i % 15 == 0) System.out.println("");
    		}
    		System.out.println("");
    		
                    }
            }
            
            public static void main (String args[]) throws Exception {
                
                de.humatic.mmj.MidiSystem.initMidiSystem("mmj src", "mmj dest");
                System.out.println (" general midi info ");
                new midiforFbo1(0,1, false);
             
                System.exit(0);
            }
            
            
            
    }

  12. #72
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Post good work

    I am attempting to get my contact who writes drivers involved, there are system issues on writeMIDI(byte[] stream) that are non-apparent and non-sensical to a non-programmer. [ dummy method name for discussion and no slam intended - that's just what is ] Thus, the humatic and Cycling '74 should be your orientation and guiding light for those moments when one is working deep in the technical details. The issue of writing a series of bytes to a port has to do with the fact that ..... uh, it's deep in system programming and one who can do the work is not going to sit and argue about obsucure techincal jargon when the basic fact is that the machine can and will lock if writing to a port is not done in a well known manner: Write a byte and return. What we need to do is interface with PASCAL or any of five or six languages you may tangentially look at through a byte array

    Thus:
    Java Code:
    byte[] buffer = new byte[array size];//
    To make a laptop a full blown musical platform for any brand, MAC or otherwise, we have to have dedicated routines written for that platform in the manner and convention of that platform. That is the level immediately below Java. Allow me the weight to display here the expertise you are seeking, you may use anything from humatic or bicycle in attempts to alleviate any restrictions that places on you or you think it places on you. We are not likely to get any better advice beyond those two sites unless Doug decides for some unanticipated reason to write us a full blown signal processor to sit underneath your Java.

    As you can see, we are going to be here awhile.

    I worked on this awhile yesterday, in between the photographer and the banner site and several challenges of my own that are at least what we have here already:
    Java Code:
    import javax.sound.sampled.TargetDataLine;
    import javax.sound.sampled.SourceDataLine;
    
    public class midiforFbo1 extends AudioFormat implements SourceDataLine, TargetDataLine 
    {
        // Preliminary, for discussion only... ( ! )
        public midiforFbo1 ()
        {
            super(8000,8,1,true,true);
        }
        //  .......  much more work to do
    What that does is addresses your attemting to write a single byte to the port. readPort() and writePort() { psuedo-code } have to be done in such a manner that there is an intervening layer between the buffer and the driver that passes single bytes for musical tone when a scheduler asks for them. Writing a scheduler is non-trivial, which is a fancy word for a workload that most people will not finish. Sometimes even Masters do not finish, it is just part and parcel of computer science. You should take a moment this morning and google for algorithm K

    I will dig through your code today if I can get to it. This won't be the only code of this size you write, save it and others in a no-delete archive. Keep cascading, working from the immediate previous backup and never ever start erasing wholesale in an attempt to get a clean slate. Just make another folder and anticipate having about 5-6 you can actually keep in your mind alongside several scratch folders.

    I advise you make a target of discovering how to get the byte[] passed to and from the PASCAL or just plan on re-coding the whole thing in Java. Computers work on bytes, a datatype you are trying to achieve is called a stream. Reconstructing data from a stream is known computer science, whether that is music or as it may be.

    Midi file format:

    A 4-byte chunk type (ascii)
    A 4-byte length (32 bits, msb first)

    Then folows byte[length] ,which is somewhat constraing to ship eight bit bytes one method call at a time on machines that physically could burst several thousand bits routinely. Somewhere around this level we get the possible unpleasant suprise that to play a midi note in java one way to do it is to call sleep(note_length) which would be incredibly inefficient if we have sound cards that are capable of interfacing to machine with good engineering and other formats to and from which we can convert using known methods.

    There are two types of chunks:

    Header Chunks
    which have a chunk type of "MThd"
    Track Chunks
    which have a chunk type of "MTrk"

    A chunk type in the first four bytes is plain ascii. Already, 4x8 =32 so if ascii only uses 7-bits we see that there is an entry right there where commercial vendors are likely to begin protecting their turf. If we were not burdened with protecting our turf, and associated proprietary rights of publishers, what system would we design for our effort to leave infrastructure for legitimate publishers to protect their turf? We can make some of the work available under Creative Commons, and reserve possibly a third to Academic research and a third for "The Machine".
    Last edited by Nicholas Jordan; 07-28-2008 at 09:54 PM. Reason: fix interfaces.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  13. #73
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,062
    Rep Power
    8

    Default

    Just a fast response, converting the one byte to byte array probably will be not to difficult within the pascal context. so I´ll start testing the first sound block of Cités.
    Timing the byte array out will be the next issue.
    Any idea what clkset(6,klok); in pascal means (klok=237).
    It starts the clock but what about 6, and 237?
    What would be the equivalent in java?

  14. #74
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Exclamation Get me the byte array today!

    get the byte[] out of PASCAL ~ I will read about the rest of it later. I am trying to bring a Master of Cryptography in to provide you with an avenue of protecting your proprietary licensing. Just get us the byte[] out of PASCAL, that's all I need. I can walk the doggie home on the rest of it.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  15. #75
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    Old-style MIDI is serial based on current loop technology. I've got a genuine Roland MPU midi card, vintage circa 1990 somewhere in my junk pile. ISA, of course. The data rate for MIDI is modest, I think about 500 characters/second.

    MIDI is not audio, its data. Specifically, it has "note on" and "note off" instructions. So you say "play A440 on" and "turn that off" and the instrument makes it sound like A440 on a piano, or trumpet or flute. Midi is more properly compared to the notes on a piece of music. It is not at all like PCM data used for most PC/Mac/Linix sound.

  16. #76
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,062
    Rep Power
    8

    Default clock rate

    Any idea what this pascal code fragment might indicate concerning the clock rate?

    clkset(6,klok);

    Java Code:
    repeat
           if bconstat(2)<0 then
           begin
             if bbconin(2)=27 then zoekerboo:=false;
           end;
           if (clkpls>=tel*7) and (tel<=60) then
           begin
             tel:=tel+1;
             midi_vel(1,4,67+tel);
           end;
         
           if clkpls>=50*teller  then 
           begin
             teller:=teller+1;
             if (teller>10) and (teller<=40) then midi_vel(5,8,97+teller-10);
           end;
    etc.

  17. #77
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,062
    Rep Power
    8

    Default

    Nick, eventually I might have to use other concepts of midi transmitting midi bytes (single bytes, arrays, files, buffered files). For the moment midi is working on my mac: I am able to turn notes on and of, fand I’d like to move on to the conversion of Pascal in java, and here is where the real problems start and where I need more help.
    So I’d like to put a sign up
    “We moved, our new address is “translating Pascal into java”

  18. #78
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Thumbs up request for moderater's opinion

    Moderator: Should we start a new thread? My opinon is keep this all in one place as the people I anticipate working on in are flunet navigators and / or the Alligators of Computer Science.
    /***** ***** /

    Quote Originally Posted by willemjav View Post
    Nick, eventually I might have to use other concepts of midi transmitting midi bytes (single bytes, arrays, files, buffered files).
    That is my first goal. We have achieved step one: Getting you un-stuck on midi-only thinking. See: Transmission.

    Quote Originally Posted by willemjav View Post
    For the moment midi is working on my mac: I am able to turn notes on and of, fand I’d like to move on to the conversion of Pascal in java, and here is where the real problems start and where I need more help.
    Correct. Note ftr's ( "fishtop records" ) advice. You should look at his website, dig around for a few minutes. I found yesterday a worker in the science ( Max Wildgrube ) who wishes to do this type of work and can protect your proprietary interests with SHA1. Hopefully we can get you something .... something that is exactly what you need and is as well capable of wrapping SUBCHAPTER B > § 1002 responsiblities in a manner that is well studied in tradional computer science.

    For today, at a minimum, work on fishtoprecord's advice - all day - I have put this guy put through the wringer in a front of a panel of ( well informed computer scientists ) and the achievment is, uh,.. remarkable. Superlatives would only dampen the description.

    He used the term: PCM - that acronym is Pulse Code Modulation

    { message edit: } the code you posted sets a clock, the last line brings the value within reasonable limits if not within bounds. Simple setting of a clock is not enough, there has to be an interplay between several sections of code. That is what the short code snippet I revised begins to do.

    To keep the computer from locking try to study that code in the context of Time Division Multiplexing.

    The full midi specificaton is available at: General MIDI Level 1 Developer Guidelines
    Last edited by Nicholas Jordan; 07-29-2008 at 05:08 PM.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Page 4 of 4 FirstFirst ... 234

Similar Threads

  1. DES algorithm (Read and Write bytes to file)
    By JoaoPe in forum Advanced Java
    Replies: 6
    Last Post: 07-29-2008, 03:46 PM
  2. Reading bytes from InputStream
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-25-2007, 07:51 PM
  3. how to know the number of bytes
    By gabriel in forum New To Java
    Replies: 2
    Last Post: 08-06-2007, 05:13 PM
  4. help with midi files
    By leonard in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 04:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •