|
|
@ -8,17 +8,19 @@ void init_synth_shed() { |
|
|
|
printf("init_synth_shed() - called\n"); |
|
|
|
} |
|
|
|
|
|
|
|
synth_t* synth_create(const char* name) { |
|
|
|
synth_t* new = (synth_t*) malloc(sizeof(synth_t)); |
|
|
|
assert(new); |
|
|
|
if (new != NULL) { |
|
|
|
new->model_name = "TESTNAME"; |
|
|
|
new->osc_count = 1; |
|
|
|
new->technolgy = ANALOG; |
|
|
|
new->filter.technology = ANALOG; |
|
|
|
new->filter.type = LPF; |
|
|
|
synth_t* synth_create(const char* brand, const char* model, int osc_count) { |
|
|
|
printf("%s::%s brand:'%s, model: %s'\n",__FILE__, __FUNCTION__, brand, model); |
|
|
|
synth_t* new_synth = (synth_t*) malloc(sizeof(synth_t)); |
|
|
|
assert(new_synth); |
|
|
|
if (new_synth != NULL) { |
|
|
|
new_synth->brand = brand; |
|
|
|
new_synth->model = model; |
|
|
|
new_synth->osc_count = osc_count; |
|
|
|
new_synth->technolgy = ANALOG; |
|
|
|
new_synth->filter.technology = ANALOG; |
|
|
|
new_synth->filter.type = LPF; |
|
|
|
} |
|
|
|
return new; |
|
|
|
return new_synth; |
|
|
|
} |
|
|
|
|
|
|
|
SYNTH_STATUS synth_set_osc_count(synth_t* synth, int osc_count) { |
|
|
@ -33,11 +35,9 @@ SYNTH_STATUS synth_set_osc_count(synth_t* synth, int osc_count) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//SYNTH_STATUS synth_set_filter(synth_t* synth,
|
|
|
|
// filter_t* filt);
|
|
|
|
//
|
|
|
|
//SYNTH_STATUS synth_set_tech(synth_t* synth,
|
|
|
|
// tech_t tech);
|
|
|
|
//SYNTH_STATUS synth_set_filter(synth_t* synth, filter_t* filt);
|
|
|
|
|
|
|
|
//SYNTH_STATUS synth_set_tech(synth_t* synth, tech_t tech);
|
|
|
|
|
|
|
|
const char* tech_to_string(const enum _tech* tech) { |
|
|
|
assert(tech); |
|
|
@ -72,7 +72,8 @@ const char* play_synth(synth_t* synth) { |
|
|
|
assert(synth); |
|
|
|
char ret[9999]; |
|
|
|
const char* greet = "Playing synth:"; |
|
|
|
const char* model = synth->model_name; |
|
|
|
const char* brand = synth->brand; |
|
|
|
const char* model = synth->model; |
|
|
|
|
|
|
|
char osc[4]; |
|
|
|
sprintf(osc, "%i", synth->osc_count); |
|
|
@ -81,6 +82,6 @@ const char* play_synth(synth_t* synth) { |
|
|
|
const char* filt_tech = tech_to_string(&synth->filter.technology); |
|
|
|
const char* filt_type = filtertype_to_string(&synth->filter.type); |
|
|
|
|
|
|
|
sprintf(ret, "%s\nnamed: %s\nosc: %s\ntech:%s\nfilt:%s / %s\n\n", greet, model, osc, tech, filt_tech, filt_type); |
|
|
|
sprintf(ret, "%s\nbrand: %s\nmodel: %s\nosc: %s\ntech:%s\nfilt:%s / %s\n\n", greet, brand,model, osc, tech, filt_tech, filt_type); |
|
|
|
return strdup(ret); |
|
|
|
} |
|
|
|