// receive controller value changes from host and set them to controller void Widget::set_value(uint32_t port_index, uint32_t format, const void * buffer) { if ( format == 0 ) { float value = *static_cast<const float*>(buffer); Gxw::Regler *regler = static_cast<Gxw::Regler*>( get_controller_by_port(port_index)); if (regler) regler->cp_set_value(value); if (port_index == FREQ) m_tuner.set_freq(value); if (port_index == REFFREQ) m_tuner.set_reference_pitch(value); if (port_index == TUNEMODE) set_tuning(value); if (port_index == TEMPERAMENT) set_temperament(); if (port_index == MAXL) refresh_meter_level(value); } }
// write (UI) controller value changes to the host->engine void Widget::on_value_changed(uint32_t port_index) { Gxw::Regler *regler = static_cast<Gxw::Regler*>( get_controller_by_port(port_index)); if (regler) { float value = regler->cp_get_value(); write_function(controller, port_index, sizeof(float), 0, static_cast<const void*>(&value)); if (port_index == TUNEMODE) set_tuning(value); if (port_index == TEMPERAMENT) set_temperament(); if (port_index == REFFREQ) m_tuner.set_reference_pitch(value); } if (port_index == RESET) { write_function(controller, RESET, sizeof(float), 0, static_cast<const void*>(&reset)); } }
void reset_synth_channels (void) { // select bank 0 and preset 0 in the soundfont we just loaded on channel 0 fluid_synth_program_select (synth, 0, sfont_id, 0, 0); gint i; for (i = 0; i < 16; i++) fluid_synth_program_change (synth, i, 0); if (Denemo.project && Denemo.project->movement) { DenemoMovement *si = Denemo.project->movement; GList *curstaff; for (curstaff = si->thescore; curstaff; curstaff=curstaff->next) { DenemoStaff *curstaffstruct = (DenemoStaff *) curstaff->data;//g_print ("Reset staff program chan %d to prog %d\n", curstaffstruct->midi_channel, curstaffstruct->midi_prognum); fluid_synth_program_change (synth, curstaffstruct->midi_channel, curstaffstruct->midi_prognum); } } if (Denemo.prefs.pitchspellingchannel) fluid_synth_program_change (synth, Denemo.prefs.pitchspellingchannel, Denemo.prefs.pitchspellingprogram); set_tuning (); }
void Widget::set_temperament() { m_tuner.set_temperament(tuner_temperament.cp_get_value()); set_tuning(tuner_tuning.cp_get_value()); }