×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    1

    Anvil Studio, Midi and Vibration

    I read the documentation from Nokia "MIDI and True Tones in Nokia Phones" and still I do not understand how to create vibration.
    I am using Nokia 5100.
    Can anybody send me example with vibration track?
    Or example me as dummy how to create vibration track with Anvil Studio?

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    6
    Hi superfriik,

    Yes, you can use Anvil Studio to create the vibration track. There is one small part that Anvil Studio can not do, and that's adding the MIP message, but you can use another tool for that. I have used Piet van Oostrum's (http://www.cs.ruu.nl/~piet/) mf2txt that is available from ftp://ftp.cs.ruu.nl/pub/MIDI/PROGRAMS/MSDOS/mf2t.zip
    It is a DOS utility. I think he has the source code to the program available as well. I have explained the use below. You may also want to have a look at my answer to mrbadger in this discussion group as well.

    I was not actually sure if you could use Anvil Studio for this or not so I tried it out and here are some step-by step instructions. I did not know how fluent you are with Anvil Studio, so I tried to make these quite detailed. The instructions are long but the procedure is actually quite simple.

    These instructions were made using Anvil Studio 2003.06.01.

    1)Add the vibration track
    To add vibration to your midi file create a new instrument track (you may also use an existing one if that track will contain only vibrator notes). In Mixer or Composer view rename the track as "Vibrator" so that you can identify it later. Select 125-Telephone ring as the instrument. Choose an unused melodic channel (anything but number 10, percussion) for this track.


    2) Set the instrument bank and program for your vibrator channel
    Select the Event list view and set the vibrator as the active track. You should see the event list beginning with a Program Change with the channel number being one less than the one shown in Composer view (starting to run from 0 instead of 1 ) and a value of 124 (Telephone, also one smaller than in Composer view). Select Edit->Insert midi controller event. A New MIDI Event dialog opens. Select the BankSel event type. The channel number is already by default the correct channel for this track. Enter 121 for the Control value and accept. Insert another event, this time a BankSel LSB. You need to tick the Show all controller events box to be able to see that in the list. Enter 6 for the Control Value.
    The Nokia documentation says that you should have the two Bank Select messages before the Program Change so it needs to be moved to be after those two. There is no move command for moving within one track in Anvil Studio so the way to move it is to move it first to another track and then move it back. Double click on the Program Change event. Select another track from the Move to track box and accept. Then select that trach as the active track and move the Program Change back to the vibrator track. Make sure that you move the right Program change message.

    3) Insert the vibrator effects as notes on your vibrator track
    Any notes create the vibration effect. The Nokia instructions advise to use note D4 (midi 50). When you play this track or the file in Anvil Studio you can hear the vibrator as a telephone ring. The vibrator does not work for very short notes. 1/32nd notes seem to be too short for the vibrator. Remember to save your work in Anvil Studio to a file after you are done.


    4)Create the SP-MIDI header (the MIP message)
    This is the only part that Anvil Studio can not do. Maybe they will add support for SP-MIDI later. You will need the mf2t utility for this and you will need to know how to to run a simple command in a Windows (DOS) command prompt window. MIP values are explained in the Nokia document MIDI_and_True_Tones_in_Nokia_Phones_v1_1.pdf, chapter 3.2 so I will not go into those details.
    The way to create the SP-MIDI header is to convert your MIDI file to text and then edit the text file to add one header line. After editing you need to convert the text file back to MIDI. Let me now explain the required steps in detail.
    Start by copying your MIDI file, e.g. "song.mid" to the folder where you unzipped the mf2t utility. The name must not be longer than 8 characters (8.3 DOS filenames). Open a command prompt window (a.k.a. a DOS window) in Windows, change directory to the mf2t folder and type the command for converting MIDI to text, "mf2t -nv song.mid song.txt". The -nv argument will give you notes in symbolic form and a more verbose output.
    Open the resulting file "song.txt" in a text editor such as WordPad. You will need to insert the MIP message as the next line right after the first "MTrk" in the file.
    The beginning of the file will look somewhat similar to the next two lines below.
    MFile 1 1 100
    MTrk
    0 SysEx f0 7f 7f 0b 01 00 01 f7

    The third line is the MIP message that has the information on MIP values for each channel and the priority order of the channels. Let's use the line above as a template. You should edit that line to match the number of used channels in your file, their MIP values and their priorities and then insert that line to your file. The beginning of the line "0 SysEx f0 7f 7f 0b" is the part that identifies the file as being an SP-MIDI file. The line always ends with "f7". The part in between, now "00 01" is a list of channels and their MIP values in priority order. The numbers are always in hexadecimal format. In the line above 00 means channel number one and 01 is the MIP value. The line therefore says that only one channel is used, channel number one (there is an offset of 1) and it (together with all the previous channels in the list) has an MIP value of 1.
    It is advisable to always have the vibrator channel as the second one in priority. The vibrator channel also does not count in the MIP value.
    Let's take an example. Let's assume we have two channels for the song, say numbers 5 and 7 and the vibrator on channel 12. The MIP for channel 5 would be 2 and MIP for channel 7 would be 1 but the MIP for both channels together would still be 2. And let's assume channel 5 should have priority over channel 7. We would list channel 5 first with MIP 2: "04 02". Then we would add the vibrator channel, using the same MIP value: "04 02 0b 02". Note that channel number 12 will be stored as the value 11 which is 0b in hexadecimal. And finally we would add channel 7 which did not increase the MIP value either: "04 02 0b 02 06 02". This example would give us the following SysEx line.
    0 SysEx f0 7f 7f 0b 04 02 0b 02 06 02 f7

    When you have inserted the SysEx line just save the text to a file with name like "song2.txt". The command to create a MIDI file from that is "t2mf song2.txt song2.mid". You can continue editing of that MIDI file in Anvil Studio if you wish, but if your modifications will change the polyphony or add or remove channels then you should edit the MIP message again.

    I guess you could alternatively use the Nokia Sound Converter that comes with the PC Suite for creating the MIP message. The message will be added when you convert the MIDI file to SP-MIDI. But you get more control over the tracks when using the steps above.

    4) Transfer to a phone and enjoy.

    I could create an example file, but I don't have anywhere to post it and this board does not seem to support attachments either.

    I hope this helps :-)

Posting Permissions

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