shape.alg

来自「Audacity是一款用於錄音和編輯聲音的、免費的開放源碼軟體。它可以執行於Ma」· ALG 代码 · 共 34 行

ALG
34
字号
(SHAPE-ALG        (NAME "shape")         (ARGUMENTS ("sound_type" "sin") ("sound_type" "fn")                 ("double" "origin"))        (START (MIN sin))	        (TABLE "fn")        (NOT-IN-INNER-LOOP "fn")        (STATE                ("double" "time_to_index" "fn->sr")               ("double" "origin" "origin")               ("table_type" "the_table" "sound_to_table(fn)")               ("sample_type *" "fcn_table" "susp->the_table->samples")		           ("double" "table_len" "susp->the_table->length") )        (TERMINATE (MIN sin))        (LOGICAL-STOP (MIN sin))        (INNER-LOOP "                register double offset, x1;                register long table_index;                register double phase = sin;                if (phase > 1.0) phase = 1.0;                else if (phase < -1.0) phase = -1.0;                offset = (phase + origin) * time_to_index;                table_index = (long) offset;                if (table_index < 0) table_index = 0;                if (table_index >= table_len) table_index = ((long) table_len) - 1;                    x1 = fcn_table[table_index];                    output = (sample_type) (x1 + (offset - table_index) *                         (fcn_table[table_index + 1] - x1));        ")        (ALWAYS-SCALE sin)        (CONSTANT "table_len" "time_to_index" "origen" "fcn_table" "the_table")        (FINALIZATION "table_unref(susp->the_table);"))

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?