国产精品久久久aaaa,日日干夜夜操天天插,亚洲乱熟女香蕉一区二区三区少妇,99精品国产高清一区二区三区,国产成人精品一区二区色戒,久久久国产精品成人免费,亚洲精品毛片久久久久,99久久婷婷国产综合精品电影,国产一区二区三区任你鲁

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示

如何使用Arduino Processing和Wekinator按鈕更改聲音播放器的音高

454398 ? 來源:工程師吳畏 ? 2019-07-30 14:33 ? 次閱讀
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

設置Arduino Board

這個項目使用連接到Arduino Uno的五個按鈕。使用Arduino為按鈕建立連接,如下圖所示。

項目草圖

在輸入端,我們將有一個Arduino草圖和一個Processing草圖。 Arduino草圖將讀取五個按鈕的狀態,并通過串行通信將其轉發到Processing。 Processing sketch將接收此數據,并通過OSC(開放式聲音控制)協議將其轉發給Wekinator。

Arduino Sketch

#define buttonPin1 6

#define buttonPin2 5

#define buttonPin3 4

#define buttonPin4 3

#define buttonPin5 2

int inByte = 0; // incoming serial byte

// the setup function runs once when you press reset or power the board

void setup() {

Serial.begin(115200);

pinMode(buttonPin1, INPUT);

pinMode(buttonPin2, INPUT);

pinMode(buttonPin3, INPUT);

pinMode(buttonPin4, INPUT);

pinMode(buttonPin5, INPUT);

establishContact(); // send a byte to establish contact until receiver

// responds

}

// the loop function runs over and over again forever

void loop() {

// if we get a valid byte, read button pins:

if (Serial.available() 》 0) {

// get incoming byte:

inByte = Serial.read();

// read the state of the pushbuttons:

int buttonState1 = digitalRead(buttonPin1);

int buttonState2 = digitalRead(buttonPin2);

int buttonState3 = digitalRead(buttonPin3);

int buttonState4 = digitalRead(buttonPin4);

int buttonState5 = digitalRead(buttonPin5);

Serial.write(buttonState1);

Serial.write(buttonState2);

Serial.write(buttonState3);

Serial.write(buttonState4);

Serial.write(buttonState5);

}

}

void establishContact() {

while (Serial.available() 《= 0) {

Serial.print(‘A’); // send a capital A

delay(300);

}

}

處理草圖

import processing.serial.*;

import oscP5.*;

import netP5.*;

OscP5 oscP5;

NetAddress dest;

Serial myPort; // The serial port

int[] serialInArray = new int[5]; // Where we‘ll put what we receive

int serialCount = 0; // A count of how many bytes we receive

int button1, button2, button3, button4, button5;

boolean firstContact = false; // Whether we’ve heard from the microcontroller

void setup() {

size(256, 256); // Stage size

noStroke(); // No border on the next thing drawn

// Print a list of the serial ports, for debugging purposes:

println(Serial.list());

// I know that the first port in the serial list on my mac

// is always my FTDI adaptor, so I open Serial.list()[0]。

// On Windows machines, this generally opens COM1.

// Open whatever port is the one you‘re using.

String portName = Serial.list()[0];

myPort = new Serial(this, portName, 115200);

/* start oscP5, sending messages at port 9000 */

oscP5 = new OscP5(this,9000);

dest = new NetAddress(“127.0.0.1”,6448);

}

void draw() {

//Send the OSC message

sendOsc();

}

void serialEvent(Serial myPort) {

// read a byte from the serial port:

int inByte = myPort.read();

// if this is the first byte received, and it’s an A,

// clear the serial buffer and note that you‘ve

// had first contact from the microcontroller.

// Otherwise, add the incoming byte to the array:

if (firstContact == false) {

if (inByte == ’A‘) {

myPort.clear(); // clear the serial port buffer

firstContact = true; // you’ve had first contact from the microcontroller

myPort.write(‘A’); // ask for more

}

}

else {

// Add the latest byte from the serial port to array:

serialInArray[serialCount] = inByte;

serialCount++;

// If we have 3 bytes:

if (serialCount 》 4 ) {

button1 = serialInArray[0];

button2 = serialInArray[1];

button3 = serialInArray[2];

button4 = serialInArray[3];

button5 = serialInArray[4];

// print the values (for debugging purposes only):

println(button1 + “&” + button2 + “&” + button3 + “&” + button4 + “&” + button5);

// Send a capital A to request new sensor readings:

myPort.write(‘A’);

// Reset serialCount:

serialCount = 0;

}

}

}

void sendOsc() {

OscMessage msg = new OscMessage(“/wek/inputs”);

msg.add((float)button1);

msg.add((float)button2);

msg.add((float)button3);

msg.add((float)button4);

msg.add((float)button5);

oscP5.send(msg, dest);

}

設置ChucK

在輸出端,我們可以使用ChucK從Wekinator接收五個連續輸出,并根據這些輸出發出聲音。

下載您正在使用的操作系統的FM Synthesis示例。

現在打開終端并轉到您放置它的目錄并輸入以下行:

chuck FMSynth_5ContinousOutputs.ck

Chuck將開始收聽Wekinator的輸出并接收輸出,它將改變聲音的音高。

設置Wekinator

現在打開Wekinator并對設置進行以下調整:

將輸入設置為5并輸出為5

選擇輸出鍵入到所有連續

Wekinator將從Processing接收五個輸入,并在訓練后將向Chuck發送五個不同的輸出。從那里,ChucK將根據Wekinator輸出產生不同的聲音。

點擊 下一步 按鈕,您將看到此窗口:

按第一個按鈕,然后單擊 隨機化 。開始錄制一秒鐘,它將記錄一些樣本。

按第二個按鈕,然后單擊 隨機化 的。然后記錄一秒。

同樣,記錄其他三個按鈕的樣本。

記錄五個樣本后,單擊在 火車 上訓練Wekinator。然后單擊 運行 。現在當您按下按鈕時,程序將根據您提供的輸入發出聲音。

相關項目

如何構建Arduino演講者幾分鐘播放音樂

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。 舉報投訴
  • Processing
    +關注

    關注

    0

    文章

    11

    瀏覽量

    9241
  • Arduino
    +關注

    關注

    190

    文章

    6526

    瀏覽量

    196913
收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評論

    相關推薦
    熱點推薦

    TLV320AIC28立體聲音頻編解碼:高性能音頻解決方案解析

    TLV320AIC28立體聲音頻編解碼:高性能音頻解決方案解析 在當今的電子設備中,音頻體驗是至關重要的一環。無論是智能手機、MP3 播放器還是數碼攝像機,都需要高質量的音頻編解碼
    的頭像 發表于 02-03 14:50 ?244次閱讀

    花椒直播開源鴻蒙專屬直播播放器 助力高效開發高性能直播應用

    近日,花椒直播開源了專注于直播場景的播放器“HJPlayer”。它基于自研的通用多媒體框架“HJMedia”打造,與早前開源的推流“HJPusher”共同構成了覆蓋主播推流到觀眾播放的完整客戶端
    的頭像 發表于 10-22 11:20 ?364次閱讀
    花椒直播開源鴻蒙專屬直播<b class='flag-5'>播放器</b> 助力高效開發高性能直播應用

    N9H26播放視頻為什么沒有聲音

    為什么播放視頻 (MJPEG MP3) 但沒有聲音
    發表于 09-01 08:17

    如何使用 M487 微控制 (MCU) 通過 DAC 在 SD 卡上播放 WAV 文件聲音

    使用 M487 微控制 (MCU) 通過 DAC 在 SD 卡上播放 WAV 文件聲音
    發表于 08-20 06:05

    創通聯達助力飛傲M27革新便攜HiFi播放器體驗

    2025年8月15日,飛傲在第19屆深圳國際音頻展(SIAS)正式發布年度旗艦播放器FIIO M27。作為基于創通聯達TurboX C6490 SOM打造的標桿產品,M27憑借該模塊的卓越性能與飛傲自研聲學技術形成協同突破,為用戶帶來全方位、全場景的優秀音頻體驗,全面革新便攜HiFi
    的頭像 發表于 08-19 16:15 ?2126次閱讀

    多路混音聲音播放芯片型號推薦

    以下是唯創知音旗下主流的多路聲音播放芯片深度解析,結合精準參數、豐富場景及技術特性,滿足智能設備多樣化音頻需求: 一、WTV380/890 系列:高集成多模態交互芯片 核心參數 通道能力:支持8 路
    的頭像 發表于 08-15 16:51 ?864次閱讀

    【創龍TL3562-MiniEVM開發板試用體驗】9、帶音頻波形顯示的QT音樂播放器

    時域波形:直觀展示聲音的音量變化 (如聲波的震動幅度),默認情況下顯示的是時域信號。,而不是頻率。數據來源是原始PCM樣本。 在 Qt 中為音頻播放器增加頻譜顯示功能,可以通過
    發表于 08-08 19:18

    Made with KiCad(135):Echo - 開源的音樂播放器

    “? Echo 是一個開源硬件平臺,專為音樂播放器設計。該項目的目標是開發一款基于開源軟件并采用開源設計的高品質音樂播放器。 ” ? Made with KiCad 系列將支持新的展示方式。直接將以
    的頭像 發表于 07-16 11:17 ?3106次閱讀
    Made with KiCad(135):Echo - 開源的音樂<b class='flag-5'>播放器</b>

    在使用EZ-USB? FX3? 設備時,上電后相機開始正常工作,但延時10s左右播放器才能夠顯示圖像數據?為什么?

    在使用EZ-USB? FX3? 設備時,上電后相機開始正常工作,但延時10s左右播放器才能夠顯示圖像數據?這是由于固件中的某些設置問題嗎?
    發表于 07-16 07:08

    基于STM32的音樂播放器電路+PCB源文件+源碼+論文等打包下載

    基于STM32的音樂播放器電路+PCB源文件+源碼+論文等打包,推薦下載!
    發表于 05-29 21:37

    【開源分享】用ESP32復刻一個iPod :便攜式音樂播放器Tangara

    Tangara是一款便攜式開源音樂播放器,硬件電路使用KiCad設計,而且它的外殼和固件也是100%開源,點擊閱讀原文或下載鏈接可跳轉下載。它通過3.5毫米耳機插孔或藍牙輸出高品質聲音,電池續航
    的頭像 發表于 04-22 08:05 ?2104次閱讀
    【開源分享】用ESP32復刻一個iPod :便攜式音樂<b class='flag-5'>播放器</b>Tangara

    【開源分享】用ESP32復刻一個iPod :便攜式音樂播放器Tangara

    Tangara 是一款便攜式音樂播放器。它通過 3.5 毫米耳機插孔或藍牙輸出高品質聲音,電池續航時間長,并包括一個功能強大的處理,足以支持您可以投入的任何音頻格式。它也是運行開源軟件的 100
    發表于 04-21 11:35

    Made with KiCad:Tangara 便攜式音樂播放器

    “ Tangara 是一款便攜式音樂播放器。它可通過 3.5 毫米耳機插孔或藍牙輸出高品質音質,電池續航時間長。” Made with KiCad 系列將支持新的展示方式。直接將以下鏈接復制到
    發表于 04-16 14:01

    PCM2912APJTR設計的USB聲卡播放聲音有噠噠的聲音的原因有哪些

    最近學習PCB設計設計了一個USB聲卡,電路圖參考了官方demo模塊的原理圖,但是設計出來的板子發現播放音樂會有噠噠的聲音。本人由于是初學者,所以有點不懂是PCB不對的問題還是原理圖設計的問題了。 希望有人能夠給點修改建議。 下面是原理圖。 布線圖如下:
    發表于 03-21 11:54

    一款新的播放器:Xibo for ChromeOS介紹

    我們非常高興地宣布與 ChromeOS 合作推出一款新的播放器。為您帶來 Xibo for ChromeOS!這一最新的可靠、高度安全且易于管理的數字標牌解決方案使客戶能夠充分利用 Xibo CMS
    的頭像 發表于 03-14 09:26 ?1345次閱讀