Tecnologia di Internet
 
Inserire MIDI in una pagina web
Netscape Navigator (Windows e Macintosh) gestisce i file audio mediante plug-in. Il plug-in di default di Navigator, LiveAudio, supporta questi formati audio
  • MIDI (.mid, .midi, .kar) (audio/x-midi, audio/midi)
  • AU (.au) (audio/basic)
  • Wave (.wav) (audio/x-wav, audio/wav)
  • AIFF (.aiff, .aif) (audio/x-aiff, audio/aiff)

Internet Explorer gestisce i file audio mediante i plug-in o, per default, con il controllo ActiveMovie (basato sulla tecnologia ActiveX di Microsoft) incorporato in Internet Explorer dalla versione 3. ActiveMovie supporta i seguenti formati multimediali

  • MPEG-1 (.mpg, .mpeg, .mpv, .mp2, .mpa)
  • Audio-Video Interleaved (.avi)
  • Nonproprietary QuickTime files (.mov)
  • Wave (.wav)
  • AU (.au, .snd)
  • AIFF (.aif, .aiff)

Altri plug-in che possono essere usati per l'audio (sia su Macintosh che su Windows)

  • QuickTime (http://www.apple.com/quicktime) è anche un sintetizzatore Midi con suoi strumenti
  • Crescendo (http://www.liveupdate.com) (midi streaming) (usa il sintetizzatore di QuickTime)
  • RealAudio (http://www.realaudio.com)
  • CineWeb (http://www.digigami.com/cineweb) (solo Windows + Netscape)
  • Yamaha Midiplug (http://www.yamaha.co.uk/xg/html/h_midplg.htm) solo midi, contiene suoi strumenti
  • Headspace's Beatnik (http://www.headspace.com/) contiene i suoi strumenti midi

Oppure applicazioni esterne

  • QuickTime Movie Player (Macintosh e Windows)
  • Microsoft MediaPlayer (Windows)

Su web l'audio può essere inserito mediante cinque tag diversi

  • <A> (tutte le versioni, apre una pagina esterna)
  • <EMBED> (Internet Explorer 3.x, 4.x, Navigator 2.x, 3.x, 4.x)
  • <BGSOUND> (Internet Explorer 2.x, 3.x, 4.x)
  • <OBJECT> (Internet Explorer 3.x, 4.x)
  • <IMG> (obsoleto, Internet Explorer 2.x, 3.x, 4.x)
A

Il modo più immediato per suonare un file midi "su richiesta" è inserire un link come questo

    <a href="drivecar.mid">Clic per sentire il brano</a>

Per esempio, questo è un file MIDI (tipo MIME audio/midi) del brano dei Beatles

Baby, you can drive my car

inserito con questa tecnica. Il file viene gestito in primo nel modo specificato nelle preferenze del browser (con un plug-in o una applicazione).

Per default, Netscape Navigator 4.7 per Macintosh utilizza il plug-in LiveAudio. Cliccando il link qui sopra si apre il controller di LiveAudio in una piccola speciale finestra. Chiedendo invece di caricare il link in una nuova finestra, il controller si apre in una finestra normale. Si può anche salvare il file localmente.

Ho provato anche Internet Explorer 4.5 per Macintosh con il plug-in di QuickTime 4.1. Cliccando sul link nella finestra (o in una nuova finestra se lo si è chiesto) appare il controller di QuickTime. Anche in questo caso il file si può salvare localmente.

The parsing steps that Internet Explorer 3.0 goes through are similar to the "EMBED SRC tag" case, in that it gets the file extension, maps it to a content type and looks in the HKCR/MIME/Database/Content Type area of the registry to get a CLSID to invoke. However, in this case the ActiveX control plays in an external window. The ActiveMovie control is in control of downloading the file.

EMBED

Il tag <embed> è supportato (in modo diverso) sia da Netscape Navigator (dalla versione 3) che da Internet Explorer (dalla versione 4). Una istruzione tipica è la seguente

    <EMBED SRC="brano.mid" VOLUME="50" HEIGHT="60" WIDTH="144">

Per esempio per suonare Fernando degli Abba si scrive

<embed src="http://www.midi.net/midifiles/Pop_and_Top40/abba/fernando.mid" width="144" height="60" volume="50" type="audio/midi" controls="console">

Netscape Navigator 4.7 per Macintosh con il plug-in di default LiveAudio (attivato per il tipo Mime audio/midi) apre qui sopra un piccolo pannello con il quale si può avviare la riproduzione musicale. L'opzione "console" rende visibile il pannello, che altrimenti non si vede. Width=2, Hight=0 per rendere invisibile il pannello. w=0, h=0 non funziona.

Netscape Navigator 4.7 per Macintosh con il plug-in QuickTime (attivato per audio/midi) apre qui sopra un piccolo controller con il quale si può avviare la riproduzione musicale.

Internet Explorer 4.5 per Macintosh con il plug-in QuickTime (attivato per audio/midi) fa apparire il controller di QuickTime, che parte in automatico.

Su Internet Explorer 3.0 questo tag works identically to the OBJECT control. Internally, Internet Explorer looks in the HKEY_CLASSES_ROOT/MIME/Database/Content Type registry hive for the CLSID to invoke (all ActiveMovie types are registered there when ActiveMovie is installed) and invokes the ActiveMovie control with that media type.

Cos'è PANEL=0?

Embedding QuickTime midi Of course, if you've been reading about Quicktime you'll have decided to cut out all this complication by using the embed tag with a movie instead. That way you can guarantee that everyone hears the same thing, that they have the same controller on their page and that it looks the way you designed it.

In that case you use the embed tag as before, but specify:

    <EMBED SRC="monsters_ate_my_granny.mov">

having previously exported your midi file through MoviePlayer as a movie. That way you also get round the problems associated with QuickTime on Windows 98 and Explorer which, co-incidentally, started round about the same time as Apple refused to stop developing multimedia playback for the PC. Bill Gates anti-competitive? Nah!

Attributi supportati da entrambi i browser

Attribute Description
SRC="URL" Specifica l'URL del file, che può essere in ogni formato riconosciuto (per esempio: "midi, wav, au")
WIDTH="n" Larghezza del pannello di controllo. Quella ottimale dipende dal plug-in ma in genere vanno bene 144 pixel. Crescendo vuole 200 pixel.
HEIGHT="n" Altezza del pannello di controllo. Il valore ottimale dipende dal plug-in, ma in genere 60 va bene (il plug-in Crescendo vuole 55).
ALIGN="alignoption" Allineamento del pannell odi controllo. Possible options are: TOP, BOTTOM, CENTER, BASELINE, LEFT, RIGHT, TEXTTOP, MIDDLE, ABSMIDDLE, or ABSBOTTOM.
NAME="name" Nome dell'oggetto per poterlo controllare con JavaScript mediante document.name
HIDDEN="true"|"false" Specifica se l'oggetto è visibile (false) o nascosto (true).
AUTOSTART="true"|"false" Indicates if the sound track should start automatically upon loading. A "true" value means it should, a "false" value means it should not. The Explorer's default is "false" while Navigator's one is "true". The default on the Mac is "false" for both browsers.

Attributi non supportati da entrambi i browser

Attribute Description
VOLUME="n" Navigator. Può andare da 0 a 100 e specifica il volume, 50 è il default. Navigator's control panel reflects this setting when the element is loaded.The Windows 95's default is 50 (midpoint), while that on the Mac is 75.

I am experiencing an unusual phenomenon...quite recently. My pages have midi sound files embbedded as plug-in. In the attributes tab of the plugin inspector, if I set the volume to 100% the midi sound volume slider drops to 50% when the page is loaded (and the sound volume is decreased, as well)...in INternet Explorer only; In netscape communicator, the volume blares loud and clear. The, if I deliberately enter zero (0) in the volume attribute the page sound plays loud and clearin IE but is silent in NC. This is definitely NEW and I can't figure out what the heck is happening. Any help would be appreciated.

LOOP="true"|"false"|"n" Navigator. Specifies if the sound should be played continuously (LOOP="true"), for a specified number of times (n), or should not be repeated (LOOP="false"). You will get continuous sound on Explorer. For same effect on Explorer, use playcount (see below).
PLAYCOUNT="n" Explorer. Specifies the number of times to play the sound.
PLUGINSPAGE="URL" Navigator. Specifies the location of the plug-in software needed to run the sound file. This attribute is needed only if the plug-in software is not one of the common ones that are already installed on the computer.
PLUGINURL="URL" Navigator. Specifies the location of the software needed to install the specified plug-in (JAR Installation Manager). This attribute is needed only if the plug-in software is not one of the common ones that are already installed on the computer.
HREF="URL" Explorer. Converts the control panel into a hyperlink.
TARGET="URL" Explorer. Converts the control panel into a hyperlink.
STARTTIME="mm:ss" Navigator. Indicates the spot on the track where to begin playing. Notice that the playing will start immediately, at the specified spot. The spot is specified in minutes from the beginning of the track. The track begins to play immediately when you download it (AUTOSTART="true"), or when you hit the play button (AUTOSTART="false"). Time is denoted in minutes and seconds. If you specify a time longer than the soundtrack length, the browser will give you an error.
ENDTIME="mm:ss" Navigator. Indicates the spot on the sound track where to stop playing. The spot is specified in minutes from the beginning of the track. The track begins to play immediately when you download it (AUTOSTART="true"), or when you hit the play button (AUTOSTART="false"). Time is denoted in minutes and seconds. If you specify a time longer than the soundtrack length, the browser will give you an error.

GoLive consente di inserire un tag <EMBED> trascinando dalla paletta Basic l'icona del plug-in e impostando le opzioni sull'ispettore plug-in. Il primo tab è Basic. Effettuando il link ad un file MIDI, GoLive indica il tipo Mime (audio/midi), il player (LiveAudio) e il medium impostati nelle Preferenze/Plug-ins.

Cliccando il triangolino in basso a sinstra

Nel tab Attribs vengono impostati ulteriori attributi.

Il quarto tab si modifica automaticamente secondo il link effettuato. Nel caso di un file audio (MIDIcon il plug-in LiveAudio in questo caso), si possono impostare le opzioni relative.

BGSOUND

E' un tag supportato solo da Internet Explorer 3 e 4 per suonare musica in background without any plug-ins, but that also means that you have no way of controlling the playback (assuming that the web master has not included a controller in the page design). If you do use Internet Explorer with a plug-in you'll need to disable the internal midi driver (MidiMapper?) in 'options/ web content' and enable 'plug-in objects'.

Midi plug-ins won't see bgsound, so the usual solution is to include both instructions in the same page, and let the browser sort it out.

Ecco un esempio

    <bgsound src="melody.mid loop=infinite>

In questa pagina HTML è inserito un sottofondo musicale con il tag <bgsound>.

Un metodo per avere un midi in background che funziona con entrambi i browser consiste nell'usare <embed> per Navigator ed Explorer 4 ed eventualmente <bgsound> per Explorer 3 come segue:

    <embed src="melody.mid" width=200 height=55 autostart=true loop=true hidden=true>
    <noembed>
    <bgsound src="melody.mid" loop=infinite>
    </noembed>

come ho fatto inserito in questa pagina.

Parametri supportati

Parameter Description
ID="idvalue" An identifier to be used for references in associated style sheet, hypertext links, and JavaScript code. Must begin with a letter and may include underscores. ID should be unique within the scope of the document. If duplicated, the collection of identical-ID elements may be referenced by their ordinal numbers.
LOOP="n" Specifies how many times the sound will loop.
SRC="url" Specifies the URL of the sound file. As shown above, sound files can be in any recognizable format (for example: "midi, wav, au")
VOLUME="n" Determines the loudness of the background sound. Values may range from -10,000 (weakest) to 0 (loudest). Not supported by the MAC.

OBJECT

Solo con Internet Explorer, è possibile inserire tracce sonore in una pagina web con il tag <object> che permette maggiori controlli del tag <embed>. Lo svantaggio è che occorre specificare esplicitamente la l'ID di classe del controllo ActiveMovie:

    <OBJECT CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A">
    <PARAM NAME="FileName" VALUE="romeojul.mid">
    </OBJECT>

Here, the ActiveMovie control (assuming that's what the CLSID matches) is loaded and passed the file reference. The ActiveX control parses the file name and does the downloading and playing. If the protocol is "file:", the normal asynchronous file source reader filter is invoked and the ActiveX playback behaves just as a local file playback would (except that it is embedded in the page). If the protocol is "http:", the ActiveMovie URL reader filter is used as the source.

Using this tag, certain media types can be played back using "progressive downloading," which allows the user to play back the portion of the media downloaded as the data is being downloaded.

Note that for the first release of ActiveMovie, the OBJECT tag does not support the DATA attribute, so the CLASSID attribute must always be used.

As the author of Web pages, you might want to enhance playback of your media files on the user's machine by applying specialized DirectShow filters. However, if these filters are not installed on the user's computer, you need a way to install them. Internet Explorer supports this requirement through the CODEBASE attribute of the <OBJECT> tag. This attribute specifies the path for the required file (filter) and associated cabinet (.cab) files for its automatic installation. Let's look at the following example that attempts to filter the sound track with a "gargle" filter:

    <OBJECT ID=GargleFilter1 CLASSID="CLSID:d616f350-d622-11ce-aac5-0020af0b99a3"
    CODEBASE="http://directshow/samples/gargle.cab">
    </OBJECT>

The Internet Explorer checks the target computer's registry for the specified CLSID. If not found (indicating the desired application is not installed on the computer), the browser attempts to find the file at the site specified by CODEBASE attribute and load it. These applications are related to the ActiveMovie Control and usually are filters that message the sound track before playback.

The ActiveMovie Control Properties

Microsoft ActiveMovie 1.0 SDK Contents

IMG

You can use the <IMG> tag to embed sound tracks in your Web pages, browsed by MSIE. Simply assign the media's file name to the DYNSRC attribute. The following example demonstrates it:

    <IMG start=1 loop=0 DYNSRC="romeojul.mid" SRC="../gl.gif">

The DYNSRC= attribute originated in Internet Explorer 2.0 for playing AVI files. Although it is maintained for backward compatibility, it is preferable to use the OBJECT tag. The following example demonstrates this HTML tag.

    <IMG start=1 loop=0 DYNSRC="http://amovie/samples/web/RoadRun.avi">

This case is handled by IE 3.0, which launches MCIWND directly to play back the media. The only way this is related to ActiveMovie is that the MCI ActiveMovie driver is invoked for MPG and MOV files.

Risolvere i problemi
  • Dalla parte del web server
    • Assicurarsi che il file arrivi con il tipo mime corretto (audio/midi)
  • Dalla parte del browser
    • Sintetizzatore: scheda audio oppure QuickTime
    • QuickTime Musical Instrument su Macintosh
    • Abbastanza RAM per QuickTime o il plug-in
    • Controllo volume attivato
    • Netscape Navigator
      • Macintosh: Assegnare almeno 40 Mbyte di memoria al programma
      • Scegliere un plug-in per la riproduzione midi (Macintosh: default: LiveAudio, alternativa: QuickTime)
      • Assicurarsi che il tipo Mime audio/midi corrisponda al plug-in scelto per riprodurre la musica midi
    • Internet Explorer
      • Macintosh: Assegnare almeno 10 Mbyte di memoria al programma
      • Scegliere un plug-in per la riproduzione midi (Macintosh: default: non so, alternativa: QuickTime)
      • Assicurarsi che il tipo Mime audio/midi corrisponda al plug-in scelto per riprodurre la musica midi
Dove trovare file MIDI

MIDI.NET

MIDI Farm

MidiWeb

Recommendations for Using Sound Files in CyberStudio and GoLive Documents - Support Database Zap's MUSIC-ON-THE-NET Tutorial!

Embedding Sound in Web Pages

http://www.bisset.u-net.com/*****

http://www.yamaha.co.uk/xg/html/midplug/m_mid4.htm

 
Home | Commenti a Mauro Boscarol | Ultimo aggiornamento 22 dicembre 2000