Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/fluidsynth/src/synth/fluid_event.c
4396 views
1
/* FluidSynth - A Software Synthesizer
2
*
3
* Copyright (C) 2003 Peter Hanappe and others.
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public License
7
* as published by the Free Software Foundation; either version 2.1 of
8
* the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free
17
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18
* 02110-1301, USA
19
*/
20
21
22
/*
23
2002 : API design by Peter Hanappe and Antoine Schmitt
24
August 2002 : Implementation by Antoine Schmitt [email protected]
25
as part of the infiniteCD author project
26
http://www.infiniteCD.org/
27
Oct4.2002 : AS : corrected bug in heap allocation, that caused a crash during sequencer free.
28
*/
29
30
31
#include "fluid_event.h"
32
#include "fluidsynth_priv.h"
33
#include "fluid_midi.h"
34
35
/***************************************************************
36
*
37
* SEQUENCER EVENTS
38
*/
39
40
/* Event alloc/free */
41
42
void
43
fluid_event_clear(fluid_event_t *evt)
44
{
45
FLUID_MEMSET(evt, 0, sizeof(fluid_event_t));
46
47
// by default, no type
48
evt->dest = -1;
49
evt->src = -1;
50
evt->type = -1;
51
evt->id = -1;
52
}
53
54
/**
55
* Create a new sequencer event structure.
56
* @return New sequencer event structure or NULL if out of memory
57
*/
58
fluid_event_t *
59
new_fluid_event(void)
60
{
61
fluid_event_t *evt;
62
63
evt = FLUID_NEW(fluid_event_t);
64
65
if(evt == NULL)
66
{
67
FLUID_LOG(FLUID_PANIC, "event: Out of memory\n");
68
return NULL;
69
}
70
71
fluid_event_clear(evt);
72
73
return(evt);
74
}
75
76
/**
77
* Delete a sequencer event structure.
78
* @param evt Sequencer event structure created by new_fluid_event().
79
*/
80
void
81
delete_fluid_event(fluid_event_t *evt)
82
{
83
fluid_return_if_fail(evt != NULL);
84
85
FLUID_FREE(evt);
86
}
87
88
/**
89
* Set the time field of a sequencer event.
90
* @internal
91
* @param evt Sequencer event structure
92
* @param time Time value to assign
93
*/
94
void
95
fluid_event_set_time(fluid_event_t *evt, unsigned int time)
96
{
97
evt->time = time;
98
}
99
100
void
101
fluid_event_set_id(fluid_event_t *evt, fluid_note_id_t id)
102
{
103
evt->id = id;
104
}
105
106
/**
107
* Set source of a sequencer event. \c src must be a unique sequencer ID or -1 if not set.
108
* @param evt Sequencer event structure
109
* @param src Unique sequencer ID
110
*/
111
void
112
fluid_event_set_source(fluid_event_t *evt, fluid_seq_id_t src)
113
{
114
evt->src = src;
115
}
116
117
/**
118
* Set destination of this sequencer event, i.e. the sequencer client this event will be sent to. \c dest must be a unique sequencer ID.
119
* @param evt Sequencer event structure
120
* @param dest The destination unique sequencer ID
121
*/
122
void
123
fluid_event_set_dest(fluid_event_t *evt, fluid_seq_id_t dest)
124
{
125
evt->dest = dest;
126
}
127
128
/**
129
* Set a sequencer event to be a timer event.
130
* @param evt Sequencer event structure
131
* @param data User supplied data pointer
132
*/
133
void
134
fluid_event_timer(fluid_event_t *evt, void *data)
135
{
136
evt->type = FLUID_SEQ_TIMER;
137
evt->data = data;
138
}
139
140
/**
141
* Set a sequencer event to be a note on event.
142
* @param evt Sequencer event structure
143
* @param channel MIDI channel number
144
* @param key MIDI note number (0-127)
145
* @param vel MIDI velocity value (0-127)
146
* @note Since fluidsynth 2.2.2, this function will give you a #FLUID_SEQ_NOTEOFF when
147
* called with @p vel being zero.
148
*/
149
void
150
fluid_event_noteon(fluid_event_t *evt, int channel, short key, short vel)
151
{
152
if(vel == 0)
153
{
154
fluid_event_noteoff(evt, channel, key);
155
return;
156
}
157
158
evt->type = FLUID_SEQ_NOTEON;
159
evt->channel = channel;
160
evt->key = key;
161
evt->vel = vel;
162
}
163
164
/**
165
* Set a sequencer event to be a note off event.
166
* @param evt Sequencer event structure
167
* @param channel MIDI channel number
168
* @param key MIDI note number (0-127)
169
*/
170
void
171
fluid_event_noteoff(fluid_event_t *evt, int channel, short key)
172
{
173
evt->type = FLUID_SEQ_NOTEOFF;
174
evt->channel = channel;
175
evt->key = key;
176
}
177
178
/**
179
* Set a sequencer event to be a note duration event.
180
*
181
* Before fluidsynth 2.2.0, this event type was naively implemented when used in conjunction with fluid_sequencer_register_fluidsynth(),
182
* because it simply enqueued a fluid_event_noteon() and fluid_event_noteoff().
183
* A handling for overlapping notes was not implemented. Starting with 2.2.0, this changes: If a fluid_event_note() is already playing,
184
* while another fluid_event_note() arrives on the same @c channel and @c key, the earlier event will be canceled.
185
* @param evt Sequencer event structure
186
* @param channel MIDI channel number
187
* @param key MIDI note number (0-127)
188
* @param vel MIDI velocity value (1-127)
189
* @param duration Duration of note in the time scale used by the sequencer
190
*
191
* @note The application should decide whether to use only Notes with duration, or separate NoteOn and NoteOff events.
192
* @warning Calling this function with @p vel or @p duration being zero results in undefined behavior!
193
*/
194
void
195
fluid_event_note(fluid_event_t *evt, int channel, short key, short vel, unsigned int duration)
196
{
197
evt->type = FLUID_SEQ_NOTE;
198
evt->channel = channel;
199
evt->key = key;
200
evt->vel = vel;
201
evt->duration = duration;
202
}
203
204
/**
205
* Set a sequencer event to be an all sounds off event.
206
* @param evt Sequencer event structure
207
* @param channel MIDI channel number
208
*/
209
void
210
fluid_event_all_sounds_off(fluid_event_t *evt, int channel)
211
{
212
evt->type = FLUID_SEQ_ALLSOUNDSOFF;
213
evt->channel = channel;
214
}
215
216
/**
217
* Set a sequencer event to be a all notes off event.
218
* @param evt Sequencer event structure
219
* @param channel MIDI channel number
220
*/
221
void
222
fluid_event_all_notes_off(fluid_event_t *evt, int channel)
223
{
224
evt->type = FLUID_SEQ_ALLNOTESOFF;
225
evt->channel = channel;
226
}
227
228
/**
229
* Set a sequencer event to be a bank select event.
230
* @param evt Sequencer event structure
231
* @param channel MIDI channel number
232
* @param bank_num MIDI bank number (0-16383)
233
*/
234
void
235
fluid_event_bank_select(fluid_event_t *evt, int channel, short bank_num)
236
{
237
evt->type = FLUID_SEQ_BANKSELECT;
238
evt->channel = channel;
239
evt->control = bank_num;
240
}
241
242
/**
243
* Set a sequencer event to be a program change event.
244
* @param evt Sequencer event structure
245
* @param channel MIDI channel number
246
* @param val MIDI program number (0-127)
247
*/
248
void
249
fluid_event_program_change(fluid_event_t *evt, int channel, int val)
250
{
251
evt->type = FLUID_SEQ_PROGRAMCHANGE;
252
evt->channel = channel;
253
evt->value = val;
254
}
255
256
/**
257
* Set a sequencer event to be a program select event.
258
* @param evt Sequencer event structure
259
* @param channel MIDI channel number
260
* @param sfont_id SoundFont ID number
261
* @param bank_num MIDI bank number (0-16383)
262
* @param preset_num MIDI preset number (0-127)
263
*/
264
void
265
fluid_event_program_select(fluid_event_t *evt, int channel,
266
unsigned int sfont_id, short bank_num, short preset_num)
267
{
268
evt->type = FLUID_SEQ_PROGRAMSELECT;
269
evt->channel = channel;
270
evt->duration = sfont_id;
271
evt->value = preset_num;
272
evt->control = bank_num;
273
}
274
275
/**
276
* Set a sequencer event to be a pitch bend event.
277
* @param evt Sequencer event structure
278
* @param channel MIDI channel number
279
* @param pitch MIDI pitch bend value (0-16383, 8192 = no bend)
280
*/
281
void
282
fluid_event_pitch_bend(fluid_event_t *evt, int channel, int pitch)
283
{
284
evt->type = FLUID_SEQ_PITCHBEND;
285
evt->channel = channel;
286
287
if(pitch < 0)
288
{
289
pitch = 0;
290
}
291
292
if(pitch > 16383)
293
{
294
pitch = 16383;
295
}
296
297
evt->pitch = pitch;
298
}
299
300
/**
301
* Set a sequencer event to be a pitch wheel sensitivity event.
302
* @param evt Sequencer event structure
303
* @param channel MIDI channel number
304
* @param value MIDI pitch wheel sensitivity value in semitones
305
*/
306
void
307
fluid_event_pitch_wheelsens(fluid_event_t *evt, int channel, int value)
308
{
309
evt->type = FLUID_SEQ_PITCHWHEELSENS;
310
evt->channel = channel;
311
evt->value = value;
312
}
313
314
/**
315
* Set a sequencer event to be a modulation event.
316
* @param evt Sequencer event structure
317
* @param channel MIDI channel number
318
* @param val MIDI modulation value (0-127)
319
*/
320
void
321
fluid_event_modulation(fluid_event_t *evt, int channel, int val)
322
{
323
evt->type = FLUID_SEQ_MODULATION;
324
evt->channel = channel;
325
326
if(val < 0)
327
{
328
val = 0;
329
}
330
331
if(val > 127)
332
{
333
val = 127;
334
}
335
336
evt->value = val;
337
}
338
339
/**
340
* Set a sequencer event to be a MIDI sustain event.
341
* @param evt Sequencer event structure
342
* @param channel MIDI channel number
343
* @param val MIDI sustain value (0-127)
344
*/
345
void
346
fluid_event_sustain(fluid_event_t *evt, int channel, int val)
347
{
348
evt->type = FLUID_SEQ_SUSTAIN;
349
evt->channel = channel;
350
351
if(val < 0)
352
{
353
val = 0;
354
}
355
356
if(val > 127)
357
{
358
val = 127;
359
}
360
361
evt->value = val;
362
}
363
364
/**
365
* Set a sequencer event to be a MIDI control change event.
366
* @param evt Sequencer event structure
367
* @param channel MIDI channel number
368
* @param control MIDI control number (0-127)
369
* @param val MIDI control value (0-127)
370
*/
371
void
372
fluid_event_control_change(fluid_event_t *evt, int channel, short control, int val)
373
{
374
evt->type = FLUID_SEQ_CONTROLCHANGE;
375
evt->channel = channel;
376
evt->control = control;
377
evt->value = val;
378
}
379
380
/**
381
* Set a sequencer event to be a stereo pan event.
382
* @param evt Sequencer event structure
383
* @param channel MIDI channel number
384
* @param val MIDI panning value (0-127, 0=left, 64 = middle, 127 = right)
385
*/
386
void
387
fluid_event_pan(fluid_event_t *evt, int channel, int val)
388
{
389
evt->type = FLUID_SEQ_PAN;
390
evt->channel = channel;
391
392
if(val < 0)
393
{
394
val = 0;
395
}
396
397
if(val > 127)
398
{
399
val = 127;
400
}
401
402
evt->value = val;
403
}
404
405
/**
406
* Set a sequencer event to be a volume event.
407
* @param evt Sequencer event structure
408
* @param channel MIDI channel number
409
* @param val Volume value (0-127)
410
*/
411
void
412
fluid_event_volume(fluid_event_t *evt, int channel, int val)
413
{
414
evt->type = FLUID_SEQ_VOLUME;
415
evt->channel = channel;
416
417
if(val < 0)
418
{
419
val = 0;
420
}
421
422
if(val > 127)
423
{
424
val = 127;
425
}
426
427
evt->value = val;
428
}
429
430
/**
431
* Set a sequencer event to be a reverb send event.
432
* @param evt Sequencer event structure
433
* @param channel MIDI channel number
434
* @param val Reverb amount (0-127)
435
*/
436
void
437
fluid_event_reverb_send(fluid_event_t *evt, int channel, int val)
438
{
439
evt->type = FLUID_SEQ_REVERBSEND;
440
evt->channel = channel;
441
442
if(val < 0)
443
{
444
val = 0;
445
}
446
447
if(val > 127)
448
{
449
val = 127;
450
}
451
452
evt->value = val;
453
}
454
455
/**
456
* Set a sequencer event to be a chorus send event.
457
* @param evt Sequencer event structure
458
* @param channel MIDI channel number
459
* @param val Chorus amount (0-127)
460
*/
461
void
462
fluid_event_chorus_send(fluid_event_t *evt, int channel, int val)
463
{
464
evt->type = FLUID_SEQ_CHORUSSEND;
465
evt->channel = channel;
466
467
if(val < 0)
468
{
469
val = 0;
470
}
471
472
if(val > 127)
473
{
474
val = 127;
475
}
476
477
evt->value = val;
478
}
479
480
481
/**
482
* Set a sequencer event to be an unregistering event.
483
* @param evt Sequencer event structure
484
* @since 1.1.0
485
*/
486
void
487
fluid_event_unregistering(fluid_event_t *evt)
488
{
489
evt->type = FLUID_SEQ_UNREGISTERING;
490
}
491
492
/**
493
* Set a sequencer event to be a scale change event.
494
* Useful for scheduling tempo changes.
495
* @param evt Sequencer event structure
496
* @param new_scale The new time scale to apply to the sequencer, see fluid_sequencer_set_time_scale()
497
* @since 2.2.0
498
*/
499
void
500
fluid_event_scale(fluid_event_t *evt, double new_scale)
501
{
502
evt->type = FLUID_SEQ_SCALE;
503
evt->scale = new_scale;
504
}
505
506
/**
507
* Set a sequencer event to be a channel-wide aftertouch event.
508
* @param evt Sequencer event structure
509
* @param channel MIDI channel number
510
* @param val Aftertouch amount (0-127)
511
* @since 1.1.0
512
*/
513
void
514
fluid_event_channel_pressure(fluid_event_t *evt, int channel, int val)
515
{
516
evt->type = FLUID_SEQ_CHANNELPRESSURE;
517
evt->channel = channel;
518
519
if(val < 0)
520
{
521
val = 0;
522
}
523
524
if(val > 127)
525
{
526
val = 127;
527
}
528
529
evt->value = val;
530
}
531
532
/**
533
* Set a sequencer event to be a polyphonic aftertouch event.
534
* @param evt Sequencer event structure
535
* @param channel MIDI channel number
536
* @param key MIDI note number (0-127)
537
* @param val Aftertouch amount (0-127)
538
* @since 2.0.0
539
*/
540
void
541
fluid_event_key_pressure(fluid_event_t *evt, int channel, short key, int val)
542
{
543
evt->type = FLUID_SEQ_KEYPRESSURE;
544
evt->channel = channel;
545
546
if(key < 0)
547
{
548
key = 0;
549
}
550
551
if(key > 127)
552
{
553
key = 127;
554
}
555
556
if(val < 0)
557
{
558
val = 0;
559
}
560
561
if(val > 127)
562
{
563
val = 127;
564
}
565
566
evt->key = key;
567
evt->value = val;
568
}
569
570
/**
571
* Set a sequencer event to be a midi system reset event.
572
* @param evt Sequencer event structure
573
* @since 1.1.0
574
*/
575
void
576
fluid_event_system_reset(fluid_event_t *evt)
577
{
578
evt->type = FLUID_SEQ_SYSTEMRESET;
579
}
580
581
/**
582
* Transforms an incoming MIDI event (from a MIDI driver or MIDI router) to a
583
* sequencer event.
584
*
585
* @param evt Sequencer event structure
586
* @param event MIDI event
587
* @return #FLUID_OK or #FLUID_FAILED
588
*
589
* @note This function copies the fields of the MIDI event into the provided
590
* sequencer event. Calling applications must create the sequencer event and set
591
* additional fields such as the source and destination of the sequencer event.
592
*
593
* @code{.cpp}
594
* // ... get MIDI event, e.g. using player_callback()
595
*
596
* // Send MIDI event to sequencer to play
597
* fluid_event_t *evt = new_fluid_event();
598
* fluid_event_set_source(evt, -1);
599
* fluid_event_set_dest(evt, seqid);
600
* fluid_event_from_midi_event(evt, event);
601
* fluid_sequencer_send_at(sequencer, evt, 50, 0); // relative time
602
* delete_fluid_event(evt);
603
* @endcode
604
*
605
* @since 2.2.7
606
*/
607
int fluid_event_from_midi_event(fluid_event_t *evt, const fluid_midi_event_t *event)
608
{
609
int chan;
610
fluid_return_val_if_fail(event != NULL, FLUID_FAILED);
611
612
chan = fluid_midi_event_get_channel(event);
613
614
switch (fluid_midi_event_get_type(event))
615
{
616
case NOTE_OFF:
617
fluid_event_noteoff(evt, chan, (short)fluid_midi_event_get_key(event));
618
break;
619
620
case NOTE_ON:
621
fluid_event_noteon(evt,
622
fluid_midi_event_get_channel(event),
623
(short)fluid_midi_event_get_key(event),
624
(short)fluid_midi_event_get_velocity(event));
625
break;
626
627
case CONTROL_CHANGE:
628
fluid_event_control_change(evt,
629
chan,
630
(short)fluid_midi_event_get_control(event),
631
(short)fluid_midi_event_get_value(event));
632
break;
633
634
case PROGRAM_CHANGE:
635
fluid_event_program_change(evt, chan, (short)fluid_midi_event_get_program(event));
636
break;
637
638
case PITCH_BEND:
639
fluid_event_pitch_bend(evt, chan, fluid_midi_event_get_pitch(event));
640
break;
641
642
case CHANNEL_PRESSURE:
643
fluid_event_channel_pressure(evt, chan, (short)fluid_midi_event_get_program(event));
644
break;
645
646
case KEY_PRESSURE:
647
fluid_event_key_pressure(evt,
648
chan,
649
(short)fluid_midi_event_get_key(event),
650
(short)fluid_midi_event_get_value(event));
651
break;
652
653
case MIDI_SYSTEM_RESET:
654
fluid_event_system_reset(evt);
655
break;
656
657
default: /* Not yet implemented */
658
return FLUID_FAILED;
659
}
660
661
return FLUID_OK;
662
}
663
664
/*
665
* Accessing event data
666
*/
667
668
/**
669
* Get the event type (#fluid_seq_event_type) field from a sequencer event structure.
670
* @param evt Sequencer event structure
671
* @return Event type (#fluid_seq_event_type).
672
*/
673
int fluid_event_get_type(fluid_event_t *evt)
674
{
675
return evt->type;
676
}
677
678
/**
679
* @internal
680
* Get the time field from a sequencer event structure.
681
* @param evt Sequencer event structure
682
* @return Time value
683
*/
684
unsigned int fluid_event_get_time(fluid_event_t *evt)
685
{
686
return evt->time;
687
}
688
689
/**
690
* @internal
691
* Get the time field from a sequencer event structure.
692
* @param evt Sequencer event structure
693
* @return Time value
694
*/
695
fluid_note_id_t fluid_event_get_id(fluid_event_t *evt)
696
{
697
return evt->id;
698
}
699
700
/**
701
* Get the source sequencer client from a sequencer event structure.
702
* @param evt Sequencer event structure
703
* @return source field of the sequencer event
704
*/
705
fluid_seq_id_t fluid_event_get_source(fluid_event_t *evt)
706
{
707
return evt->src;
708
}
709
710
/**
711
* Get the dest sequencer client from a sequencer event structure.
712
* @param evt Sequencer event structure
713
* @return dest field of the sequencer event
714
*/
715
fluid_seq_id_t fluid_event_get_dest(fluid_event_t *evt)
716
{
717
return evt->dest;
718
}
719
720
/**
721
* Get the MIDI channel field from a sequencer event structure.
722
* @param evt Sequencer event structure
723
* @return MIDI zero-based channel number
724
*/
725
int fluid_event_get_channel(fluid_event_t *evt)
726
{
727
return evt->channel;
728
}
729
730
/**
731
* Get the MIDI note field from a sequencer event structure.
732
* @param evt Sequencer event structure
733
* @return MIDI note number (0-127)
734
*/
735
short fluid_event_get_key(fluid_event_t *evt)
736
{
737
return evt->key;
738
}
739
740
/**
741
* Get the MIDI velocity field from a sequencer event structure.
742
* @param evt Sequencer event structure
743
* @return MIDI velocity value (0-127)
744
*/
745
short fluid_event_get_velocity(fluid_event_t *evt)
746
747
{
748
return evt->vel;
749
}
750
751
/**
752
* Get the MIDI control number field from a sequencer event structure.
753
* @param evt Sequencer event structure
754
* @return MIDI control number (0-127)
755
*/
756
short fluid_event_get_control(fluid_event_t *evt)
757
{
758
return evt->control;
759
}
760
761
/**
762
* Get the value field from a sequencer event structure.
763
* @param evt Sequencer event structure
764
* @return Value field of event.
765
*
766
* The Value field is used by the following event types:
767
* #FLUID_SEQ_PROGRAMCHANGE, #FLUID_SEQ_PROGRAMSELECT (preset_num),
768
* #FLUID_SEQ_PITCHWHEELSENS, #FLUID_SEQ_MODULATION, #FLUID_SEQ_SUSTAIN,
769
* #FLUID_SEQ_CONTROLCHANGE, #FLUID_SEQ_PAN, #FLUID_SEQ_VOLUME,
770
* #FLUID_SEQ_REVERBSEND, #FLUID_SEQ_CHORUSSEND.
771
*/
772
int fluid_event_get_value(fluid_event_t *evt)
773
{
774
return evt->value;
775
}
776
777
/**
778
* Get the data field from a sequencer event structure.
779
* @param evt Sequencer event structure
780
* @return Data field of event.
781
*
782
* Used by the #FLUID_SEQ_TIMER event type.
783
*/
784
void *fluid_event_get_data(fluid_event_t *evt)
785
{
786
return evt->data;
787
}
788
789
/**
790
* Get the duration field from a sequencer event structure.
791
* @param evt Sequencer event structure
792
* @return Note duration value in the time scale used by the sequencer (by default milliseconds)
793
*
794
* Used by the #FLUID_SEQ_NOTE event type.
795
*/
796
unsigned int fluid_event_get_duration(fluid_event_t *evt)
797
{
798
return evt->duration;
799
}
800
801
/**
802
* Get the MIDI bank field from a sequencer event structure.
803
* @param evt Sequencer event structure
804
* @return MIDI bank number (0-16383)
805
*
806
* Used by the #FLUID_SEQ_BANKSELECT and #FLUID_SEQ_PROGRAMSELECT
807
* event types.
808
*/
809
short fluid_event_get_bank(fluid_event_t *evt)
810
{
811
return evt->control;
812
}
813
814
/**
815
* Get the pitch field from a sequencer event structure.
816
* @param evt Sequencer event structure
817
* @return MIDI pitch bend pitch value (0-16383, 8192 = no bend)
818
*
819
* Used by the #FLUID_SEQ_PITCHBEND event type.
820
*/
821
int fluid_event_get_pitch(fluid_event_t *evt)
822
{
823
return evt->pitch;
824
}
825
826
/**
827
* Get the MIDI program field from a sequencer event structure.
828
* @param evt Sequencer event structure
829
* @return MIDI program number (0-127)
830
*
831
* Used by the #FLUID_SEQ_PROGRAMCHANGE and #FLUID_SEQ_PROGRAMSELECT
832
* event types.
833
*/
834
int
835
fluid_event_get_program(fluid_event_t *evt)
836
{
837
return evt->value;
838
}
839
840
/**
841
* Get the SoundFont ID field from a sequencer event structure.
842
* @param evt Sequencer event structure
843
* @return SoundFont identifier value.
844
*
845
* Used by the #FLUID_SEQ_PROGRAMSELECT event type.
846
*/
847
unsigned int
848
fluid_event_get_sfont_id(fluid_event_t *evt)
849
{
850
return evt->duration;
851
}
852
853
/**
854
* Gets time scale field from a sequencer event structure.
855
* @param evt Sequencer event structure
856
* @return SoundFont identifier value.
857
*
858
* Used by the #FLUID_SEQ_SCALE event type.
859
*/
860
double fluid_event_get_scale(fluid_event_t *evt)
861
{
862
return evt->scale;
863
}
864
865