Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

294 lines
9.9KB

  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0106
  3. header_name {.h}
  4. code_name {.cc}
  5. decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {}
  6. decl {//License: GNU GPL version 2 or later} {}
  7. decl {\#include <stdlib.h>} {public
  8. }
  9. decl {\#include <stdio.h>} {public
  10. }
  11. decl {\#include <string.h>} {public
  12. }
  13. decl {\#include <FL/Fl_File_Chooser.H>} {public
  14. }
  15. decl {\#include <FL/fl_ask.H>} {public
  16. }
  17. decl {\#include "Fl_Osc_Pane.H"} {public
  18. }
  19. decl {\#include "Fl_Osc_Value.H"} {public
  20. }
  21. decl {\#include "Fl_Osc_Check.H"} {public
  22. }
  23. decl {\#include "Fl_Osc_Counter.H"} {public
  24. }
  25. decl {\#include "Fl_Osc_Input.H"} {public
  26. }
  27. decl {\#include "Fl_Osc_Output.H"} {public
  28. }
  29. decl {\#include "../Misc/Microtonal.h"} {public
  30. }
  31. class MicrotonalUI {} {
  32. Function {make_window(Fl_Osc_Interface *osc, std::string base)} {} {
  33. Fl_Window microtonaluiwindow {
  34. label Scales
  35. xywh {99 164 405 450} type Double hide
  36. class Fl_Osc_Window
  37. } {
  38. Fl_Box {} {
  39. xywh {0 0 0 0}
  40. code0 {microtonaluiwindow->osc = osc;}
  41. code1 {microtonaluiwindow->base = base;}
  42. }
  43. Fl_Group {} {
  44. tooltip {Center where the note's freqs. are turned upside-down} xywh {249 2 155 45} box ENGRAVED_FRAME
  45. } {
  46. Fl_Check_Button {} {
  47. label {Invert keys}
  48. callback {if (o->value()==0) centerinvertcounter->deactivate();
  49. else centerinvertcounter->activate();}
  50. tooltip {Turn upside-down the note frequencies} xywh {254 13 55 30} down_box DOWN_BOX labelfont 1 labelsize 11 align 148
  51. code0 {o->init("Pinvertupdown");}
  52. class Fl_Osc_Check
  53. }
  54. Fl_Counter centerinvertcounter {
  55. label Center
  56. xywh {319 13 80 20} labelfont 1 labelsize 11 align 130 minimum 0 maximum 127 step 1 textfont 1
  57. code0 {o->lstep(12/*microtonal->getoctavesize()*/);}
  58. code1 {o->init("Pinvertupdowncenter");}
  59. class Fl_Osc_Counter
  60. }
  61. }
  62. Fl_Group microtonalgroup {selected
  63. xywh {3 49 402 398} box ENGRAVED_FRAME
  64. } {
  65. Fl_Button applybutton {
  66. label Retune
  67. callback {apply();}
  68. tooltip {Retune the synth accorging to the inputs from "Tunnings" and "Keyboard Mappings"} xywh {8 413 107 28} box THIN_UP_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13
  69. }
  70. Fl_Value_Output octavesizeoutput {
  71. label {nts./oct.}
  72. tooltip {Notes/Octave} xywh {150 423 35 17} labelsize 10 align 5 maximum 500 step 1 value 12 textfont 1
  73. code0 {o->init("octavesize");}
  74. class Fl_Osc_Output
  75. }
  76. Fl_Input nameinput {
  77. label {Name:}
  78. xywh {8 64 285 25} labelfont 1 labelsize 11 align 5
  79. code0 {o->maximum_size(MICROTONAL_MAX_NAME_LEN);}
  80. code1 {o->init("Pname");}
  81. class Fl_Osc_Input
  82. }
  83. Fl_Input tuningsinput {
  84. label {Tunings:}
  85. xywh {8 144 182 264} type Multiline labelfont 1 labelsize 11 align 5 when 2
  86. code0 {updateTuningsInput();}
  87. }
  88. Fl_Input commentinput {
  89. label {Comment:}
  90. xywh {8 104 391 25} labelfont 1 labelsize 11 align 5
  91. code0 {o->maximum_size(MICROTONAL_MAX_NAME_LEN);}
  92. code1 {o->init("Pcomment");}
  93. class Fl_Osc_Input
  94. }
  95. Fl_Counter {} {
  96. label Shift
  97. xywh {313 69 70 20} type Simple labelsize 11 align 1 minimum -64 maximum 63 step 1 textfont 1
  98. code0 {o->init("Pscaleshift");}
  99. class Fl_Osc_Counter
  100. }
  101. Fl_Button {} {
  102. label {Import .SCL file}
  103. callback {/*const char *filename;
  104. filename=fl_file_chooser("Open:","(*.scl)",NULL,0);
  105. if (filename==NULL) return;
  106. int result=microtonal->loadscl(filename);
  107. if (result==0) {
  108. updateTuningsInput();
  109. nameinput->cut(0,nameinput->maximum_size());
  110. nameinput->insert((char *)microtonal->Pname);
  111. nameinput->position(0);
  112. commentinput->cut(0,commentinput->maximum_size());
  113. commentinput->insert((char *)microtonal->Pname);
  114. commentinput->position(0);
  115. tuningsinput->position(0);
  116. octavesizeoutput->do_callback();
  117. } else {
  118. fl_alert("Error: Could not load the file.");
  119. };*/}
  120. tooltip {Inport Scala .scl file (tunnings)} xywh {243 411 84 15} box THIN_UP_BOX labelfont 1 labelsize 10
  121. }
  122. Fl_Group keymappinggroup {
  123. label {Keyboard Mapping} open
  124. xywh {193 144 206 264} box ENGRAVED_BOX labelfont 1 labelsize 11
  125. } {
  126. Fl_Input mappinginput {
  127. xywh {250 147 146 258} type Multiline labelfont 1 labelsize 11 align 5 when 2
  128. code0 {updateMappingInput();}
  129. }
  130. Fl_Counter firstnotecounter {
  131. label {First note}
  132. tooltip {First MIDI note number} xywh {199 195 42 18} type Simple labelsize 10 align 5 minimum 0 maximum 127 step 1 textfont 1 textsize 11
  133. code0 {o->init("Pfirstkey");}
  134. class Fl_Osc_Counter
  135. }
  136. Fl_Counter lastnotecounter {
  137. label {Last note}
  138. tooltip {Last MIDI note number} xywh {199 225 42 18} type Simple labelsize 10 align 5 minimum 0 maximum 127 step 1 value 127 textfont 1 textsize 11
  139. code0 {o->init("Plastkey");}
  140. class Fl_Osc_Counter
  141. }
  142. Fl_Counter middlenotecounter {
  143. label {Midle note}
  144. tooltip {Midle note (where scale degree 0 is mapped to)} xywh {199 267 42 18} type Simple labelsize 10 align 5 minimum 0 maximum 127 step 1 value 60 textfont 1 textsize 11
  145. code0 {o->init("Pmiddlenote");}
  146. class Fl_Osc_Counter
  147. }
  148. Fl_Value_Output mapsizeoutput {
  149. label {Map Size}
  150. xywh {201 382 44 20} labelsize 10 align 5 maximum 500 step 1 value 12 textfont 1
  151. code0 {o->init("Pmapsize");}
  152. class Fl_Osc_Output
  153. }
  154. }
  155. Fl_Check_Button mappingenabledbutton {
  156. label ON
  157. callback {if (o->value()==0) keymappinggroup->deactivate();
  158. else keymappinggroup->activate();
  159. o->show();}
  160. tooltip {Enable the Mapping (otherwise the mapping is linear)} xywh {198 150 48 21} box FLAT_BOX down_box DOWN_BOX labelfont 1
  161. code0 {o->init("Pmappingenabled");}
  162. class Fl_Osc_Check
  163. }
  164. Fl_Button {} {
  165. label {Import .kbm file}
  166. callback {
  167. //TODO Disabled until this can be moved into middleware
  168. /*const char *filename;
  169. filename=fl_file_chooser("Open:","(*.kbm)",NULL,0);
  170. if (filename==NULL) return;
  171. int result=microtonal->loadkbm(filename);
  172. if (result==0) {
  173. updateMappingInput();
  174. mappinginput->position(0);
  175. mapsizeoutput->update();
  176. firstnotecounter->update();
  177. lastnotecounter->update();
  178. middlenotecounter->update();
  179. mappingenabledbutton->update();
  180. afreqinput->update();
  181. anotecounter->update();
  182. } else {
  183. fl_alert("Error: Could not load the file.");
  184. };*/}
  185. tooltip {Inport Scala .kbm file (keyboard mapping)} xywh {243 428 84 16} box THIN_UP_BOX labelfont 1 labelsize 10
  186. }
  187. }
  188. Fl_Group {} {
  189. xywh {108 2 140 45} box ENGRAVED_FRAME
  190. } {
  191. Fl_Counter anotecounter {
  192. label {"A" Note}
  193. callback {
  194. /*if (microtonal->getnotefreq(o->value(),0)<0.0) o->textcolor(FL_RED);
  195. else o->textcolor(FL_BLACK);*/
  196. o->redraw();}
  197. tooltip {The "A" note (the reference note for which freq. ("A" freq) is given)} xywh {173 17 65 20} labelfont 1 labelsize 10 align 129 minimum 0 maximum 127 step 1 value 69 textfont 1 textsize 10
  198. code0 {o->lstep(12);}
  199. code1 {o->init("PAnote");}
  200. class Fl_Osc_Counter
  201. }
  202. Fl_Value_Input afreqinput {
  203. label {"A" Freq.}
  204. tooltip {The freq. of "A" note (default=440.0)} xywh {118 17 45 20} labelfont 1 labelsize 10 align 1 minimum 1 maximum 20000 step 0.001 value 440 textfont 1 textsize 10
  205. code0 {o->init("PAfreq");}
  206. class Fl_Osc_Value
  207. }
  208. }
  209. Fl_Button {} {
  210. label Close
  211. callback {microtonaluiwindow->hide();}
  212. xywh {333 413 67 28} box THIN_UP_BOX
  213. }
  214. Fl_Check_Button {} {
  215. label {Enable Microtonal}
  216. callback {if (o->value()==0) microtonalgroup->deactivate();
  217. else microtonalgroup->activate();}
  218. xywh {3 3 102 45} box UP_BOX down_box DOWN_BOX labelfont 1 labelsize 11 align 148
  219. code0 {o->init("Penabled");}
  220. class Fl_Osc_Check
  221. }
  222. }
  223. }
  224. Function {updateTuningsInput()} {} {
  225. code {char *tmpbuf=new char[100];
  226. /*
  227. tuningsinput->cut(0,tuningsinput->maximum_size());
  228. for (int i=0;i<microtonal->getoctavesize();i++){
  229. if (i!=0) tuningsinput->insert("\\n");
  230. microtonal->tuningtoline(i,tmpbuf,100);
  231. tuningsinput->insert(tmpbuf);
  232. };
  233. */
  234. delete []tmpbuf;} {}
  235. }
  236. Function {updateMappingInput()} {} {
  237. code {char *tmpbuf=new char[100];
  238. /*
  239. mappinginput->cut(0,tuningsinput->maximum_size());
  240. for (int i=0;i<microtonal->Pmapsize;i++){
  241. if (i!=0) mappinginput->insert("\\n");
  242. if ((microtonal->Pmapping[i])==-1)
  243. snprintf(tmpbuf,100,"x");
  244. else snprintf(tmpbuf,100,"%d",microtonal->Pmapping[i]);
  245. mappinginput->insert(tmpbuf);
  246. };
  247. */
  248. delete []tmpbuf;} {}
  249. }
  250. Function {MicrotonalUI(Fl_Osc_Interface *osc, std::string base)} {} {
  251. code {make_window(osc, base);} {}
  252. }
  253. Function {~MicrotonalUI()} {} {
  254. code {microtonaluiwindow->hide();
  255. delete(microtonaluiwindow);} {}
  256. }
  257. Function {show()} {} {
  258. code {microtonaluiwindow->show();} {}
  259. }
  260. Function {apply()} {} {
  261. code {/*int err=microtonal->texttotunings(tuningsinput->value());
  262. if (err>=0) fl_alert("Parse Error: The input may contain only numbers (like 232.59)\\n or divisions (like 121/64).");
  263. if (err==-2) fl_alert("Parse Error: The input is empty.");
  264. octavesizeoutput->do_callback();
  265. microtonal->texttomapping(mappinginput->value());
  266. mapsizeoutput->do_callback();
  267. anotecounter->do_callback();
  268. */
  269. //applybutton->color(FL_GRAY);} {}
  270. }
  271. }