MIDI Recording and details improvement
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { NoteSequence } from '@magenta/music/esm/protobuf';
|
||||
|
||||
export const tracksMinimalTotalTime = 5000;
|
||||
|
||||
export type CompositionParams = {
|
||||
prompt: string,
|
||||
maxResponseToken: number,
|
||||
@@ -13,6 +15,69 @@ export type CompositionParams = {
|
||||
export type Track = {
|
||||
id: string;
|
||||
content: string;
|
||||
rawContent: MidiMessage[];
|
||||
offsetTime: number;
|
||||
contentTime: number;
|
||||
};
|
||||
};
|
||||
export type MidiPort = {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type MessageType = 'NoteOff' | 'NoteOn' | 'ElapsedTime' | 'ControlChange';
|
||||
|
||||
export type MidiMessage = {
|
||||
messageType: MessageType;
|
||||
channel: number;
|
||||
note: number;
|
||||
velocity: number;
|
||||
control: number;
|
||||
value: number;
|
||||
}
|
||||
|
||||
export enum InstrumentType {
|
||||
Piano,
|
||||
Percussion,
|
||||
Drum,
|
||||
Tuba,
|
||||
Marimba,
|
||||
Bass,
|
||||
Guitar,
|
||||
Violin,
|
||||
Trumpet,
|
||||
Sax,
|
||||
Flute,
|
||||
Lead,
|
||||
Pad,
|
||||
}
|
||||
|
||||
export const InstrumentTypeNameMap = [
|
||||
'Piano',
|
||||
'Percussion',
|
||||
'Drum',
|
||||
'Tuba',
|
||||
'Marimba',
|
||||
'Bass',
|
||||
'Guitar',
|
||||
'Violin',
|
||||
'Trumpet',
|
||||
'Sax',
|
||||
'Flute',
|
||||
'Lead',
|
||||
'Pad'
|
||||
];
|
||||
|
||||
export const InstrumentTypeTokenMap = [
|
||||
'pi',
|
||||
'p',
|
||||
'd',
|
||||
't',
|
||||
'm',
|
||||
'b',
|
||||
'g',
|
||||
'v',
|
||||
'tr',
|
||||
's',
|
||||
'f',
|
||||
'l',
|
||||
'pa'
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user