Autor Beitrag
Norbert Stellberg
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Di 03.08.10 17:39 
Hallo,

kann mir bitte jemand folgende Fragen beantworten:

1. BASS_MIDI_StreamEvent(Chan,xxxx , MIDI_EVENT_TRANSPOSE, Value);
Der Parameter xxxx muß welchen Wert haben ?
Der Parameter Value hat welchen Wertebereich?

2. BASS_ChannelSetAttribute(chan, BASS_ATTRIB_TEMPO, Value );
Der Parameter Value hat welchen Wertebereich?

3. Wie kann ich die Lyrics in einem Midifile in z.B. ein Memo übertragen?


Sorry, die Hilfe von Bass ist leider nur in C (Ich tu mich schon mit Delphi schwer :))

Vielen Dank.
Mit freundlichen Grüßen
Norbert


Moderiert von user profile iconGausi: Topic aus Open Source Projekte verschoben am Di 03.08.2010 um 17:47
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Di 03.08.10 18:23 
user profile iconNorbert Stellberg hat folgendes geschrieben Zum zitierten Posting springen:
1. BASS_MIDI_StreamEvent(Chan,xxxx , MIDI_EVENT_TRANSPOSE, Value);
Der Parameter xxxx muß welchen Wert haben ?
Der Parameter Value hat welchen Wertebereich?

Laut bassmidi.pas brauchst hat BASS_MIDI_StreamEvent folgende Parameter: (handle:HSTREAM; chan,event,param:DWORD) und den Rückgabewert Boolean (DWORD ist eine ganzzahl ;) in delphi auch Cardinal oder Longword genannt). Und der Rest der Hilfedatei sollte eigentlich verständlich sein:
Zitat:
Parameters
handle The MIDI stream to apply the event to.
chan The MIDI channel to apply the event to... 0 = channel 1.
event The event to apply, see the table below.
param The event parameter.


Event types, with param definitions.
MIDI_EVENT_NOTE Press or release a key.
param : LOBYTE = key number (0-127, 60=middle C), HIBYTE = velocity (0=release, 1-127=press).
MIDI_EVENT_PROGRAM Select the preset/instrument to use. Standard soundfont presets follow the General MIDI standard, and generally also include Roland GS variations in other banks (accessible via the MIDI_EVENT_BANK event).
param : preset number (0-127).
MIDI_EVENT_CHANPRES Set the channel pressure.
param : pressure level (0-127).
MIDI_EVENT_PITCH Set the pitch wheel position.
param : pitch wheel position (0-16383, 8192=normal/middle).
MIDI_EVENT_BANK Select the bank to use (MIDI controller 0).
param : bank number (0-127).
MIDI_EVENT_MODULATION Set the modulation (MIDI controller 1)
param : modulation level (0-127).
MIDI_EVENT_PORTATIME Set the portamento time (MIDI controller 5).
param : portamento time (0-127).
MIDI_EVENT_VOLUME Set the volume (MIDI controller 7).
param : volume level (0-127).
MIDI_EVENT_PAN Set the pan position (MIDI controller 10).
param : pan position (0-127, 64=middle).
MIDI_EVENT_EXPRESSION Set the expression (MIDI controller 11).
param : expression level (0-127).
MIDI_EVENT_SUSTAIN Set the sustain switch (MIDI controller 64).
param : enable sustain? (0-63=no, 64-127=yes).
MIDI_EVENT_PORTAMENTO Set the portamento switch (MIDI controller 65).
param : enable portamento? (0-63=no, 64-127=yes).
MIDI_EVENT_RESONANCE Set the low-pass filter resonance (MIDI controller 71, NRPN 121h)
param : resonance level (0-127, 0=-64, 64=normal, 127=+63).
MIDI_EVENT_RELEASE Set the release time (MIDI controller 72, NRPN 166h)
param : release time (0-127, 0=-64, 64=normal, 127=+63).
MIDI_EVENT_ATTACK Set the attack time (MIDI controller 73, NRPN 163h)
param : attack time (0-127, 0=-64, 64=normal, 127=+63).
MIDI_EVENT_CUTOFF Set the low-pass filter cutoff (MIDI controller 74, NRPN 120h)
param : cutoff level (0-127, 0=-64, 64=normal, 127=+63).
MIDI_EVENT_PORTANOTE Set the portamento start key; the next note starts at this key (MIDI controller 84).
param : key number (1-127, 60=middle C).
MIDI_EVENT_REVERB Set the reverb send level (MIDI controller 91)
param : reverb level (0-127).
MIDI_EVENT_CHORUS Set the chorus send level (MIDI controller 93)
param : chorus level (0-127).
MIDI_EVENT_SOUNDOFF Stop all sounds (MIDI controller 120).
param : not used.
MIDI_EVENT_RESET Reset controllers (MIDI controller 121), that is modulation=0, expression=127, sustain=0, portamento=0, release time=64, attack time=64, pitch wheel=8192, channel pressure=0.
param : not used.
MIDI_EVENT_NOTESOFF Release all keys (MIDI controller 123).
param : not used.
MIDI_EVENT_MODE Set poly/mono mode (MIDI controllers 126 & 127).
param : mode (0=poly, 1=mono).
MIDI_EVENT_PITCHRANGE Set pitch wheel range (MIDI RPN 0).
param : range in semitones.
MIDI_EVENT_FINETUNE Set the fine tuning (MIDI RPN 1).
param : finetune in cents (0-16383, 0=-100, 8192=normal, 16383=+100).
MIDI_EVENT_COARSETUNE Set the coarse tuning (MIDI RPN 2).
param : finetune in semitones (0-127, 0=-64, 64=normal, 127=+63).
MIDI_EVENT_DRUMS Set the percussion/drums channel switch.
param : use drums? (0=no, 1=yes).
MIDI_EVENT_DRUM_CUTOFF Set the low-pass filter cutoff of a drum key (MIDI NRPN 14knh)
param : LOBYTE = key number (0-127), HIBYTE = cutoff level (0-127, 0=-64, 64=normal, 127=+63).
MIDI_EVENT_DRUM_RESONANCE Set the low-pass filter resonance of a drum key (MIDI NRPN 15knh)
param : LOBYTE = key number (0-127), HIBYTE = resonance level (0-127, 0=-64, 64=normal, 127=+63).
MIDI_EVENT_DRUM_COARSETUNE Set the coarse tuning of a drum key (MIDI NRPN 18knh).
param : LOBYTE = key number (0-127), HIBYTE = finetune in semitones (0-127, 0=-64, 64=normal, 127=+63).
MIDI_EVENT_DRUM_FINETUNE Set the fine tuning of a drum key (MIDI NRPN 19knh).
param : LOBYTE = key number (0-127), HIBYTE = finetune in cents (0-127, 0=-100, 64=normal, 127=+100).
MIDI_EVENT_DRUM_LEVEL Set the level of a drum key (MIDI NRPN 1Aknh)
param : LOBYTE = key number (0-127), HIBYTE = level (0-127, 127=normal/full).
MIDI_EVENT_DRUM_PAN Set the pan position of a drum key (MIDI NRPN 1Cknh).
param : LOBYTE = key number (0-127), HIBYTE = pan position (0-127, 0=random, 64=middle).
MIDI_EVENT_DRUM_REVERB Set the reverb send level of a drum key (MIDI NRPN 1Dknh)
param : LOBYTE = key number (0-127), HIBYTE = reverb level (0-127).
MIDI_EVENT_DRUM_CHORUS Set the chorus send level of a drum key (MIDI NRPN 1Eknh)
param : LOBYTE = key number (0-127), HIBYTE = chorus level (0-127).
Global events.


MIDI_EVENT_TEMPO Set the tempo (MIDI meta event 81). Changing the tempo affects the stream length, and the BASS_ChannelGetLength byte value will no longer be valid.
param : tempo in microseconds per quarter note.
MIDI_EVENT_MASTERVOL Set the master volume.
param : volume level (0-16383, 0=silent, 16363=normal/full).
MIDI_EVENT_REVERB_TIME Set the reverb time.
param : reverb time in milliseconds.
MIDI_EVENT_REVERB_DELAY Set the reverb delay.
param : reverb delay in millisecond 10ths.
MIDI_EVENT_REVERB_LOCUTOFF Set the reverb low-pass cutoff
param : reverb low-pass cutoff in hertz (0=off).
MIDI_EVENT_REVERB_HICUTOFF Set the reverb high-pass cutoff
param : reverb high-pass cutoff in hertz (0=off).
MIDI_EVENT_REVERB_LEVEL Set the reverb level
param : reverb level (0=off, 100=0dB, 200=+6dB).
MIDI_EVENT_CHORUS_DELAY Set the chorus delay.
param : chorus delay in millisecond 10ths.
MIDI_EVENT_CHORUS_DEPTH Set the chorus depth.
param : chorus depth in millisecond 10ths.
MIDI_EVENT_CHORUS_RATE Set the chorus rate.
param : chorus rate in hertz 100ths.
MIDI_EVENT_CHORUS_FEEDBACK Set the chorus feedback level.
param : chorus feedback level (0=-100%, 100=off, 200=+100%).
MIDI_EVENT_CHORUS_LEVEL Set the chorus level.
param : chorus level (0=off, 100=0dB, 200=+6dB).
MIDI_EVENT_CHORUS_REVERB Set the chorus send to reverb level.
param : chorus send to reverb level (0=off, 100=0dB, 200=+6dB).
Other (non-MIDI) events.


MIDI_EVENT_MIXLEVEL Set the level.
param : the level (0=silent, 100=0dB, 200=+6dB).
MIDI_EVENT_TRANSPOSE Transpose all notes. Changes take effect from the next note played, and affect melodic channels only (not drum channels).
param : transposition amount in semitones (0=-100, 100=normal, 200=+100).


Return value
If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes
BASS_ERROR_HANDLE handle is not valid.
BASS_ERROR_ILLPARAM One of the other parameters is invalid.
BASS_ERROR_NOTAVAIL Tempo only applies to MIDI file streams.


Remarks
Apart from the "global" events, all events apply only to the specified MIDI channel.

Events applied to a MIDI file stream can subsequently be overridden by events in the file itself, and will also be overridden when seeking or looping. This applies to all events apart from the "non-MIDI" events. Syncs can be used to be informed of when event values change.

If the MIDI stream is being played (it's not a decoding channel), then there will be some delay in the effect of the event being heard. This latency can be reduced by making use of the BASS_CONFIG_BUFFER and BASS_CONFIG_UPDATEPERIOD config options when creating the stream.


user profile iconNorbert Stellberg hat folgendes geschrieben Zum zitierten Posting springen:
2. BASS_ChannelSetAttribute(chan, BASS_ATTRIB_TEMPO, Value );
Der Parameter Value hat welchen Wertebereich?

Laut Bass.pas hat ist Value ein Float, also eine Gleitkommazahl. Der Rest aus der Hilfe sollte eigentlich verständlich sein:
Zitat:
handle The channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD.
attrib The attribute to set the value of... one of the following.
BASS_ATTRIB_EAXMIX EAX wet/dry mix. (HCHANNEL/HMUSIC/HSTREAM only)
BASS_ATTRIB_FREQ Sample rate.
BASS_ATTRIB_MUSIC_AMPLIFY Amplification level. (HMUSIC)
BASS_ATTRIB_MUSIC_BPM BPM. (HMUSIC)
BASS_ATTRIB_MUSIC_PANSEP Pan separation level. (HMUSIC)
BASS_ATTRIB_MUSIC_PSCALER Position scaler. (HMUSIC)
BASS_ATTRIB_MUSIC_SPEED Speed. (HMUSIC)
BASS_ATTRIB_MUSIC_VOL_CHAN A channel volume level. (HMUSIC)
BASS_ATTRIB_MUSIC_VOL_GLOBAL Global volume level. (HMUSIC)
BASS_ATTRIB_MUSIC_VOL_INST An instrument/sample volume level. (HMUSIC)
BASS_ATTRIB_PAN Panning/balance position.
BASS_ATTRIB_VOL Volume level.
other attributes may be supported by add-ons, see the documentation.

value The new attribute value. See the attribute's documentation for details on the possible values.


Return value
If successful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes
BASS_ERROR_HANDLE handle is not a valid channel.
BASS_ERROR_ILLTYPE attrib is not valid.
BASS_ERROR_ILLPARAM value is not valid. See the attribute's documentation for the valid range of values.
some attributes may have additional error codes, see the documentation.


Remarks
The actual attribute value may not be exactly the same as requested, due to precision differences. For example, an attribute might only allow whole number values. BASS_ChannelGetAttribute can be used to confirm what the value is.


user profile iconNorbert Stellberg hat folgendes geschrieben Zum zitierten Posting springen:
3. Wie kann ich die Lyrics in einem Midifile in z.B. ein Memo übertragen?


Da kann ich dir auch nicht weiterhelfen, tut mir leid.

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Norbert Stellberg Threadstarter
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Di 03.08.10 18:43 
Hallo,

danke für Deine Hilfe.
Zitat:
Da steh' ich nun ich dummer Tor und bin so klug als wie zuvor :)

param : tempo in microseconds per quarter note.

Und bitte wie ist dieser Wertebereich?

--------
BASS_MIDI_StreamEvent(Chan, xxxx, MIDI_EVENT_TRANSPOSE, Value);

Ich habe diesen Wert mal mit 1 ersetzt. Da konnte ich schon eine Änderung erkennen.
Da aber Channel einen Bereich von 1-16 (0..15) haben kann, ist also die Frage,
ob ich bei xxxx
For i := 1 to 16 do
BASS_MIDI_StreamEvent(Chan, i, MIDI_EVENT_TRANSPOSE, Value);
ausführen muß oder obe ein einmaliges aufrufen dieser Funktion mit dem Wert 1 ausreichend ist.


Ok Value kann also einen Wert von 0 bis 65000 haben
Das gibt aber doch keinen Sinn! Transponiere mal ein Midi mit diesem Wertebereich!

Ich habe mal 120 versucht. Das ist schon ziemlich hoch.
Leider habe ich keine Logik gefunden, die mir den Wert erklärt.
120 Töne nach oben, das sind 10 Oktaven !

Mit freundlichen Grüßen
Norbert
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Di 03.08.10 18:53 
bei MIDI_EVENT_TRANSPOSE hat der param aber ne andere bedeutung. ;) (also bei 120 hast du es um 20 halbtöne nach oben transponiert, demnach um 10 ganztöne.)

Zitat:

MIDI_EVENT_TRANSPOSE
Transpose all notes. Changes take effect from the next note played, and affect melodic channels only (not drum channels).
param : transposition amount in semitones (0=-100, 100=normal, 200=+100)


Für welchen Channel du das machen willst weiß ich nicht.

Zitat aus de.wikipedia.org:

Jeder MIDI-Befehl (mit Ausnahme systemexklusiver Daten, kurz SysEx genannt) trägt neben seiner Befehlskennung und den Befehlsdaten auch eine Kanalnummer. Die Kanalnummer ist 4 Bit groß, es lassen sich dadurch 24, also 16 Kanäle ansteuern. Je nach Software sind die Kanäle 0-15 oder 1-16 durchnummeriert. Jeder Kanal steuert einen speziellen Klang (Instrument), in der MIDI-Sprache „Programm“ genannt.


Vielleicht solltest du dir mal anschauen wie MIDI spezifiziert ist.

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Norbert Stellberg Threadstarter
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Di 03.08.10 21:06 
Hallo,

Zitat:

param : transposition amount in semitones (0=-100, 100=normal, 200=+100)


Tja, und genau das habe ich gesucht. Warum sehen andere das und ich nicht :)
Vielen Dank.

Mit freundlichen Grüßen
Norbert