clang:在 Win10 上编译 MIDI 音乐程序(二)

news2024/11/17 10:26:18

先从 Microsoft C++ Build Tools - Visual Studio

下载 1.73GB 安装 "Microsoft C++ Build Tools“

访问 Swift.org - Download Swift
找到 Windows 10:x86_64
下载 swift-5.10-RELEASE-windows10.exe  大约490MB
建议安装在 D:\Swift\ ,安装后大约占2.56GB

简单来说,Clang是一个编译器,目前用来编译C、C++、Objective-C语言。

where clang
D:\Swift\Toolchains\5.10.0+Asserts\usr\bin\clang.exe

cd D:\Swift\testc

短笛伴奏《祝你生日快乐》,编辑  happy_birthday_2u.cpp  如下

#include <iostream>
#include <windows.h>  
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")
using namespace std;

enum Scale  // 音阶参数
{
    Rest = 0, C8 = 108, B7 = 107, A7s = 106, A7 = 105, G7s = 104, G7 = 103, F7s = 102, F7 = 101, E7 = 100,
    D7s = 99, D7 = 98, C7s = 97, C7 = 96, B6 = 95, A6s = 94, A6 = 93, G6s = 92, G6 = 91, F6s = 90, F6 = 89,
    E6 = 88, D6s = 87, D6 = 86, C6s = 85, C6 = 84, B5 = 83, A5s = 82, A5 = 81, G5s = 80, G5 = 79, F5s = 78,
    F5 = 77, E5 = 76, D5s = 75, D5 = 74, C5s = 73, C5 = 72, B4 = 71, A4s = 70, A4 = 69, G4s = 68, G4 = 67,
    F4s = 66, F4 = 65, E4 = 64, D4s = 63, D4 = 62, C4s = 61, C4 = 60, B3 = 59, A3s = 58, A3 = 57, G3s = 56,
    G3 = 55, F3s = 54, F3 = 53, E3 = 52, D3s = 51, D3 = 50, C3s = 49, C3 = 48, B2 = 47, A2s = 46, A2 = 45,
    G2s = 44, G2 = 43, F2s = 42, F2 = 41, E2 = 40, D2s = 39, D2 = 38, C2s = 37, C2 = 36, B1 = 35, A1s = 34,
    A1 = 33, G1s = 32, G1 = 31, F1s = 30, F1 = 29, E1 = 28, D1s = 27, D1 = 26, C1s = 25, C1 = 24, B0 = 23,
    A0s = 22, A0 = 21
};
enum Voice // F大调
{
    H1 = F2, H2 = G2, H3 = A2, H4 = B2, H5 = C3, H6 = D3, H7 = E3,
    J1 = F3, J2 = G3, J3 = A3, J4 = B3, J5 = C4, J6 = D4, J7 = E4,
    K1 = F4, K2 = G4, K3 = A4, K4 = B4, K5 = C5, K6 = D5, K7 = E5,
    L1 = F5, L2 = G5, L3 = A5, L4 = B5, L5 = C6, L6 = D6, L7 = E6,
    LOW_SPEED = 500, MIDDLE_SPEED = 400, HIGH_SPEED = 300,
    _ = 0xFF
};
// score: Happy birthday to you
int hb2u[] = {
    J5,J5,J6,J5,K1,J7,
    J5,J5,J6,J5,K2,K1,
    J5,J5,K5,K3,K1,J7,J6,
    K4,K4,K3,K1,K2,K1,
};
// 时长数组 MIDDLE_SPEED
int shichang[] = {
    400,400,800,800,800,1600,
    400,400,800,800,800,1600,
    400,400,800,800,800,800,800,
    600,200,800,800,800,2000,
};
// 力度
int lidu[] = {
    1,0,0,2,0,0,
    1,0,0,2,0,0,
    1,0,0,2,1,0,0,
    2,2,0,0,2,1,
};
// 演奏歌曲《祝你生日快乐》
void happy_birthday()
{
    HMIDIOUT handle;
    midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL); // 打开midi设备
    midiOutShortMsg(handle, 72 << 8 | 0xC2); // 设置通道2的乐器为 72:短笛
    unsigned char sd = 0x90 | (2 & 0x0F); // statusByte: 0为声道
    unsigned short note = 0;    //音符编号
    unsigned short v = 120; // velocity 力度值,范围通常在0-127
    int n = sizeof(lidu) / sizeof(lidu[0]); 
    cout <<"n= " << n << endl;
    for (int i=0; i < n; i++) {
        note = hb2u[i];
        if (lidu[i] ==0) v = 40;
        else if(lidu[i] ==1) v = 80;
        else if (lidu[i] ==2) v = 120;
    
        unsigned long noteOnMsg = (((unsigned long)v <<16) | (((unsigned long)note) <<8) | (unsigned long)sd);
        midiOutShortMsg(handle, noteOnMsg); // 发送MIDI消息
        Sleep(shichang[i]); // 停顿,给音节演奏的时间
        midiOutShortMsg(handle, 0x7BB2); // 停止通道2上的演奏
    }
    midiOutShortMsg(handle, 0x7BB2); // 停止通道2上的演奏
    midiOutClose(handle); // 关闭midi设备
}

int main()
{
    happy_birthday();
    return 0;
}

编译  clang happy_birthday_2u.cpp -o happy_birthday_2u.exe

运行  happy_birthday_2u.exe


钢琴伴奏《祝你生日快乐》,编辑  happy_birthday_2y.cpp  如下

#include <iostream>
#include <windows.h>  
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")
using namespace std;

enum Scale  // 音阶参数
{
    Rest = 0, C8 = 108, B7 = 107, A7s = 106, A7 = 105, G7s = 104, G7 = 103, F7s = 102, F7 = 101, E7 = 100,
    D7s = 99, D7 = 98, C7s = 97, C7 = 96, B6 = 95, A6s = 94, A6 = 93, G6s = 92, G6 = 91, F6s = 90, F6 = 89,
    E6 = 88, D6s = 87, D6 = 86, C6s = 85, C6 = 84, B5 = 83, A5s = 82, A5 = 81, G5s = 80, G5 = 79, F5s = 78,
    F5 = 77, E5 = 76, D5s = 75, D5 = 74, C5s = 73, C5 = 72, B4 = 71, A4s = 70, A4 = 69, G4s = 68, G4 = 67,
    F4s = 66, F4 = 65, E4 = 64, D4s = 63, D4 = 62, C4s = 61, C4 = 60, B3 = 59, A3s = 58, A3 = 57, G3s = 56,
    G3 = 55, F3s = 54, F3 = 53, E3 = 52, D3s = 51, D3 = 50, C3s = 49, C3 = 48, B2 = 47, A2s = 46, A2 = 45,
    G2s = 44, G2 = 43, F2s = 42, F2 = 41, E2 = 40, D2s = 39, D2 = 38, C2s = 37, C2 = 36, B1 = 35, A1s = 34,
    A1 = 33, G1s = 32, G1 = 31, F1s = 30, F1 = 29, E1 = 28, D1s = 27, D1 = 26, C1s = 25, C1 = 24, B0 = 23,
    A0s = 22, A0 = 21
};
enum Voice // F大调
{
    H1 = F2, H2 = G2, H3 = A2, H4 = B2, H5 = C3, H6 = D3, H7 = E3,
    J1 = F3, J2 = G3, J3 = A3, J4 = B3, J5 = C4, J6 = D4, J7 = E4,
    K1 = F4, K2 = G4, K3 = A4, K4 = B4, K5 = C5, K6 = D5, K7 = E5,
    L1 = F5, L2 = G5, L3 = A5, L4 = B5, L5 = C6, L6 = D6, L7 = E6,
    LOW_SPEED = 500, MIDDLE_SPEED = 400, HIGH_SPEED = 300,
    _ = 0xFF
};
// score: Happy birthday to you
int hb2u[] = {
    J5,J5,J6,J5,K1,J7,
    J5,J5,J6,J5,K2,K1,
    J5,J5,K5,K3,K1,J7,J6,
    K4,K4,K3,K1,K2,K1,
};
// 时长数组 MIDDLE_SPEED
int shichang[] = {
    400,400,800,800,800,1600,
    400,400,800,800,800,1600,
    400,400,800,800,800,800,800,
    600,200,800,800,800,2000,
};
// 力度
int lidu[] = {
    1,0,0,2,0,0,
    1,0,0,2,0,0,
    1,0,0,2,1,0,0,
    2,2,0,0,2,1,
};
// 演奏歌曲《祝你生日快乐》
void happy_birthday()
{
    HMIDIOUT handle;
    midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL);
    midiOutShortMsg(handle, 0 << 8 | 0xC0); // 设置通道0的乐器为 大钢琴
    unsigned short note = 0;    // 音符编号
    unsigned short v = 100; // velocity 力度值,范围通常在0-127
    unsigned char sd = 0x90 | (0 & 0x0F);// statusByte: 0为声道
    int n = sizeof(lidu) / sizeof(lidu[0]); 
    cout <<"n= " << n << endl;
    for (int i=0; i < n; i++) {
        note = hb2u[i];
        if (lidu[i] ==0) v = 50;
        else if(lidu[i] ==1) v = 80;
        else if (lidu[i] ==2) v = 127;

        // 组合3个字节的消息到一个DWORD值
        unsigned long noteOnMsg = (((unsigned long)v <<16) | (((unsigned long)note) <<8) | (unsigned long)sd);
        // 发送MIDI消息
        midiOutShortMsg(handle, noteOnMsg);
        Sleep(shichang[i]); // 停顿,给音节演奏的时间
        midiOutShortMsg(handle, 0x7BB0); // 停止通道0上的演奏
    }
    midiOutClose(handle);
}

int main()
{
    happy_birthday();
    return 0;
}

编译  clang happy_birthday_2y.cpp -o happy_birthday_2y.exe

运行  happy_birthday_2y.exe


命令行参数化 乐器伴奏《祝你生日快乐》,编辑  happy_birthday_to.cpp  如下

#include <iostream>
#include <windows.h>  
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")
using namespace std;

enum Scale  // 音阶参数
{
    Rest = 0, C8 = 108, B7 = 107, A7s = 106, A7 = 105, G7s = 104, G7 = 103, F7s = 102, F7 = 101, E7 = 100,
    D7s = 99, D7 = 98, C7s = 97, C7 = 96, B6 = 95, A6s = 94, A6 = 93, G6s = 92, G6 = 91, F6s = 90, F6 = 89,
    E6 = 88, D6s = 87, D6 = 86, C6s = 85, C6 = 84, B5 = 83, A5s = 82, A5 = 81, G5s = 80, G5 = 79, F5s = 78,
    F5 = 77, E5 = 76, D5s = 75, D5 = 74, C5s = 73, C5 = 72, B4 = 71, A4s = 70, A4 = 69, G4s = 68, G4 = 67,
    F4s = 66, F4 = 65, E4 = 64, D4s = 63, D4 = 62, C4s = 61, C4 = 60, B3 = 59, A3s = 58, A3 = 57, G3s = 56,
    G3 = 55, F3s = 54, F3 = 53, E3 = 52, D3s = 51, D3 = 50, C3s = 49, C3 = 48, B2 = 47, A2s = 46, A2 = 45,
    G2s = 44, G2 = 43, F2s = 42, F2 = 41, E2 = 40, D2s = 39, D2 = 38, C2s = 37, C2 = 36, B1 = 35, A1s = 34,
    A1 = 33, G1s = 32, G1 = 31, F1s = 30, F1 = 29, E1 = 28, D1s = 27, D1 = 26, C1s = 25, C1 = 24, B0 = 23,
    A0s = 22, A0 = 21
};
enum Voice // F大调
{
    H1 = F2, H2 = G2, H3 = A2, H4 = B2, H5 = C3, H6 = D3, H7 = E3,
    J1 = F3, J2 = G3, J3 = A3, J4 = B3, J5 = C4, J6 = D4, J7 = E4,
    K1 = F4, K2 = G4, K3 = A4, K4 = B4, K5 = C5, K6 = D5, K7 = E5,
    L1 = F5, L2 = G5, L3 = A5, L4 = B5, L5 = C6, L6 = D6, L7 = E6,
    LOW_SPEED = 500, MIDDLE_SPEED = 400, HIGH_SPEED = 300,
    _ = 0xFF
};
// score: Happy birthday to you
int hb2u[] = {
    J5,J5,J6,J5,K1,J7,
    J5,J5,J6,J5,K2,K1,
    J5,J5,K5,K3,K1,J7,J6,
    K4,K4,K3,K1,K2,K1,
};
// 时长数组 MIDDLE_SPEED
int shichang[] = {
    400,400,800,800,800,1600,
    400,400,800,800,800,1600,
    400,400,800,800,800,800,800,
    600,200,800,800,800,2000,
};
// 力度
int lidu[] = {
    1,0,0,2,0,0,
    1,0,0,2,0,0,
    1,0,0,2,1,0,0,
    2,2,0,0,2,1,
};
// 演奏歌曲《祝你生日快乐》
void happy_birthday(int yinse)
{
    HMIDIOUT handle;
    midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL);
    midiOutShortMsg(handle, yinse << 8 | 0xC1); // 设置通道1的乐器
    unsigned short note = 0;    // 音符编号
    unsigned short v = 100; // velocity 力度值,范围通常在0-127
    unsigned char sd = 0x90 | (1 & 0x0F);// statusByte: 0为声道
    int n = sizeof(lidu) / sizeof(lidu[0]); 
    cout <<"n= " << n << endl;
    for (int i=0; i < n; i++) {
        note = hb2u[i];
        if (lidu[i] ==0) v = 50;
        else if(lidu[i] ==1) v = 80;
        else if (lidu[i] ==2) v = 127;

        // 组合3个字节的消息到一个DWORD值
        unsigned long noteOnMsg = (((unsigned long)v <<16) | (((unsigned long)note) <<8) | (unsigned long)sd);
        // 发送MIDI消息
        midiOutShortMsg(handle, noteOnMsg);
        Sleep(shichang[i]); // 停顿,给音节演奏的时间
        midiOutShortMsg(handle, 0x7BB1); // 停止通道1上的演奏
    }
    midiOutClose(handle);
}

int main(int argc,char *argv[])
{
  if (argc > 1){
    int n = atoi(argv[1]);
    if (0<=n && n<128) happy_birthday(n);
    else cout << " 0<=n and n<128 ";
  } else {
    cout << " usage: happy_birthday_to n ";
  }
    
    return 0;
}

编译  clang happy_birthday_to.cpp -o happy_birthday_to.exe

# 乐器 26:电吉他 爵士
运行  happy_birthday_to.exe 26
# 乐器  40:小提琴
运行  happy_birthday_to  40
# 乐器  42:大提琴
运行  happy_birthday_to  42
# 乐器 65:中音萨克斯风
运行  happy_birthday_to 65


参阅:C语言midi编程钢琴演奏

音色表

/*
    General MIDI Level 1 旋律乐器对照表
    Note: 只向某个MIDI通道发送Program Change命令设置乐器,是不能发音的, 
          想要发音,还必须发出On开音符指令;有些乐器(笛)开始播放后,
          如果不发Off关音符指令,会持续发音很长时间.
*/
//Piano        1-8              键盘乐器             define = MIDI GM1列表序号 - 1
#define Acoustic_Grand_Piano    0       //平台钢琴
#define Bright_Acoustic_Piano   1       //亮音钢琴
#define Electric_Grand_Piano    2       //电钢琴
#define Honky_tonk_Piano        3       //酒吧钢琴
#define Electric_Piano_1        4       //电钢琴1
#define Electric_Piano_2        5       //电钢琴2
#define Harpsichord             6       //羽管键琴
#define Clavi                   7       //电翼琴
//Chromatic Percussion   9-16	固定音高敲击乐器     
#define Celesta                 8       //钢片琴
#define Glockenspiel            9       //钟琴
#define Music_Box               10      //音乐盒
#define Vibraphone              11      //颤音琴
#define Marimba                 12      //马林巴琴
#define Xylophone               13      //木琴
#define Tubular_Bells           14      //管钟
#define Dulcimer                15      //洋琴
//Organ         17-24	        风琴
#define Drawbar_Organ           16      //音栓风琴
#define Percussive_Organ        17      //敲击风琴
#define Rock_Organ              18      //摇滚风琴
#define Church_Organ            19      //教堂管风琴
#define Reed_Organ              20      //簧风琴
#define Accordion               21      //手风琴
#define Harmonica               22      //口琴
#define Tango_Accordion         23      //探戈手风琴
//Guitar        25-32	        吉他
#define Acoustic_Guitar_nylon   24      //木吉他 尼龙弦
#define Acoustic_Guitar_steel   25      //木吉他 钢弦
#define Electric_Guitar_jazz    26      //电吉他 爵士
#define Electric_Guitar_clean   27      //电吉他 原音
#define Electric_Guitar_muted   28      //电吉他 闷音
#define Overdriven_Guitar       29      //电吉他 破音
#define Distortion_Guitar       30      //电吉他 失真
#define Guitar_harmonics        31      //吉他泛音
//Bass          33-40	        贝斯
#define Acoustic_Bass           32      //民谣贝司
#define Electric_Bass_finger    33      //电贝司 指奏
#define Electric_Bass_pick      34      //电贝司 拨奏
#define Fretless_Bass           35      //无格贝斯
#define Slap_Bass_1             36      //捶钩贝斯1
#define Slap_Bass_2             37      //捶钩贝斯2
#define Synth_Bass_1            38      //合成贝司1
#define Synth_Bass_2            39      //合成贝司2
//Strings       41-48	        弦乐器
#define Violin                  40      //小提琴
#define Viola                   41      //中提琴
#define Cello                   42      //大提琴
#define Contrabass              43      //低音大提琴
#define Tremolo_Strings         44      //颤弓弦乐
#define Pizzicato_Strings       45      //弹拨弦乐
#define Orchestral_Harp         46      //竖琴
#define Timpani                 47      //定音鼓
//Ensemble      49-56	        合奏
#define String_Ensemble_1       48      //弦乐合奏1
#define String_Ensemble_2       49      //弦乐合奏2
#define SynthStrings_1          50      //合成弦乐1
#define SynthStrings_2          51      //合成弦乐2
#define Choir_Aahs              52      //人声“啊”
#define Voice_Oohs              53      //人声“喔”
#define Synth_Voice             54      //合成人声
#define Orchestra_Hit           55      //交响打击乐
//Brass         57-64	        铜管乐器
#define Trumpet                 56      //小号
#define Trombone                57      //长号
#define Tuba                    58      //大号
#define Muted_Trumpet           59      //闷音小号
#define French_Horn             60      //圆号/法国号
#define Brass_Section           61      //铜管乐
#define SynthBrass_1            62      //合成铜管1
#define SynthBrass_2            63      //合成铜管2
Reed          65-72	        簧乐器
#define Soprano_Sax             64      //高音萨克斯风
#define Alto_Sax                65      //中音萨克斯风
#define Tenor_Sax               66      //次中音萨克斯风
#define Baritone_Sax            67      //上低音萨克斯风
#define Oboe                    68      //双簧管
#define English_Horn            69      //英国管
#define Bassoon                 70      //低音管
#define Clarinet                71      //单簧管
//Pipe          73-80	        吹管乐器
#define Piccolo                 72      //短笛
#define Flute                   73      //长笛
#define Recorder                74      //直笛
#define Pan_Flute               75      //排笛
#define Blown_Bottle            76      //瓶笛
#define Shakuhachi              77      //尺八
#define Whistle                 78      //哨子
#define Ocarina                 79      //陶笛
//Synth Lead    81-88	        合成音主旋律
#define Lead_1_square           80      //方波
#define Lead_2_sawtooth         81      //锯齿波
#define Lead_3_calliope         82      //汽笛风琴
#define Lead_4_chiff            83      //合成吹管
#define Lead_5_charang          84      //合成电吉他
#define Lead_6_voice            85      //人生键盘
#define Lead_7_fifths           86      //五度音
#define Lead_8_bass_lead        87      //贝司吉他合奏
//Synth Pad     89-96	        合成音和弦衬底
#define Pad_1_new age           88      //新世纪
#define Pad_2_warm              89      //温暖
#define Pad_3_polysynth         90      //多重和音
#define Pad_4_choir             91      //人生合唱
#define Pad_5_bowed             92      //玻璃
#define Pad_6_metallic          93      //金属
#define Pad_7_halo              94      //光华
#define Pad_8_sweep             95      //扫掠
//Synth Effects 97-104	        合成音效果
#define FX_1_rain               96      //雨
#define FX_2_soundtrack         97      //电影音效
#define FX_3_crystal            98      //水晶
#define FX_4_atmosphere         99      //气氛
#define FX_5_brightness         100     //明亮
#define FX_6_goblins            101     //魅影
#define FX_7_echoes             102     //回音
#define FX_8_sci_fi             103     //科幻
//Ethnic        105-112	        民族乐器
#define Sitar                   104     //西塔琴
#define Banjo                   105     //五弦琴/斑鸠琴
#define Shamisen                106     //三味线
#define Koto                    107     //十三弦琴/古筝
#define Kalimba                 108     //卡林巴铁片琴
#define Bag_pipe                109     //苏格兰风琴
#define Fiddle                  110     //古提琴
#define Shanai                  111     //獸笛,类似唢呐
//Percussive    113-120	        打击乐器
#define Tinkle_Bell             112     //叮铛铃
#define Agogo                   113     //阿哥哥鼓
#define Steel_Drums             114     //钢鼓
#define Woodblock               115     //木鱼
#define Taiko_Drum              116     //太鼓
#define Melodic_Tom             117     //定音铜鼓
#define Synth_Drum              118     //合成股
#define Reverse_Cymbal          119     //逆转钹声
//Sound Effects 121-128	        特殊音效
#define Guitar_Fret_Noise       120     //吉他滑弦杂声
#define Breath_Noise            121     //呼吸杂声
#define Seashore                122     //海岸
#define Bird_Tweet              123     //鸟鸣
#define Telephone_Ring          124     //电话铃声
#define Helicopter              125     //直升机
#define Applause                126     //拍手
#define Gunshot                 127     //枪声

音码表

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1642953.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

webassembly入门详解(C++)

一、环境配置 环境说明,操作系统为window操作系统。 1.1 下载和安装python 下载 需要python版本至少3.6版本 python下载地址:https://www.python.org/getit/ 安装 检测安装结果 win+R组合键->cmd->输入python->回车 1.2 下载和安装emsdk 下载 下载地址:https://gi…

jQuery 学习归纳1 --- jQuery 常用API

jQuery其实就是一个Js文件&#xff0c;里面集合了很多封装好的函数。方便了我们进行开发使用。 使用jQuery&#xff0c;就是为了更快速操作DOM。 一、jQuery前期准备 1.1 jQuery 使用的前期准备 在使用之前需要需要在项目中导入jQuery文件。 1、进入jQuery官网 www.jQuery.co…

支付宝支付流程

第一步前端&#xff1a;点击去结算&#xff0c;前端将商品的信息传递给后端&#xff0c;后端返回一个商品的订单号给到前端&#xff0c;前端将商品的订单号进行存储。 对应的前端代码&#xff1a;然后再跳转到支付页面 // 第一步 点击去结算 然后生成一个订单号 // 将选中的商…

计算机专业就业前景以及工资待遇水平怎么样

计算机专业毕业生的就业前景不错的&#xff0c;计算机专业人才的需求量大&#xff0c;各行各业都需要这类人才来进行软件开发、数据分析、网络安全管理、系统维护等工&#xff0c;工资待遇水平较高&#xff0c;以下是上大学网&#xff08;www.sdaxue.com)整理的计算机专业就业前…

手把手教你在本机安装Stable Diffusion秋叶整合包(附安装包和大模型)

整合包对非技术出身的同学比较友好&#xff0c;因为秋叶大佬把相关的东西已经都整合好了&#xff0c;只需要点点点就行了。当然懂编程的同学就更没有问题了。 文末领取SD安装包和大模型&#xff01; 准备 为了保证AI绘画的效率&#xff0c;建议在本机安装Nvidia独立显卡&…

转速(RPM)和角速度转换FC(CODESYS ST代码)

1、频率和转速转换功能块 频率和转速转换功能块(CODESYS ST源代码)-CSDN博客文章浏览阅读16次。1、转速和频率转换功能块转速和频率转换功能块(CODESYS ST源代码)-CSDN博客文章浏览阅读10次。1、转速/频率常用转换关系转速/频率/线速度/角速度计算FC_200 plc计算角速度-CSDN博…

EXCEL怎样把筛选后含有公式的数据,复制粘贴到同一行的其它列?

自excel2003版之后&#xff0c;常规情况下&#xff0c;复制筛选后的数据&#xff0c;会忽略隐藏行&#xff0c;仅复制其筛选后的数据&#xff0c;粘贴则是粘贴到连续单元格区域&#xff0c;不管行是在显示状态还是隐藏状态。 一、初始数据&#xff1a; 二、题主的复制粘贴问题…

Android仿微信公众号文章页面加载进度条

前言&#xff1a; 微信公众号文章详情页面加载的时候&#xff0c;WebView会在头部显示一个进度条&#xff0c;这样做的好处就是用户可以一边加载网页内容的同时也可浏览网页内容&#xff0c;不需要等完全加载完之后才全部显示出来。如何实现呢&#xff1f; 其实很简单&#xf…

【机器学习】BK- SDM与LCM的融合策略在文本到图像生成中的应用

突破边缘设备限制&#xff1a;BK-SDM与LCM的融合策略在文本到图像生成中的应用 一、引言二、稳定扩散算法的挑战与现状三、BK-SDM与LCM的融合策略利用高质量图像-文本对进行训练为LCM量身定制高级蒸馏过程 四、结论与展望 一、引言 随着人工智能技术的飞速发展&#xff0c;文本…

www.fastssh.com SSH over WebSockets with CDNs

https://www.fastssh.com/page/create-ssh-cdn-websocket/server/这其实不是标准的websocket报文(服务器响应报文无Sec-Websocket-Accept字段)&#xff0c;所以无法使用github.com/gorilla/websocket包&#xff1a;GET / HTTP/1.1 Host: hostname:8080 User-Agent: Go-http-cli…

c#学习基础1

一、复杂数据类型 1&#xff09;概述 2&#xff09;枚举 1.基本概念 枚举是一个比较特别的存在&#xff0c;它是一个被命名的整形常量的集合&#xff0c;一般用它来表示状态&#xff0c;类型等 1.1申明枚举和申明枚举变量 1.2申明枚举语法 2.在哪里申明枚举 3.枚举的使用 4…

Unity技术学习:RenderMesh、RenderMeshInstanced

叠甲&#xff1a;本人比较菜&#xff0c;如果哪里不对或者有认知不到的地方&#xff0c;欢迎锐评&#xff08;不玻璃心&#xff09;&#xff01; 导师留了个任务&#xff0c;渲染大量的、移动的物体。 当时找了几个解决方案&#xff1a; 静态批处理&#xff1a; 这东西只对静…

从0开始linux(1)——文件操作

欢迎来到博主的专栏——从0开始linux 博主ID&#xff1a;代码小豪 博主使用的linux发行版是&#xff1a;CentOS 7.6 不同版本下的操作可能存在差异 文章目录 命令文件操作命令文件树和文件路径文件树绝对路径相对路径 文件属性tree指令删除文件复制文件 大家还记得在小学第一次…

java下乡扶贫志愿者招募管理系统springboot-vue

计算机技术在现代管理中的应用&#xff0c;使计算机成为人们应用现代技术的重要工具。能够有效的解决获取信息便捷化、全面化的问题&#xff0c;提高效率。 技术栈 前端&#xff1a;vue.jsElementUI 开发工具&#xff1a;IDEA 或者eclipse都支持 编程语言: java 框架&#xff1…

SQL 基础 | AVG 函数的用法

在SQL中&#xff0c;AVG()是一个聚合函数&#xff0c;用来计算某个列中所有值的平均值。 它通常与GROUP BY子句一起使用&#xff0c;以便对分组后的数据进行平均值计算。 AVG()函数在需要了解数据集中某个数值列的中心趋势时非常有用。 以下是AVG()函数的一些常见用法&#xff…

猿人学第七题-动态字体-随风漂移

前言&#xff1a;该题主要是考对fontTools.ttLib.TTFont的操作&#xff0c;另外就是对字典互相映射的操作 一、woff文件存储 from fontTools.ttLib import TTFont #pip install fontTools def save_woff(response):woff response[woff]woff_file base64.b64decode(woff.enc…

第11章 软件工程

这里写目录标题 1.软件过程1.1能力成熟度模型(CMM)1.2能力成熟度模型集成(CMMI)1.3瀑布模型(线性顺序)1.4增量模型1.5演化模型1.5.1原型模型1.5.2螺旋模型 1.6喷泉模型1.7统一过程(UP)模型 2.敏捷方法3.系统设计4.系统测试4.1单元测试(模块测试)4.2集成测试4.3黑盒测试(功能测试…

噪声嵌入提升语言模型微调性能

在自然语言处理&#xff08;NLP&#xff09;的快速发展中&#xff0c;大模型&#xff08;LLMs&#xff09;的微调技术一直是研究的热点。最近&#xff0c;一篇名为《NEFTUNE: NOISY EMBEDDINGS IMPROVE INSTRUCTION FINETUNING》的论文提出了一种新颖的方法&#xff0c;通过在训…

每日一题2:获取DataFrame的大小

在Python中&#xff0c;pandas库是一个非常流行的数据处理库&#xff0c;它提供了DataFrame这一数据结构来高效地处理表格化的数据。如果想查看一个DataFrame的行数和列数&#xff0c;可以使用.shape来实现。 一、基本用法 当你有一个名为df的DataFrame时&#xff0c;只需调用…

rust使用Atomic创建全局变量和使用

Mutex用起来简单&#xff0c;但是无法并发读&#xff0c;RwLock可以并发读&#xff0c;但是使用场景较为受限且性能不够&#xff0c;那么有没有一种全能性选手呢&#xff1f; 欢迎我们的Atomic闪亮登场。 从 Rust1.34 版本后&#xff0c;就正式支持原子类型。原子指的是一系列…