კარგია, ზუსტად ის არის რასაც ველოდი..
ზევით დაგიწერე და ალბათ არ ნახე, ეს ადრესი:
https://www.whippedcreamsounds.com/midi-cc-list/ ეს კარგად წაიკითხე და გაითავისე...
ეს არის კონკრეტული მოწყობილობების სია, სადაც მიდის CC მესეჯები... საჭიროა დაკონკრეტება რისი გაკეთება გინდა..
მის შესაბამისად CCPotentiometer ის შეცვლა... ამას მერე მოგწერ... მაგრამ ახლა მოაცილე მთლიანად PBPotentiometer სამი ხაზი
ეს წაშალე, ან მთლიანად დააკომენტარე ასე:
//PBPotentiometer potentiometer {
// A0, // Analog pin connected to potentiometer
// Channel_1, // MIDI Channel 1
//};
შემდეგ გაიმეორე ცდა... წესით იგივე შედეგი უნდა გქონდეს... და
ამობეჭდე ზედა ნახატი მხოლოდ მთლიანად ან დასაწისი 70 მაინც.. განსაკუთრებით მაინტერესებს 7 რას შვრება
სამწუხაროდ არ მაქვს არდუინო და არ შემიძლია შემოწმება...
* * *
ZAZAi თუ იგივე შედეგი გაქვს... მაშინ 37 ხაზს წინ ორი დახრილი ხაზი დაუწერე,
ანუ კომენტარად გადაკეთე და 38 ხაზს მოუშალე ორი დახრილი ხაზი, ანუ გააქტიურე...
სკეჩი ახლა ასე გამოყურება:
/*
* USB MIDI adapter.
* To allow larger sysex packages, modify the Control Surface library as follows:
*
* In:
* src\MIDI_Parsers\MIDI_MessageTypes.hpp
* change:
* uint8_t length;
* to:
* size_t length;
* In:
* src/Settings/Settings.hpp
* change:
* constexpr size_t SYSEX_BUFFER_SIZE = 128;
* to:
* constexpr size_t SYSEX_BUFFER_SIZE = 320;
* This should be fixed when Control Surface 2.x will be released.
* To use a different USB device name, edit hardware/arduino/avr/boards.txt in your Arduino IDE
* install using admin privileges.
* Change:
* leonardo.build.usb_product="Arduino Leonardo"
* to:
* leonardo.build.usb_product="..."
* change it back after uploading the project to your Arduino device.
*/
#include <Control_Surface.h> // Include the Control Surface library
USBMIDI_Interface midiusb;
// use this one instead to dump all MIDI data to the serial monitor
// USBDebugMIDI_Interface midiusb;
HardwareSerialMIDI_Interface midiser = {Serial1, MIDI_BAUD};
// Create a MIDI pipe factory to connect the MIDI interfaces to eachother and to the Control Surface
MIDI_PipeFactory<5> pipes;
// Example for adding extra controllers:
CCPotentiometer pot = { A0, MIDI_CC::Expression_Controller };
//CCPotentiometer pot = { A0, {MIDI_CC::Modulation_Wheel,Channel_1} };
//CCPotentiometer pot = { A1, {MIDI_CC::Channel_Volume,Channel_2} };
// Instantiate a PBPotentiometer object
//PBPotentiometer potentiometer {
// A0, // Analog pin connected to potentiometer
// Channel_1, // MIDI Channel 1
//};
// pin to which the power LED is connected
const int ledPin = 10;
// setup code
void setup() {
Serial.begin(115200);
// turn on the power LED
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);
// forward MIDI USB to MIDI serial
midiusb >> pipes >> midiser;
// forward MIDI serial to MIDI USB
midiser >> pipes >> midiusb;
// send control suface messages only to MIDI USB
Control_Surface >> pipes >> midiusb;
// connect both MIDI USB and serial to control surface
midiser >> pipes >> Control_Surface;
midiusb >> pipes >> Control_Surface;
// initialize Control Surface _after_ connecting the interfaces
Control_Surface.begin();
}
// main processing loop
void loop() {
Control_Surface.loop();
}