[openbeos-midi] Re: Synth Volume Help Required

  • From: cyanh256@xxxxxxxxxxxx
  • To: openbeos-midi@xxxxxxxxxxxxx
  • Date: Mon, 03 Dec 2007 18:41:24 GMT

>  From the outset, all I want to achieve is an understanding of the 
> midiKit API so the most obvoius starting point
> for me is to write a small app that can play back a smf using the 
> softsynth.

That sounds like a reasonable way to start. Bear in mind
there's two versions of the MIDI kit -- version1, and 'midi2'.
I recommend using the latter, because the older one is obsolete
and doesn't support the various nice features of midi2 (like the
ability to apply a custom icon to each MIDI port).

> I, quite literally, have an all or nothing situation with the slider: 
> silence to speaker damage with just a small increment in the slider 
> position.

Hmm, that sounds like a problem with the range of the slider.
From what I recall, sliders are always based on integers,
with each "click" of the slider being a new integer.
That's okay for SysEx master volume messages (which have
16384 possible volume steps).

If you're using a different method of setting the volume, check
to see what range it's expecting -- it's quite common to have
a floating point argument when working with digital audio,
where 0 is off, and 1 is full volume (0dB). In this case, you'd
need to cast the slider's value to a float, and divide it by
the number of steps the slider has.

- Cyan

Other related posts: