Exemplo n.º 1
0
static void menu_cb_fontSize (EDITOR_ARGS) {
	EDITOR_IAM (HyperPage);
	EDITOR_FORM (L"Font size", 0)
		NATURAL (L"Font size (points)", L"12")
	EDITOR_OK
		SET_INTEGER (L"Font size", my fontSize)
	EDITOR_DO
		setFontSize (me, GET_INTEGER (L"Font size"));
	EDITOR_END
}
Exemplo n.º 2
0
static void menu_cb_selectFormantOrBandwidth (EDITOR_ARGS) {
	EDITOR_IAM (FormantGridEditor);
	EDITOR_FORM (U"Select formant or bandwidth", 0)
		NATURAL (U"Formant number", U"1")
	EDITOR_OK
		SET_INTEGER (U"Formant number", my selectedFormant)
	EDITOR_DO
		selectFormantOrBandwidth (me, GET_INTEGER (U"Formant number"));
		FunctionEditor_redraw (me);
	EDITOR_END
}
Exemplo n.º 3
0
static void menu_cb_searchForPageList (Manual me, EDITOR_ARGS_FORM) {
	EDITOR_FORM (U"Search for page", nullptr)
		ManPages manPages = (ManPages) my data;
		long numberOfPages;
		const char32 **pages = ManPages_getTitles (manPages, & numberOfPages);
		LIST (U"Page", manPages -> pages.size, pages, 1)
	EDITOR_OK
	EDITOR_DO
		HyperPage_goToPage_i (me, GET_INTEGER (U"Page"));
	EDITOR_END
}
Exemplo n.º 4
0
static void menu_cb_preferences (TableEditor me, EDITOR_ARGS_FORM) {
	EDITOR_FORM (U"TableEditor preferences", nullptr);
		OPTIONMENU (U"The symbols %#_^ in labels", my default_useTextStyles () + 1)
			OPTION (U"are shown as typed")
			OPTION (U"mean italic/bold/sub/super")
	EDITOR_OK
		SET_INTEGER (U"The symbols %#_^ in labels", my p_useTextStyles + 1)
	EDITOR_DO
		my pref_useTextStyles () = my p_useTextStyles = GET_INTEGER (U"The symbols %#_^ in labels") - 1;
		Graphics_updateWs (my graphics.get());
	EDITOR_END
}
Exemplo n.º 5
0
static void menu_cb_searchForPageList (EDITOR_ARGS) {
	EDITOR_IAM (Manual);
	EDITOR_FORM (L"Search for page", 0)
		ManPages manPages = (ManPages) my data;
		long numberOfPages;
		const wchar_t **pages = ManPages_getTitles (manPages, & numberOfPages);
		LIST (L"Page", manPages -> pages -> size, pages, 1)
	EDITOR_OK
	EDITOR_DO
		HyperPage_goToPage_i (me, GET_INTEGER (L"Page"));
	EDITOR_END
}
Exemplo n.º 6
0
static void menu_cb_DrawVisibleSound (TimeSoundEditor me, EDITOR_ARGS_FORM) {
	EDITOR_FORM (U"Draw visible sound", nullptr)
		my v_form_pictureWindow (cmd);
		LABEL (U"", U"Sound:")
		BOOLEAN (U"Preserve times", my default_picture_preserveTimes ());
		REAL (U"left Vertical range", my default_picture_bottom ())
		REAL (U"right Vertical range", my default_picture_top ())
		my v_form_pictureMargins (cmd);
		my v_form_pictureSelection (cmd);
		BOOLEAN (U"Garnish", my default_picture_garnish ());
	EDITOR_OK
		my v_ok_pictureWindow (cmd);
		SET_INTEGER (U"Preserve times", my pref_picture_preserveTimes ());
		SET_REAL (U"left Vertical range", my pref_picture_bottom ());
		SET_REAL (U"right Vertical range", my pref_picture_top ());
		my v_ok_pictureMargins (cmd);
		my v_ok_pictureSelection (cmd);
		SET_INTEGER (U"Garnish", my pref_picture_garnish ());
	EDITOR_DO
		my v_do_pictureWindow (cmd);
		my pref_picture_preserveTimes () = GET_INTEGER (U"Preserve times");
		my pref_picture_bottom () = GET_REAL (U"left Vertical range");
		my pref_picture_top () = GET_REAL (U"right Vertical range");
		my v_do_pictureMargins (cmd);
		my v_do_pictureSelection (cmd);
		my pref_picture_garnish () = GET_INTEGER (U"Garnish");
		if (! my d_longSound.data && ! my d_sound.data)
			Melder_throw (U"There is no sound to draw.");
		autoSound publish = my d_longSound.data ?
			LongSound_extractPart (my d_longSound.data, my d_startWindow, my d_endWindow, my pref_picture_preserveTimes ()) :
			Sound_extractPart (my d_sound.data, my d_startWindow, my d_endWindow, kSound_windowShape_RECTANGULAR, 1.0, my pref_picture_preserveTimes ());
		Editor_openPraatPicture (me);
		Sound_draw (publish.peek(), my pictureGraphics, 0.0, 0.0, my pref_picture_bottom (), my pref_picture_top (),
			my pref_picture_garnish (), U"Curve");
		FunctionEditor_garnish (me);
		Editor_closePraatPicture (me);
	EDITOR_END
}
Exemplo n.º 7
0
static void menu_cb_font (EDITOR_ARGS) {
	EDITOR_IAM (HyperPage);
	EDITOR_FORM (L"Font", 0)
		RADIO (L"Font", 1)
			RADIOBUTTON (L"Times")
			RADIOBUTTON (L"Helvetica")
	EDITOR_OK
		SET_INTEGER (L"Font", my font == kGraphics_font_TIMES ? 1 :
				my font == kGraphics_font_HELVETICA ? 2 : my font == kGraphics_font_PALATINO ? 3 : 1);
	EDITOR_DO
		int font = GET_INTEGER (L"Font");
		prefs_font = my font = font == 1 ? kGraphics_font_TIMES : kGraphics_font_HELVETICA;
		if (my g) Graphics_updateWs (my g);
	EDITOR_END
}
Exemplo n.º 8
0
static int DeviceProperties(lua_State *L)
    {
    int table_index, val;
    lua_newtable(L);
    table_index = lua_gettop(L);
#define GET_BOOLEAN(s, code) do {                       \
    val = glutDeviceGet(code) == GL_TRUE ? 1 : 0;       \
    lua_pushboolean(L, val);                            \
    lua_setfield(L, table_index, (s));                  \
} while(0)
#define GET_INTEGER(s, code) do {                       \
    val = glutDeviceGet(code);                          \
    lua_pushinteger(L, val);                            \
    lua_setfield(L, table_index, (s));                  \
} while(0)
    
    GET_BOOLEAN("has_keyboard", GLUT_HAS_KEYBOARD);
    GET_BOOLEAN("has_mouse", GLUT_HAS_MOUSE);
    GET_INTEGER("num_mouse_buttons", GLUT_NUM_MOUSE_BUTTONS);

    GET_BOOLEAN("has_tablet", GLUT_HAS_TABLET);
    GET_INTEGER("num_tablet_buttons", GLUT_NUM_TABLET_BUTTONS);

    GET_BOOLEAN("device_ignore_key_repeat", GLUT_DEVICE_IGNORE_KEY_REPEAT);
    GET_BOOLEAN("device_key_repeat", GLUT_DEVICE_KEY_REPEAT);

    GET_BOOLEAN("has_spaceball", GLUT_HAS_SPACEBALL);
    GET_INTEGER("num_spaceball_buttons", GLUT_NUM_SPACEBALL_BUTTONS);

    GET_BOOLEAN("has_dial_and_button_box", GLUT_HAS_DIAL_AND_BUTTON_BOX);
    GET_INTEGER("num_button_box_buttons", GLUT_NUM_BUTTON_BOX_BUTTONS);
    GET_INTEGER("num_dials", GLUT_NUM_DIALS);

    GET_BOOLEAN("has_joystick", GLUT_HAS_JOYSTICK);
    GET_BOOLEAN("owns_joystick", GLUT_OWNS_JOYSTICK);
    GET_INTEGER("joystick_buttons", GLUT_JOYSTICK_BUTTONS);
    GET_INTEGER("joystick_axes", GLUT_JOYSTICK_AXES);
    GET_INTEGER("joystick_poll_rate", GLUT_JOYSTICK_POLL_RATE);
    return 1;
#undef GET_BOOLEAN
#undef GET_INTEGER
    }
Exemplo n.º 9
0
static void menu_cb_learnOneFromPartialOutput (EDITOR_ARGS) {
	EDITOR_IAM (OTGrammarEditor);
	EDITOR_FORM (U"Learn one from partial adult output", 0)
		LABEL (U"", U"Partial adult surface form (e.g. overt form):")
		SENTENCE (U"Partial output", U"")
		REAL (U"Evaluation noise", U"2.0")
		OPTIONMENU_ENUM (U"Update rule", kOTGrammar_rerankingStrategy, kOTGrammar_rerankingStrategy_SYMMETRIC_ALL)
		REAL (U"Plasticity", U"0.1")
		REAL (U"Rel. plasticity spreading", U"0.1")
		BOOLEAN (U"Honour local rankings", 1)
		NATURAL (U"Number of chews", U"1")
	EDITOR_OK
	EDITOR_DO
		Editor_save (me, U"Learn one from partial output");
		OTGrammar_learnOneFromPartialOutput ((OTGrammar) my data, GET_STRING (U"Partial output"),
			GET_REAL (U"Evaluation noise"), GET_ENUM (kOTGrammar_rerankingStrategy, U"Update rule"), GET_INTEGER (U"Honour local rankings"),
			GET_REAL (U"Plasticity"), GET_REAL (U"Rel. plasticity spreading"), GET_INTEGER (U"Number of chews"), TRUE);
		OTGrammar_sort ((OTGrammar) my data);
		Graphics_updateWs (my g);
		Editor_broadcastDataChanged (me);
	EDITOR_END
}
Exemplo n.º 10
0
static void menu_cb_ExtractSelectedSound_windowed (TimeSoundEditor me, EDITOR_ARGS_FORM) {
	EDITOR_FORM (U"Extract selected sound (windowed)", nullptr)
		WORD (U"Name", U"slice")
		OPTIONMENU_ENUM (U"Window shape", kSound_windowShape, my default_extract_windowShape ())
		POSITIVE (U"Relative width", my default_extract_relativeWidth ())
		BOOLEAN (U"Preserve times", my default_extract_preserveTimes ())
	EDITOR_OK
		SET_ENUM (U"Window shape", kSound_windowShape, my pref_extract_windowShape ())
		SET_REAL (U"Relative width", my pref_extract_relativeWidth ())
		SET_INTEGER (U"Preserve times", my pref_extract_preserveTimes ())
	EDITOR_DO
		Sound sound = my d_sound.data;
		Melder_assert (sound);
		my pref_extract_windowShape () = GET_ENUM (kSound_windowShape, U"Window shape");
		my pref_extract_relativeWidth () = GET_REAL (U"Relative width");
		my pref_extract_preserveTimes () = GET_INTEGER (U"Preserve times");
		autoSound extract = Sound_extractPart (sound, my d_startSelection, my d_endSelection, my pref_extract_windowShape (),
			my pref_extract_relativeWidth (), my pref_extract_preserveTimes ());
		Thing_setName (extract.peek(), GET_STRING (U"Name"));
		Editor_broadcastPublication (me, extract.transfer());
	EDITOR_END
}
Exemplo n.º 11
0
static void menu_cb_addToFixedMenu (ScriptEditor me, EDITOR_ARGS_FORM) {
	EDITOR_FORM (U"Add to fixed menu", U"Add to fixed menu...");
		RADIO (U"Window", 1)
			RADIOBUTTON (U"Objects")
			RADIOBUTTON (U"Picture")
		SENTENCE (U"Menu", U"New")
		SENTENCE (U"Command", U"Do it...")
		SENTENCE (U"After command", U"")
		INTEGER (U"Depth", U"0")
		LABEL (U"", U"Script file:")
		TEXTFIELD (U"Script", U"")
	EDITOR_OK
		if (my name [0])
			SET_STRING (U"Script", my name)
		else
			SET_STRING (U"Script", U"(please save your script first)")
	EDITOR_DO
		praat_addMenuCommandScript (GET_STRING (U"Window"),
			GET_STRING (U"Menu"), GET_STRING (U"Command"), GET_STRING (U"After command"),
			GET_INTEGER (U"Depth"), GET_STRING (U"Script"));
		praat_show ();
	EDITOR_END
}
Exemplo n.º 12
0
static void menu_cb_addToMenu (EDITOR_ARGS) {
	EDITOR_IAM (ScriptEditor);
	EDITOR_FORM (U"Add to menu", U"Add to fixed menu...")
		WORD (U"Window", U"?")
		SENTENCE (U"Menu", U"File")
		SENTENCE (U"Command", U"Do it...")
		SENTENCE (U"After command", U"")
		INTEGER (U"Depth", U"0")
		LABEL (U"", U"Script file:")
		TEXTFIELD (U"Script", U"")
	EDITOR_OK
		if (my editorClass) SET_STRING (U"Window", my editorClass -> className)
		if (my name [0])
			SET_STRING (U"Script", my name)
		else
			SET_STRING (U"Script", U"(please save your script first)")
	EDITOR_DO
		praat_addMenuCommandScript (GET_STRING (U"Window"),
			GET_STRING (U"Menu"), GET_STRING (U"Command"), GET_STRING (U"After command"),
			GET_INTEGER (U"Depth"), GET_STRING (U"Script"));
		praat_show ();
	EDITOR_END
}
Exemplo n.º 13
0
static void menu_cb_pathFinder (EDITOR_ARGS) {
    EDITOR_IAM (PitchEditor);
    EDITOR_FORM (L"Path finder", 0)
    REAL (L"Silence threshold", L"0.03")
    REAL (L"Voicing threshold", L"0.45")
    REAL (L"Octave cost", L"0.01")
    REAL (L"Octave-jump cost", L"0.35")
    REAL (L"Voiced/unvoiced cost", L"0.14")
    POSITIVE (L"Ceiling (Hz)", L"600")
    BOOLEAN (L"Pull formants", 0)
    EDITOR_OK
    Pitch pitch = (Pitch) my data;
    SET_REAL (L"Ceiling", pitch -> ceiling)
    EDITOR_DO
    Pitch pitch = (Pitch) my data;
    Editor_save (me, L"Path finder");
    Pitch_pathFinder (pitch,
                      GET_REAL (L"Silence threshold"), GET_REAL (L"Voicing threshold"),
                      GET_REAL (L"Octave cost"), GET_REAL (L"Octave-jump cost"),
                      GET_REAL (L"Voiced/unvoiced cost"), GET_REAL (L"Ceiling"), GET_INTEGER (L"Pull formants"));
    FunctionEditor_redraw (me);
    my broadcastDataChanged ();
    EDITOR_END
}
Exemplo n.º 14
0
static void menu_cb_learnOne (EDITOR_ARGS) {
	EDITOR_IAM (OTMultiEditor);
	EDITOR_FORM (U"Learn one", U"OTGrammar: Learn one...")
		OPTIONMENU_ENUM (U"Update rule", kOTGrammar_rerankingStrategy, kOTGrammar_rerankingStrategy_SYMMETRIC_ALL)
		OPTIONMENU (U"Direction", 3)
			OPTION (U"forward")
			OPTION (U"backward")
			OPTION (U"bidirectionally")
		REAL (U"Plasticity", U"0.1")
		REAL (U"Rel. plasticity spreading", U"0.1")
	EDITOR_OK
	EDITOR_DO
		Editor_save (me, U"Learn one");
		Melder_free (my form1);
		Melder_free (my form2);
		my form1 = GuiText_getString (my form1Text);
		my form2 = GuiText_getString (my form2Text);
		OTMulti_learnOne ((OTMulti) my data, my form1, my form2,
			GET_ENUM (kOTGrammar_rerankingStrategy, U"Update rule"), GET_INTEGER (U"Direction"),
			GET_REAL (U"Plasticity"), GET_REAL (U"Rel. plasticity spreading"));
		Graphics_updateWs (my g);
		Editor_broadcastDataChanged (me);
	EDITOR_END
}
	RADIOBUTTON (L"no restriction")
	RADIOBUTTON (L"1/3 < slope < 3")
	RADIOBUTTON (L"1/2 < slope < 2")
	RADIOBUTTON (L"2/3 < slope < 3/2")
	OK
DO
	Cepstrumc c1 = 0, c2 = 0;
	LOOP {
		iam (Cepstrumc);
		(c1 ? c2 : c1) = me;
	}
	Melder_assert (c1 && c2);
	praat_new (Cepstrumc_to_DTW (c1, c2, GET_REAL (L"Cepstral weight"),
		GET_REAL (L"Log energy weight"), GET_REAL (L"Regression weight"),
		GET_REAL (L"Regression weight log energy"), GET_REAL (L"Window for regression coefficients"),
		GET_INTEGER (L"Match begin positions"), GET_INTEGER (L"Match end positions"),
		GET_INTEGER (L"Slope constraints")), c1->name, L"_", c2->name);
END

DIRECT (Cepstrumc_to_Matrix)
	LOOP {
		iam (Cepstrumc);
		praat_new (Cepstrumc_to_Matrix (me), my name);
	}
END

/******************** Formant ********************************************/

FORM (Formant_to_LPC, L"Formant: To LPC", 0)
	POSITIVE (L"Sampling frequency (Hz)", L"16000.0")
	OK
Exemplo n.º 16
0
FORM (GaussianMixture_drawConcentrationEllipses, L"GaussianMixture: Draw concentration ellipses",
	L"GaussianMixture: Draw concentration ellipses...")
	POSITIVE (L"Number of sigmas", L"1.0")
	BOOLEAN (L"Principal component plane", 1)
	INTEGER (L"X-dimension", L"1")
	INTEGER (L"Y-dimension", L"2")
	REAL (L"left Horizontal range", L"0.0")
	REAL (L"right Horizontal range", L"0.0")
	REAL (L"left Vertical range", L"0.0")
	REAL (L"right Vertical range", L"0.0")
	INTEGER (L"Label size", L"12")
	BOOLEAN (L"Garnish", 1)
	OK
DO
	EVERY_DRAW (GaussianMixture_drawConcentrationEllipses ((structGaussianMixture *)OBJECT, GRAPHICS,
		GET_REAL (L"Number of sigmas"), 0, NULL, GET_INTEGER (L"Principal component plane"),
		GET_INTEGER (L"X-dimension"), GET_INTEGER (L"Y-dimension"),
		GET_REAL (L"left Horizontal range"), GET_REAL (L"right Horizontal range"),
		GET_REAL (L"left Vertical range"), GET_REAL (L"right Vertical range"),
		GET_INTEGER (L"Label size"), GET_INTEGER (L"Garnish")))
END

FORM (GaussianMixture_and_PCA_drawConcentrationEllipses, L"GaussianMixture & PCA: Draw concentration ellipses",
	L"GaussianMixture & PCA: Draw concentration ellipses...")
	POSITIVE (L"Number of sigmas", L"1.0")
	INTEGER (L"X-dimension", L"1")
	INTEGER (L"Y-dimension", L"2")
	REAL (L"left Horizontal range", L"0.0")
	REAL (L"right Horizontal range", L"0.0")
	REAL (L"left Vertical range", L"0.0")
	REAL (L"right Vertical range", L"0.0")
Exemplo n.º 17
0
void praat_SSCP_as_TableOfReal_init (ClassInfo klas);
void praat_TableOfReal_init (ClassInfo klas);
void praat_TableOfReal_init3 (ClassInfo klas);

/********************** CrossCorrelationTable(s) ******************/

FORM (CrossCorrelationTables_createTestSet, L"CrossCorrelationTables: Create test set", L"CrossCorrelationTables: Create test set...")
	WORD (L"Name", L"5x5")
	NATURAL (L"Matrix dimension", L"5")
	NATURAL (L"Number of matrices", L"20")
	BOOLEAN (L"First is positive definite", 1)
	REAL (L"Sigma", L"0.02")
	OK
DO
	praat_new (CrossCorrelationTables_createTestSet (GET_INTEGER (L"Matrix dimension"),
		GET_INTEGER (L"Number of matrices"), GET_INTEGER (L"First is positive definite"), GET_REAL (L"Sigma")), GET_STRING (L"Name"));
END

FORM (CrossCorrelationTable_createSimple, L"Create simple CrossCorrelationTable", 0)
	WORD (L"Name", L"ct")
	SENTENCE (L"Cross correlations", L"1.0 0.0 1.0")
	SENTENCE (L"Centroid", L"0.0 0.0")
	POSITIVE (L"Number of samples", L"100.0")
	OK
DO
	praat_new (CrossCorrelationTable_createSimple (GET_STRING (L"Cross correlations"), GET_STRING (L"Centroid"),
		GET_REAL (L"Number of samples")), GET_STRING (L"Name"));
END

FORM (MixingMatrix_createSimple, L"Create simple MixingMatrix", 0)
Exemplo n.º 18
0
static void FFNet_create_checkCommonFields_inputOutput (void *dia, long *numberOfInputs, long *numberOfOutputs) {
	*numberOfInputs = GET_INTEGER (L"Number of inputs");
	*numberOfOutputs = GET_INTEGER (L"Number of outputs");
}
Exemplo n.º 19
0
	LOOP {
		iam (FFNet);
		Melder_information (Melder_integer (my nUnitsInLayer[my nLayers] * (my nUnitsInLayer[my nLayers - 1] + 1)),
		L" weights");
	}
END

/**************** New Pattern ***************************/

FORM (Pattern_create, L"Create Pattern", 0)
	WORD (L"Name", L"1x1")
	NATURAL (L"Dimension of a pattern", L"1")
	NATURAL (L"Number of patterns", L"1")
	OK
DO
	praat_new (Pattern_create (GET_INTEGER (L"Number of patterns"),
		GET_INTEGER (L"Dimension of a pattern")), GET_STRING (L"Name"));
END

/**************** New Categories ***************************/

FORM (Categories_create, L"Create Categories", L"")
	WORD (L"Name", L"empty")
	OK
DO
	praat_new (Categories_create (), GET_STRING (L"Name"));
END

DIRECT (FFNet_help) Melder_help (L"Feedforward neural networks"); END

DIRECT (FFNet_getMinimum)
Exemplo n.º 20
0
static void menu_cb_learnOne (EDITOR_ARGS) {
	EDITOR_IAM (OTGrammarEditor);
	EDITOR_FORM (U"Learn one", U"OTGrammar: Learn one...")
		LABEL (U"", U"Underlying form:")
		SENTENCE (U"Input string", U"")
		LABEL (U"", U"Adult surface form:")
		SENTENCE (U"Output string", U"")
		REAL (U"Evaluation noise", U"2.0")
		OPTIONMENU_ENUM (U"Update rule", kOTGrammar_rerankingStrategy, kOTGrammar_rerankingStrategy_SYMMETRIC_ALL)
		REAL (U"Plasticity", U"0.1")
		REAL (U"Rel. plasticity spreading", U"0.1")
		BOOLEAN (U"Honour local rankings", 1)
	EDITOR_OK
	EDITOR_DO
		Editor_save (me, U"Learn one");
		OTGrammar_learnOne ((OTGrammar) my data, GET_STRING (U"Input string"), GET_STRING (U"Output string"),
			GET_REAL (U"Evaluation noise"), GET_ENUM (kOTGrammar_rerankingStrategy, U"Update rule"), GET_INTEGER (U"Honour local rankings"),
			GET_REAL (U"Plasticity"), GET_REAL (U"Rel. plasticity spreading"), TRUE, TRUE, NULL);
		OTGrammar_sort ((OTGrammar) my data);
		Graphics_updateWs (my g);
		Editor_broadcastDataChanged (me);
	EDITOR_END
}
Exemplo n.º 21
0
int main(int argc, char **argv)
{
	int val;

	void (*gl_get_progiv)(GLuint, GLenum, GLint*);

	glutInit(&argc, argv);
	glutCreateWindow("glinfo");

//	glewInit();

	gl_get_progiv = glXGetProcAddress("glGetProgramivARB");

	printf("vendor: %s\n", glGetString(GL_VENDOR));
	printf("renderer: %s\n", glGetString(GL_RENDERER));
	printf("version: %s\n", glGetString(GL_VERSION));
	printf("shading language version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION));

	printf("major version: %d\n", GET_INTEGER(GL_MAJOR_VERSION));
	printf("minor version: %d\n", GET_INTEGER(GL_MINOR_VERSION));
	printf("max texture units: %d\n", GET_INTEGER(GL_MAX_TEXTURE_UNITS));
	printf("max texture image units: %d\n", GET_INTEGER(GL_MAX_TEXTURE_IMAGE_UNITS));
	printf("max combined texture image units: %d\n", GET_INTEGER(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS));
	printf("max vertex texture image units: %d\n", GET_INTEGER(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS));
	printf("max texture size: %d\n", GET_INTEGER(GL_MAX_TEXTURE_SIZE));
	printf("max cube map texture size: %d\n", GET_INTEGER(GL_MAX_CUBE_MAP_TEXTURE_SIZE));
	printf("max texture coordinates: %d\n", GET_INTEGER(GL_MAX_TEXTURE_COORDS));
	printf("max vertex attributes: %d\n", GET_INTEGER(GL_MAX_VERTEX_ATTRIBS));
	printf("max vertex uniform vectors: %d\n", GET_INTEGER(GL_MAX_VERTEX_UNIFORM_VECTORS));
	printf("max fragment uniform vectors: %d\n", GET_INTEGER(GL_MAX_FRAGMENT_UNIFORM_VECTORS));
	printf("max varying vectors: %d\n", GET_INTEGER(GL_MAX_VARYING_VECTORS));
	printf("max color attachments: %d\n", GET_INTEGER(GL_MAX_COLOR_ATTACHMENTS_EXT));
	printf("max renderbuffer size ext: %d\n", GET_INTEGER(GL_MAX_RENDERBUFFER_SIZE_EXT));
	
	printf("v max program instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_INSTRUCTIONS_ARB));
	printf("v max program native instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB));
	printf("v max program temporaries arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_TEMPORARIES_ARB));
	printf("v max program native temporaries arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB));
	printf("v max program program parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_PARAMETERS_ARB));
	printf("v max program native parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB));
	printf("v max program attribs arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ATTRIBS_ARB));
	printf("v max program native attribs arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB));
	printf("v max program address registers arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB));
	printf("v max program native address registers arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB));
	printf("v max program local parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB));
	printf("v max program env parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ENV_PARAMETERS_ARB));
	printf("v max program alu instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB));
	printf("v max program native alu instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB));
	
	printf("f max program instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_INSTRUCTIONS_ARB));
	printf("f max program native instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB));
	printf("f max program temporaries arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_TEMPORARIES_ARB));
	printf("f max program native temporaries arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB));
	printf("f max program program parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_PARAMETERS_ARB));
	printf("f max program native parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB));
	printf("f max program attribs arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ATTRIBS_ARB));
	printf("f max program native attribs arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB));
	printf("f max program address registers arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB));
	printf("f max program native address registers arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB));
	printf("f max program local parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB));
	printf("f max program env parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ENV_PARAMETERS_ARB));
	printf("f max program alu instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB));
	printf("f max program native alu instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB));

	return 0;
}
Exemplo n.º 22
0
DO
	const char32 *text = GET_STRING (U"...the text");
	LOOP {
		iam (TableOfReal);
		autoTableOfReal thee = TableOfReal_extractColumnsWhereLabel (me, GET_ENUM (kMelder_string, U"Extract all columns whose label..."), text);
		praat_new (thee.move(), my name, U"_", text);
	}
END }

FORM (NEW_TableOfReal_extractColumnsWhereRow, U"Extract columns where row", nullptr) {
	NATURAL (U"Extract all columns where row...", U"1")
	OPTIONMENU_ENUM (U"...is...", kMelder_number, DEFAULT)
	REAL (U"...the value", U"0.0")
	OK
DO
	long row = GET_INTEGER (U"Extract all columns where row...");
	double value = GET_REAL (U"...the value");
	LOOP {
		iam (TableOfReal);
		autoTableOfReal thee = TableOfReal_extractColumnsWhereRow (me, row, GET_ENUM (kMelder_number, U"...is..."), value);
		praat_new (thee.move(), my name, U"_", row, U"_", lround (value));
	}
END }

DIRECT (NEW_TableOfReal_extractRowLabelsAsStrings) {
	LOOP {
		iam (TableOfReal);
		autoStrings thee = TableOfReal_extractRowLabelsAsStrings (me);
		praat_new (thee.move(), my name);
	}
END }
Exemplo n.º 23
0
	}
END

/***** RESULTS_MFC *****/

DIRECT (ResultsMFC_getNumberOfTrials)
	iam_ONLY (ResultsMFC);
	Melder_information (Melder_integer (my numberOfTrials));
END

FORM (ResultsMFC_getResponse, L"ResultsMFC: Get response", 0)
	NATURAL (L"Trial", L"1")
	OK
DO
	iam_ONLY (ResultsMFC);
	long trial = GET_INTEGER (L"Trial");
	if (trial > my numberOfTrials)
		Melder_throw ("Trial ", trial, " does not exist (maximum ", my numberOfTrials, ").");
	Melder_information (my result [trial]. response);
END

FORM (ResultsMFC_getStimulus, L"ResultsMFC: Get stimulus", 0)
	NATURAL (L"Trial", L"1")
	OK
DO
	iam_ONLY (ResultsMFC);
	long trial = GET_INTEGER (L"Trial");
	if (trial > my numberOfTrials)
		Melder_throw ("Trial ", trial, " does not exist (maximum ", my numberOfTrials, ").");
	Melder_information (my result [trial]. stimulus);
END
Exemplo n.º 24
0
		SENTENCE (U"Menu", U"File")
		SENTENCE (U"Command", U"Do it...")
		SENTENCE (U"After command", U"")
		INTEGER (U"Depth", U"0")
		LABEL (U"", U"Script file:")
		TEXTFIELD (U"Script", U"")
	EDITOR_OK
		if (my editorClass) SET_STRING (U"Window", my editorClass -> className)
		if (my name [0])
			SET_STRING (U"Script", my name)
		else
			SET_STRING (U"Script", U"(please save your script first)")
	EDITOR_DO
		praat_addMenuCommandScript (GET_STRING (U"Window"),
			GET_STRING (U"Menu"), GET_STRING (U"Command"), GET_STRING (U"After command"),
			GET_INTEGER (U"Depth"), GET_STRING (U"Script"));
		praat_show ();
	EDITOR_END
}

static void menu_cb_addToFixedMenu (ScriptEditor me, EDITOR_ARGS_FORM) {
	EDITOR_FORM (U"Add to fixed menu", U"Add to fixed menu...");
		RADIO (U"Window", 1)
			RADIOBUTTON (U"Objects")
			RADIOBUTTON (U"Picture")
		SENTENCE (U"Menu", U"New")
		SENTENCE (U"Command", U"Do it...")
		SENTENCE (U"After command", U"")
		INTEGER (U"Depth", U"0")
		LABEL (U"", U"Script file:")
		TEXTFIELD (U"Script", U"")
Exemplo n.º 25
0
	LABEL (U"", U"To supply rising or falling ranges, use e.g. 2:6 or 5:3.")
	TEXTFIELD (U"Channel ranges", U"1:64")
	LABEL (U"", U"Pre-whitening parameters")
	OPTIONMENU (U"Whitening method", 1)
		OPTION (U"No whitening")
		OPTION (U"Covariance")
		OPTION (U"Correlation")
	LABEL (U"", U"Iteration parameters")
	NATURAL (U"Maximum number of iterations", U"100")
	POSITIVE (U"Tolerance", U"0.001")
	OPTIONMENU (U"Diagonalization method", 2)
	OPTION (U"qdiag")
	OPTION (U"ffdiag")
	OK
DO
	int whiteningMethod = GET_INTEGER (U"Whitening method") - 1;
	LOOP {
		iam (EEG);
		autoEEG thee = EEG_to_EEG_bss (me, GET_REAL (U"left Time range"), GET_REAL (U"right Time range"),
			GET_INTEGER (U"Number of cross-correlations"), GET_REAL (U"Lag step"), GET_STRING (U"Channel ranges"),
			whiteningMethod, GET_INTEGER (U"Diagonalization method"),
			GET_INTEGER (U"Maximum number of iterations"), GET_REAL (U"Tolerance"));
		praat_new (thee.move(), my name, U"_bss");
	}
END

FORM (EEG_to_PCA, U"EEG: To PCA", U"EEG: To PCA...")
	REAL (U"left Time range (s)", U"0.0")
	REAL (U"right Time range (s)", U"10.0")
	TEXTFIELD (U"Channel ranges", U"1:64")
	LABEL (U"", U"To supply rising or falling ranges, use e.g. 2:6 or 5:3.")
Exemplo n.º 26
0
	WORD (U"Name", U"Classifier")
	OK
DO
	autoKNN knn = KNN_create ();
	praat_new (knn.move(), GET_STRING (U"Name"));
END }

FORM (NEW1_PatternList_Categories_to_KNN, U"Create kNN classifier", U"kNN classifiers 1. What is a kNN classifier?") {
	WORD (U"Name", U"Classifier")
	RADIO (U"Ordering", 1)
		RADIOBUTTON (U"Random")
		RADIOBUTTON (U"Sequential")
	OK
DO
	FIND_TWO (PatternList, Categories)
		int ordering = GET_INTEGER (U"Ordering");
		autoKNN knn = KNN_create ();
		switch (ordering) {
			case 1:
				ordering = kOla_SHUFFLE;
				break;
			case 2:
				ordering = kOla_SEQUENTIAL;
		}
		int result = KNN_learn (knn.get(), me, you, kOla_REPLACE, ordering);
		switch (result) {
			case kOla_PATTERN_CATEGORIES_MISMATCH:
				Melder_throw (U"The number of Categories should be equal to the number of rows in PatternList.");
			case kOla_DIMENSIONALITY_MISMATCH:
				Melder_throw (U"The dimensionality of PatternList should be equal to that of the instance base.");
			default:
Exemplo n.º 27
0
	RADIOBUTTON (U"no restriction")
	RADIOBUTTON (U"1/3 < slope < 3")
	RADIOBUTTON (U"1/2 < slope < 2")
	RADIOBUTTON (U"2/3 < slope < 3/2")
	OK
DO
	Cepstrumc c1 = nullptr, c2 = nullptr;
	LOOP {
		iam (Cepstrumc);
		(c1 ? c2 : c1) = me;
	}
	Melder_assert (c1 && c2);
	autoDTW thee = Cepstrumc_to_DTW (c1, c2, GET_REAL (U"Cepstral weight"),
		GET_REAL (U"Log energy weight"), GET_REAL (U"Regression weight"),
		GET_REAL (U"Regression weight log energy"), GET_REAL (U"Window for regression coefficients"),
		GET_INTEGER (U"Match begin positions"), GET_INTEGER (U"Match end positions"),
		GET_INTEGER (U"Slope constraints"));
	praat_new (thee.transfer(), c1 -> name, U"_", c2 -> name);
END

DIRECT (Cepstrumc_to_Matrix)
	LOOP {
		iam (Cepstrumc);
		autoMatrix thee = Cepstrumc_to_Matrix (me);
		praat_new (thee.transfer(), my name);
	}
END

/******************** Formant ********************************************/

FORM (Formant_to_LPC, U"Formant: To LPC", 0)