|
|
@ -10,19 +10,29 @@ void init_synth_shed() { |
|
|
|
|
|
|
|
synth_t* synth_create(const char* name) { |
|
|
|
synth_t* new = (synth_t*) malloc(sizeof(synth_t)); |
|
|
|
assert(new); |
|
|
|
if (new != NULL) { |
|
|
|
new->model_name = name; |
|
|
|
new->osc_count = 1; |
|
|
|
new->technolgy = ANALOG; |
|
|
|
new->filter.technology = ANALOG; |
|
|
|
new->filter->type = LPF; |
|
|
|
new->filter.type = LPF; |
|
|
|
} |
|
|
|
return new; |
|
|
|
} |
|
|
|
|
|
|
|
//SYNTH_STATUS synth_set_osc_count(synth_t* synth,
|
|
|
|
// int osc_count);
|
|
|
|
//
|
|
|
|
SYNTH_STATUS synth_set_osc_count(synth_t* synth, int osc_count) { |
|
|
|
assert(synth); |
|
|
|
SYNTH_STATUS status = 0; |
|
|
|
if (osc_count < 0) { |
|
|
|
status = 1; |
|
|
|
} else { |
|
|
|
synth->osc_count = osc_count; |
|
|
|
} |
|
|
|
return status; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//SYNTH_STATUS synth_set_filter(synth_t* synth,
|
|
|
|
// filter_t* filt);
|
|
|
|
//
|
|
|
@ -69,8 +79,8 @@ const char* play_synth(synth_t* synth) { |
|
|
|
|
|
|
|
const char* tech = tech_to_string(&synth->technolgy); |
|
|
|
const char* filt_tech = tech_to_string(&synth->filter.technology); |
|
|
|
const char* filt_type = filtertype_to_string(synth->filter->type); |
|
|
|
const char* filt_type = filtertype_to_string(&synth->filter.type); |
|
|
|
|
|
|
|
sprintf(ret, "%s\nnamed: %s\nosc: %s\ntech:%s\nfilt:%s / %s\n", greet, model, osc, tech, filt_tech, filt_type); |
|
|
|
sprintf(ret, "%s\nnamed: %s\nosc: %s\ntech:%s\nfilt:%s / %s\n\n", greet, model, osc, tech, filt_tech, filt_type); |
|
|
|
return strdup(ret); |
|
|
|
} |
|
|
|