// Ratiomidi converts a frequency ratio to an interval in MIDI notes.
164342
func (u *Ugen) Ratiomidi() Input {
	return unaryOpRatiomidi(u.Rate, u, u.NumOutputs)
}
25780
func (c *Context) Uniform2i(location *js.Object, x, y int) {
	c.Call("uniform2i", location, x, y)
}
161138
func (s *H264Settings) SetMinIInterval(v int64) *H264Settings {
	s.MinIInterval = &v
	return s
}
746421
func genReqID() uint64 {
	var rnd [8]byte
	rand.Read(rnd[:])
	return binary.BigEndian.Uint64(rnd[:])
}
236021
func unaryOpRatiomidi(rate int8, in Input, numOutputs int) Input {
	CheckRate(rate)
	return NewInput(UnaryOpUgenName, rate, UnaryOpRatiomidi, numOutputs, in)
}
608312
func (c Chord) Transpose(i Interval) Chord {
	chord := Chord{}
	for _, p := range c {
		chord = append(chord, p.Transpose(i))
	}
	return chord
}
744908
func NewMinusDi(timePeriod int) (indicator *MinusDi, err error) {
	ind := MinusDi{}
	ind.MinusDiWithoutStorage, err = NewMinusDiWithoutStorage(timePeriod, func(dataItem float64, streamBarIndex int) {
		ind.Data = append(ind.Data, dataItem)
	})

	return &ind, err
}
1375012
func Mfi(high, low, close, volume []float64, timePeriod int32) []float64 {
	var outBegIdx C.int
	var outNBElement C.int
	outReal := make([]float64, len(high))
	C.TA_MFI(0, C.int(len(high)-1), (*C.double)(unsafe.Pointer(&high[0])), (*C.double)(unsafe.Pointer(&low[0])), (*C.double)(unsafe.Pointer(&close[0])), (*C.double)(unsafe.Pointer(&volume[0])), C.int(timePeriod), &outBegIdx, &outNBElement, (*C.double)(unsafe.Pointer(&outReal[0])))
	return outReal[:outNBElement]
}
1089446
func (c *Corpus) IDFreq(id int) int {
	size := atomic.LoadInt64(&c.maxid)
	maxid := int(size)

	if id >= maxid {
		return 0
	}
	return c.frequencies[id]
}
1122274
func (e *domEngine) CompoByID(id string) (Compo, error) {
	e.mutex.RLock()
	defer e.mutex.RUnlock()

	c, ok := e.compoIDs[id]
	if !ok {
		return nil, ErrCompoNotMounted
	}

	return c.Compo, nil
}
248192
func IL(in string) string {
	if in == "" {
		return in
	}
	return strings.ToLower(in[:1]) + in[1:]
}
739921
func (s Scale) Transpose(i Interval) Scale {
	scale := Scale{}
	for _, transposer := range s {
		scale = append(scale, transposer.Transpose(i))
	}
	return scale
}
1226734
func InstrumentingMiddleware(extracts, overlays metrics.Counter) Middleware {
	return func(next Service) Service {
		return instrumentingMiddleware{
			extracts: extracts,
			overlays: overlays,
			next:     next,
		}
	}
}
197894
func (ctr *rowConstructor) Ratio(ratio ...float64) {
	layout := ctr.win.layout
	panelLayout(ctr.win.ctx, ctr.win, ctr.height, len(ratio), 0)

	/* calculate width of undefined widget ratios */
	r := 0.0
	n_undef := 0
	layout.Row.Ratio = ratio
	for i := range ratio {
		if ratio[i] < 0.0 {
			n_undef++
		} else {
			r += ratio[i]
		}
	}

	r = saturateFloat(1.0 - r)
	layout.Row.Type = layoutDynamic
	layout.Row.ItemWidth = 0
	layout.Row.ItemRatio = 0.0
	if r > 0 && n_undef > 0 {
		layout.Row.ItemRatio = (r / float64(n_undef))
	}

	layout.Row.ItemOffset = 0
	layout.Row.Filled = 0

}
225120
func (n Note) Transpose(i Interval) Note {
	return Note{n.Pitch.Transpose(i), n.Duration}
}
800515
func (a *Remote) ResponseMID(ctx context.Context, mid uint, v interface{}, isError ...bool) error {
	err := false
	if len(isError) > 0 {
		err = isError[0]
	}

	if mid <= 0 {
		return constants.ErrSessionOnNotify
	}

	switch d := v.(type) {
	case []byte:
		logger.Log.Debugf("Type=Response, ID=%d, MID=%d, Data=%dbytes",
			a.Session.ID(), mid, len(d))
	default:
		logger.Log.Infof("Type=Response, ID=%d, MID=%d, Data=%+v",
			a.Session.ID(), mid, v)
	}

	return a.send(pendingMessage{ctx: ctx, typ: message.Response, mid: mid, payload: v, err: err}, a.reply)
}
391377
func (d *adxl345DataFormat) ConvertToSI(rawValue int16) float64 {
	switch d.sensorRange {
	case ADXL345_RANGE_2G:
		return float64(rawValue) * 2 / 512
	case ADXL345_RANGE_4G:
		return float64(rawValue) * 4 / 512
	case ADXL345_RANGE_8G:
		return float64(rawValue) * 8 / 512
	case ADXL345_RANGE_16G:
		return float64(rawValue) * 16 / 512
	default:
		return 0
	}
}