软件协会第01次活动第05次任务布置:爱心代码+演奏歌曲+typora使用pandoc导出+github注册登录+函数练习+写csdn文章(一)

简介: 软件协会第01次活动第05次任务布置:爱心代码+演奏歌曲+typora使用pandoc导出+github注册登录+函数练习+写csdn文章

🏠 官网:https://www.csuftsap.cn/

💬 任务布置说明:

  • 题目考察范围:函数
  • 所有答案均放在我所写的空代码块空引用框

🚀 本学期我们的练习到这里就结束了,如果我们的缘分未尽,寒假再见💓

1.程序员的浪漫-爱心代码(升级版)

1.1 官网下载EasyX

EasyX 是针对 C/C++ 的图形库,可以帮助使用C/C++语言的程序员快速上手图形和游戏编程。

比如,可以用 VC + EasyX 很快的用几何图形画一个房子,或者一辆移动的小车,可以编写俄罗斯方块、贪吃蛇、黑白棋等小游戏,可以练习图形学的各种算法,等等。

这里只是本次任务的小热身。

🏠 https://easyx.cn/download

1.2 安装EasyX

1.3 重启vs,新建项目并在其中创建一个.cpp文件(如果之前打开了vs,请重启vs)

也可以在vs界面内使用 ctrl + shift + A 快速创建文件

1.4 将如下代码拷贝到 love.cpp 文件中运行即可

#include<graphics.h>
#include<conio.h>
#include<time.h>
#include<math.h>
#include<stdlib.h>
/*
  作者:那蔚蓝天空 
*/
struct Point {
  double x, y;
  COLORREF color;
};
COLORREF colors[256] = { RGB(255,32,83),RGB(252,222,250) ,RGB(255,0,0) ,
RGB(255,0,0) ,RGB(255,2,2) ,RGB(255,0,8) ,RGB(255,5,5) };
const int xScreen = 1200;
const int yScreen = 800;
const double PI = 3.1426535159;
const double e = 2.71828;
const double averag_distance = 0.162;
const int quantity = 506;
const int circles = 210;
const int frames = 20;
Point  origin_points[quantity];
Point  points[circles * quantity];
IMAGE images[frames];
double screen_x(double x)
{
  x += xScreen / 2;
  return x;
}
double screen_y(double y)
{
  y = -y + yScreen / 2;
  return y;
}
int creat_random(int x1, int x2)
{
  if (x2 > x1)
    return  rand() % (x2 - x1 + 1) + x1;
}
void creat_data()
{
  int index = 0;
  double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
  for (double radian = 0.1; radian <= 2 * PI; radian += 0.005)
  {
    x2 = 16 * pow(sin(radian), 3);
    y2 = 13 * cos(radian) - 5 * cos(2 * radian) - 2 * cos(3 * radian)
      - cos(4 * radian);
    double distance = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
    if (distance > averag_distance)
    {
      x1 = x2, y1 = y2;
      origin_points[index].x = x2;
      origin_points[index++].y = y2;
    }
  }
  index = 0;
  for (double size = 0.1, lightness = 1.5; size <= 20; size += 0.1)
  {
    double success_p = 1 / (1 + pow(e, 8 - size / 2));
    if (lightness > 1) lightness -= 0.0025;
    for (int i = 0; i < quantity; ++i)
    {
      if (success_p > creat_random(0, 100) / 100.0)
      {
        COLORREF color = colors[creat_random(0, 6)];
        points[index].color = RGB(GetRValue(color) / lightness, GetGValue(color) / lightness, GetBValue(color) / lightness);
        points[index].x = size * origin_points[i].x + creat_random(-4, 4);
        points[index++].y = size * origin_points[i].y + creat_random(-4, 4);
      }
    }
  }
  int points_size = index;
  for (int frame = 0; frame < frames; ++frame)
  {
    images[frame] = IMAGE(xScreen, yScreen);
    SetWorkingImage(&images[frame]);
    for (index = 0; index < points_size; ++index)
    {
      double x = points[index].x, y = points[index].y;
      double distance = sqrt(pow(x, 2) + pow(y, 2));
      double diatance_increase = -0.0009 * distance * distance
        + 0.35714 * distance + 5;
      double x_increase = diatance_increase * x / distance / frames;
      double y_increase = diatance_increase * y / distance / frames;
      points[index].x += x_increase;
      points[index].y += y_increase;
      setfillcolor(points[index].color);
      solidcircle(screen_x(points[index].x), screen_y(points[index].y), 1);
    }
    for (double size = 17; size < 23; size += 0.3)
    {
      for (index = 0; index < quantity; ++index)
      {
        if ((creat_random(0, 100) / 100.0 > 0.6 && size >= 20)
          || (size < 20 && creat_random(0, 100) / 100.0 > 0.95))
        {
          double x, y;
          if (size >= 20)
          {
            x = origin_points[index].x * size +
              creat_random(-frame * frame / 5 - 15, frame * frame / 5 + 15);
            y = origin_points[index].y * size +
              creat_random(-frame * frame / 5 - 15, frame * frame / 5 + 15);
          }
          else
          {
            x = origin_points[index].x * size + creat_random(-5, 5);
            y = origin_points[index].y * size + creat_random(-5, 5);
          }
          setfillcolor(colors[creat_random(0, 6)]);
          solidcircle(screen_x(x), screen_y(y), 1);
        }
      }
    }
  }
  SetWorkingImage();
}
int main()
{
  initgraph(xScreen, yScreen);
  BeginBatchDraw();
  srand(time(0));
  creat_data();
  bool extend = true, shrink = false;
  for (int frame = 0; !_kbhit();)
  {
    putimage(0, 0, &images[frame]);
    FlushBatchDraw();
    Sleep(20);
    cleardevice();
    if (extend)
      frame == 19 ? (shrink = true, extend = false) : ++frame;
    else
      frame == 0 ? (shrink = false, extend = true) : --frame;
  }
  EndBatchDraw();
  closegraph();
  return 0;
} 

1.5 📍 运行该 .cpp 文件

将你运行出来的结果截图放入下面的引用框中:

2.演奏歌曲(选做)

💬 只需要将刚才写的 love.cpp 文件里的全部代码替换为下面的代码即可,你也可以选择新开文件,但一定是以 .cpp 结尾的文件。以下代码不需要用到 EasyX 插件。如果你对演奏音乐感兴趣,那么当你学到 C++ 的时候就可以去学习用代码演奏自己喜欢的音乐,这不会太难,只要找到你选择的歌曲的谱子按照对应关系填写对应代码即可。一定要谱一曲《告白气球》,去和你爱的男孩或女孩表白❤️

2.1 平凡之路

#include <iostream>
#include <Windows.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
{
    X1 = C2, X2 = D2, X3 = E2, X4 = F2, X5 = G2, X6 = A2, X7 = B2,
    L1 = C3, L2 = D3, L3 = E3, L4 = F3, L5 = G3, L6 = A3, L7 = B3,
    M1 = C4, M2 = D4, M3 = E4, M4 = F4, M5 = G4, M6 = A4, M7 = B4,
    H1 = C5, H2 = D5, H3 = E5, H4 = F5, H5 = G5, H6 = A5, H7 = B5,
    LOW_SPEED = 500, MIDDLE_SPEED = 400, HIGH_SPEED = 300,
    _ = 0XFF
};
void Trivial()
{
    HMIDIOUT handle;
    midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL);
    int volume = 0x7f;
    int voice = 0x0;
    int sleep = 300;
    int trivial[] =
    {
       MIDDLE_SPEED, X6,L6,M3,M1,M1,L4,M4,M1,X1,L5,M3,M1,L7,M1,M2,L5,X6,L6,M3,M1,M1,L4,M4,M1,X1,L5,M3,M1,L7,M1,M2,L5,_,_,
       400,M3,M3,0,M6,M6,_,_,400,M1,M2,0,M3,M3,_,400,_,_,_,_,_,_,_,_,M3,M3,0,M6,M6,_,_,400,_,M5,M5,M4,M3,_,_,_,_,_,_,_,_,
       M3,M3,M6,_,M1,M2,M3,_,_,_,_,_,_,_,M3,M3,M1,M4,0,M4,M4,_,400,M3,M1,_,_,_,
       400,M3,M3,0,M6,M6,_,_,400,M1,M2,0,M3,M3,_,400,_,_,_,_,_,_,_,_,M3,M3,0,M6,M6,_,_,400,_,M5,M5,M4,M3,_,_,_,_,_,_,_,_,
       M3,M3,M6,_,M1,M2,M3,_,_,_,_,_,_,_,M3,M3,M1,M4,0,M4,M4,_,400,M3,M1,_,_,_,_,_,
       M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M5,0,M4,M3,_,300,M3,M3,0,M3,M2,_,300,M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M6,0,H1,H1,_,300,H1,H1,0,H1,H2,_,M5,300,
       M6,M7,H1,0,M7,H1,_,H3,700,H6,700,H5,_,H4,H3,_,H3,H2,_,
       M6,700,M7,H1,_,700,H1,0,H2,H1,_,H1,M7,300,H1,0,H2,_,H1,700,M7,H1,_,_,_,
       400,M3,M3,0,M6,M6,_,_,400,M1,M2,0,M3,M3,_,400,_,_,_,_,_,_,_,_,M3,M3,0,M6,M6,_,_,400,_,M5,M5,M4,M3,_,_,_,_,_,_,_,_,
       M3,M3,M6,_,M1,M2,M3,_,_,_,_,_,_,_,M3,M3,M1,M4,0,M4,M4,_,400,M3,M1,_,_,_,_,_,
       M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M5,0,M4,M3,_,300,M3,M3,0,M3,M2,_,300,M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M6,0,H1,H1,_,300,H1,H1,0,H1,H2,_,M5,300,M6,M7,H1,0,M7,H1,_,H3,700,H6,700,H5,_,H4,H3,_,H3,H2,_,
       M6,700,M7,H1,_,700,H1,0,H2,H1,_,H1,M7,300,H1,0,H2,_,H1,700,M7,H1,_,_,_,
       M5,0,L7,M1,_,_,L7,300,M1,0,L7,M1,300,L7,L5,M5,0,L7,M1,_,L7,300,M7,0,L6,L7,300,M1,L5,M5,0,L7,M1,_,_,L7,300,M1,0,L7,M1,300,M2,L5,M5,0,L7,M1,_,L7,L7,M1,300,M2,M2,_,
       M5,0,L7,M1,_,_,L7,300,M1,0,L7,M1,300,L7,L5,M5,0,M5,M1,300,M1,700,0,M1,300,L7,0,L6,L7,300,M1,L5,M5,0,L7,M1,_,L7,300,M1,0,M2,M3,300,M4,M3,M1,0,L5,M1,300,M2,0,M1,M2,M2,M3,300,M4,M3,_,
       M5,0,L7,M1,_,_,L7,300,M1,0,L7,M1,300,L7,L5,M5,0,L7,M1,_,_,L7,300,M1,0,L7,M1,300,L7,L5,M5,0,L7,M1,_,_,L7,300,M1,0,L7,L6,300,M2,L5,M5,0,L7,M1,_,L7,L7,M1,300,M2,M2,_,
       M5,0,M2,M3,300,M3,M1,M2,0,M3,M4,300,M6,M5,M5,_,M5,_,M4,0,M3,M2,300,M3,M5,0,L7,M1,_,L7,300,M1,0,M2,M3,300,M4,M3,M4,0,M3,M2,300,M1,0,M5,M1,M2,M3,300,M4,M3,_,
       X6,L6,M3,M1,M1,L4,M4,M1,X1,L5,M3,M1,L7,M1,M2,L5,
       X6,L6,M3,M1,M1,L4,M4,M1,X1,L5,M3,M1,L7,M1,M2,L5,
       X6,L6,M3,M1,M1,L4,M4,M1,X1,L5,M3,M1,L7,M1,M2,L5,
       X6,L6,M3,M1,M1,L4,M4,M1,X1,L5,M3,M1,_,_,
       M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M5,0,M4,M3,_,300,M3,M3,0,M3,M2,_,300,M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M6,0,H1,H1,_,300,H1,H1,0,H1,H2,_,M5,300,M6,M7,H1,0,M7,H1,_,H3,700,H6,700,H5,_,H4,H3,_,H3,H2,_,
       M6,700,M7,H1,_,700,H1,0,H2,H1,_,H1,M7,300,H1,0,H2,_,H1,0,M7,H1,300,H1,
       M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M5,0,M4,M3,_,300,M3,M3,0,M3,M2,_,300,M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M6,0,H1,H1,_,300,H1,H1,0,H1,H2,_,M5,300,M6,M7,H1,0,M7,H1,_,H3,700,H6,700,H5,_,H4,H3,_,H3,H2,_,
       M6,700,M7,H1,_,700,H1,0,H2,H1,_,H1,M7,300,H1,0,H2,_,H1,0,M7,H1,300,H1,
       M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M5,0,M4,M3,_,300,M3,M3,0,M3,M2,_,300,M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M6,0,H1,H1,_,300,H1,H1,0,H1,H2,_,M5,300,
       M6,M7,H1,0,M7,H1,_,H3,700,H6,700,H5,_,H4,H3,_,H3,H2,_,M6,700,M7,H1,_,700,H1,0,H2,H1,_,H1,M7,300,H1,0,H2,_,H1,700,M7,H1,_,_,_,
       400,M3,M3,0,M6,M6,_,_,400,M1,M2,0,M3,M3,_,400,_,_,_,_,_,_,_,_,M3,M3,0,M6,M6,_,_,400,_,M5,M5,M4,M3,_,_,_,_,_,_,_,_,
       M3,M3,M6,_,M1,M2,M3,_,_,_,_,_,_,_,M3,M3,M1,0,M4,300,M4,M4,_,400,M3,M1,_,_,_,_,_,
    };
    for (auto i : trivial) {
        if (i == LOW_SPEED || i == HIGH_SPEED || i == MIDDLE_SPEED) {
            sleep = i;//Sleep(i/2);
            continue;
        }
        if (i == 0) { sleep = 150; continue; }
        if (i == 700) { Sleep(180); continue; }
        if (i == _) {
            Sleep(300);
            continue;
        }
        voice = (volume << 16) + (i << 8) + 0x90;
        midiOutShortMsg(handle, voice);
        cout << voice << endl;
        Sleep(sleep);
    }
    midiOutClose(handle);
}
int main()
{
    Trivial();
    return 0;
}

2.2 海阔天空

#include <iostream>
#include <Windows.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
{
    X1 = C2, X2 = D2, X3 = E2, X4 = F2, X5 = G2, X6 = A2, X7 = B2,
    L1 = C3, L2 = D3, L3 = E3, L4 = F3, L5 = G3, L6 = A3, L7 = B3,
    M1 = C4, M2 = D4, M3 = E4, M4 = F4, M5 = G4, M6 = A4, M7 = B4,
    H1 = C5, H2 = D5, H3 = E5, H4 = F5, H5 = G5, H6 = A5, H7 = B5,
    LOW_SPEED = 500, MIDDLE_SPEED = 400, HIGH_SPEED = 300,
    _ = 0XFF
};
void HKTK()
{
    HMIDIOUT handle;
    midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL);
    //midiOutShortMsg(handle, 34 << 8 | 0xC0);
    int volume = 0x7f;
    int voice = 0x0;
    int sleep = 400; int tmp = 0;
    int hktk[] =
    {
     X4,(H7 - 1),_,H6,_,_,_, H5,H4,H3,H2,_,(L7 - 1),M1,M4,(X7 - 1),_,_,_,_, (L7 - 1),M1,M4,(X7 - 1),_,_,_,_,(L7 - 1),M1,M5,M4,_,_,_,_,_,M4,_,M3,_,_,_,
     1000,M3,0,M2,700,300,M1,_,_,_,_,_,_,0,M3,M4,300,M5,0,M5,M5,300,_,M6,700,M5,_,_,
     0,M6,M7,300,H1,0,H1,300,H1,700,H1,H1,M7,0,M6,300,M5,700,0,M6,300,_,_,_,_,_,
     M6,M5,M5,_,_,M5,M3,_,M3,M4,M3,M2,M2,0,M3,M2,300,_,_,M3,0,M2,M2,_,300,M1,M1,0,M1,M1,300,_,_,M2,M1,M1,_,_,_,_,_,_,
     1000,M3,0,M2,700,300,M1,_,_,_,_,_,_,0,M3,M4,300,M5,0,M5,M5,300,_,M6,700,M5,_,_,
     0,M6,M7,300,H1,0,H1,300,H1,700,H1,H1,M7,0,M6,300,M5,700,0,M6,300,_,_,_,_,_,
     M6,M5,M5,_,_,M5,M3,_,M3,M4,M3,M2,M2,0,M3,M2,300,_,_,M3,0,M2,M2,_,300,M1,M1,0,M1,M1,300,_,_,M2,M1,M1,_,_,_,_,_,_,
     _,0,M6,M7,300,H1,0,H1,H1,_,300,H1,M7,M6,0,M5,300,M5,700,M5,_,0,M3,300,M2,700,M1,_,_,_,_,0,H1,H1,300,H1,0,H1,H2,_,300,H2,0,H1,300,H2,700,H3,_,_,_,H3,0,H2,300,H1,700,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
     1000,M3,0,M2,700,300,M1,_,_,_,_,_,_,0,M3,M4,300,M5,0,M5,M5,300,_,M6,700,M5,_,_,
     0,M6,M7,300,H1,0,H1,300,H1,700,H1,H1,M7,0,M6,300,M5,700,0,M6,300,_,_,_,_,_,
     M6,M5,M5,_,_,M5,M3,_,M3,M4,M3,M2,M2,0,M3,M2,300,_,_,M3,0,M2,M2,_,300,M1,M1,0,M1,M1,300,_,_,M2,M1,M1,_,_,_,_,_,_,
     _,0,M6,M7,300,H1,0,H1,H1,_,300,H1,M7,M6,0,M5,300,M5,700,M5,_,0,M3,300,M2,700,M1,_,_,_,_,0,H1,H1,300,H1,0,H1,H2,_,300,H2,0,H1,300,H2,700,H3,_,_,_,H3,0,H2,300,H1,700,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
     M6,M6,M7,M6,M7,H1,_,_,_,0,H1,H1,300,H2,H1,H2,H3,_,_,_,H3,H2,_,_,0,H2,H3,300,H1,_,_,_,_,_,
     _,0,M6,M7,300,H1,0,H1,H1,_,300,H1,M7,M6,0,M5,300,M5,700,M5,_,0,M3,300,M2,700,M1,_,_,_,_,0,H1,H1,300,H1,0,H1,H2,_,300,H2,0,H1,300,H2,700,H3,_,_,_,H3,0,H2,300,H1,700,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
      _,0,M6,M7,300,H1,0,H1,H1,_,300,H1,M7,M6,0,M5,300,M5,700,M5,_,0,M3,300,M2,700,M1,_,_,_,_,0,H1,H1,300,H1,0,H1,H2,_,300,H2,0,H1,300,H2,700,H3,_,_,_,H3,0,H2,300,H1,700,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
     _,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
    };
    for (auto i : hktk) {
        if (i == LOW_SPEED || i == HIGH_SPEED || i == MIDDLE_SPEED) {
            sleep = i;//Sleep(i/2);
            continue;
        }
        if (i == 0) { sleep = 200; continue; }
        if (i == 700) { Sleep(200); continue; }
        if (i == _) {
            Sleep(400);
            continue;
        }
        if (i == 1000) { tmp = +5; continue; }
        // if (i == 900) volume += 100;
        voice = (volume << 16) + ((i + tmp) << 8) + 0x90;
        midiOutShortMsg(handle, voice);
        cout << voice << endl;
        Sleep(sleep);
    }
    midiOutClose(handle);
}
int main()
{
    HKTK();
    return 0;
}


相关文章
|
1月前
|
JSON JavaScript API
MCP 实战:用配置与真实代码玩转 GitHub 集成
MCP 实战:用配置与真实代码玩转 GitHub 集成
732 4
|
3月前
|
人工智能 网络安全 开发工具
vscode代码推送到github库菜鸡专用教程
vscode代码推送到github库菜鸡专用教程
|
5月前
|
Devops Shell 网络安全
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
233 16
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
|
8月前
|
开发工具 git Python
代码管理记录(二):Github代码上传实操
本文是关于如何使用Git将本地代码上传到GitHub的实操指南。介绍了Git的基本概念、安装方法,并通过详细的步骤指导用户从GitHub创建仓库到使用Git命令初始化、添加、提交代码,最终将代码推送到远程仓库。同时,还汇总了一些常见的错误及其解决方法。
213 2
代码管理记录(二):Github代码上传实操
|
8月前
为什么 GitHub Pages 的文章标题不能以 @ 开头?
本文记录了一个 GitHub Pages 博客网页上文章标题以 `@` 开头导致的问题,并分析了原因,提供了解决方法。
96 0
|
8月前
|
程序员
github登录+注册方法
github登录+注册方法
235 0
|
10月前
|
数据安全/隐私保护
【Azure Developer】Github Action使用Azure/login@v1插件登录遇见错误的替代方案
【Azure Developer】Github Action使用Azure/login@v1插件登录遇见错误的替代方案
115 0
|
10月前
|
存储
【Azure Developer】Github Action部署资源(ARM模板)到Azure中国区时,遇见登录问题的解决办法
【Azure Developer】Github Action部署资源(ARM模板)到Azure中国区时,遇见登录问题的解决办法
101 0
GitHub使用教程、注册与安装
GitHub注册与安装 本文提供全流程,中文翻译。Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 —— 高分辨率用户请调整网页缩放比例至200%) 1 进入GitHub官网:https://github.com —— 注册账号 2 注册成功后,即可跳转至以下界面。
1427 0
GitHub注册与安装
GitHub注册与安装 本文提供全流程,中文翻译。Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 —— 高分辨率用户请调整网页缩放比例至200%) 1 进入GitHub官网:https://github.com —— 注册账号 2 注册成功后,即可跳转至以下界面。
1070 0

热门文章

最新文章