Differenze tra le versioni di "Alsa e Gambas: Il Tempo della coda"

Da Gambas-it.org - Wikipedia.
(Redirect alla pagina ALSA e Gambas - Il Tempo della coda)
 
(61 versioni intermedie di uno stesso utente non sono mostrate)
Riga 1: Riga 1:
ALSA dispone di varie funzioni per poter gestire il Tempo di un brano musicale, ossia la velocità di una coda di eventi. Il Tempo pianificato degli eventi può essere definito in:
+
#REDIRECT [[ALSA_e_Gambas_-_Il_Tempo_della_coda]]
* ''Tempo reale'' (Realtime), che determina il tempo in microsecondi;
 
* ''Tick'' (PPQ - pulse per quarter note) che determina il Tempo per ''tick''.
 
 
 
<p>L'impostazione del Tempo in ''Tick'' (PPQ) definisce la risoluzione dei tick. Esso è impostato di default a 96, e vuiol dire che per ogni quarto (corrispondente ad al valore temporale in musica di una semiminima) vi sono 96 tick.</p>
 
<P>consente di modificare il tempo di quegli eventi che sono stati pianificati e temporizzati in una coda.</p>
 
<P>Il Tempo viene gestito in microsecondi per tick mediante la funzione di ALSA ''snd_seq_queue_tempo_set_tempo()''; mentre la funzione ''snd_seq_queue_tempo_set_ppq()'' imposta i tick per quarti. Solitamente, si preferisce impostare il Tempo in battute per minuto (bmp). Così, la prima funzione, sopra indicata, calcola il tempo preciso, la seconda contiene i valori per gestire il tempo sulla base delle battute per minuto.</p>
 
<BR>Da notare che l'impostazione in PPQ non può essere modificata mentre la coda sta scorrendo, pertanto quel parametro deve essere impostato prima della partenza della coda.
 
 
 
Se il Tempo è impostato The tempo (or the speed) of the scheduling queue is variable. In the case of tick queue, the tempo is controlled in the manner of MIDI. There are two parameters to define the actual tempo, PPQ (pulse per quarter note) and MIDI tempo. The former defines the base resolution of the ticks, while the latter defines the beat tempo in microseconds. As default, 96 PPQ and 120 BPM are used, respectively. That is, the tempo is set to 500000 (= 60 * 1000000 / 120). Note that PPQ cannot be changed while the queue is running. It must be set before the queue is started.
 
 
 
On the other hand, in the case of realtime queue, the time resolution is fixed to nanoseconds. There is, however, a parameter to change the speed of this queue, called skew. You can make the queue faster or slower by setting the skew value bigger or smaller. In the API, the skew is defined by two values, the skew base and the skew value. The actual skew is the fraction of them, value/base. As default, the skew base is set to 16bit (0x10000) and the skew value is the identical, so that the queue is processed as well as in the real world.
 
 
 
When the tempo of realtime queue is changed, the tempo of the associated tick queue is changed together, too. That's the reason why two queues are created always. This feature can be used to synchronize the event queue with the external synchronization source like SMPTE. In such a case, the realtime queue is skewed to match with the external source, so that both the realtime timestamp and the MIDI timestamp are synchronized.
 
 
 
For setting these tempo parameters, use snd_seq_queue_tempo_t record. For example, to set the tempo of the queue q to 48 PPQ, 60 BPM,
 

Versione attuale delle 17:37, 12 gen 2022