seq24: Wäre Sequenzen transponieren zu können interessant?

P

PySeq

|||||
Hi,

aus meinem Python-Skript hab' ich in der Zwischenzeit die Klassen rausgenommen, um es als Prototyp zu benutzen, um es möglicherweise nach C zu übersetzen, damit es noch schneller und reibungsloser läuft.
Dabei hab' ich gemerkt, daß es mit einer Abwandlung auch möglich wäre, einfach eine Sequenz aus seq24 ganz zu übernehmen, und die Tonhöhe der Sequenz mit dem Keyboard zu bestimmen. Also einfach wie bei einem Sequenzer eben. Während eine zweite Drum-Sequenz in seq24 unbeeinflußt synchron daneben laufen könnte.
Ich weiß nicht, ob das seq24 nicht schon selbst kann. Aber ich hab's da nicht gefunden. Grundsätzlich ist seq24 ja recht spartanisch, würde mich wundern, wenn er das schon von sich aus könnte.
(Der JD-Xi kann das mit seinen Sequenzen, was schon recht cool ist.)
Ach, vielleicht werd' ich das sowieso noch machen, aber ich wollt' mal wissen, ob das sonst noch jemanden interessieren würde.
Für den Code des ursprünglichen Skripts scheint sich ja niemand zu interessieren. Obwohl ich damit bisher die erstaunlichsten Klangresultate (unter Linux, aber auch sonst) hatte. Wenn ich zum Modul python-rtmidi wechseln würde, würde es wahrscheinlich sogar auch auf den anderen Betriebssystemen (Win/Mac) laufen, weil rtmidi plattformübergreifend ist. Aber das hat bei mir keine Priorität.
 
Zuletzt bearbeitet:
  • Gute Idee
M.i.a.u.: khz
Sehr gute Idee!
Mit einem Keyboard kann seq24 meines Wissens nicht einzelne Patterns transponieren, nur mit:
7. Hier gelangst du zu den Werkzeugen (unter anderem Quantisieren und Transponieren).
seq24_edit.png
http://wiki.datentraeger.org/index.php?title=Seq24

==> Kann https://github.com/ahlstromcj/sequencer64 mit einem Keyboard einzelne Patterns transponieren?
 
Zuletzt bearbeitet:
Also, bei mir geht das jetzt (die Beispiel-Sequenz hab' ich aus einem Stück von Retrosound entliehen, ich hoffe, das ist für diesen Zweck mal nicht so schlimm (sonst nehme ich den Track auch wieder runter)) :


https://soundcloud.com/hlubenow/transposed-sequencer


Aber es war schon nicht so leicht, das alles zu installieren und all diese Programme zu synchronisieren.
Dabei sind es nur zwei Instrumente (und ein paar Audio-Aussetzer gibt es auch noch, hmm jack-Latenz höher setzen?).
Ich denke, wer sich wirklich für das Skript interessieren sollte und bereit wäre, sich dafür intensiver mit Python, alsaseq, seq24 und jack zu beschäftigen, der sollte mir doch lieber eine PN schreiben. Ich schicke das dann ggf. über Email.

sequencer64 krieg' ich auf meiner alten Distribution und mit 32 bit nicht kompiliert. Es muß bei mir also der alte seq24 sein.
 
Ach, ich poste das Skript einfach mal (nachdem ich eine Sache mit "nonblocking console input" rausgenommen hab', die mir etwas Sorgen gemacht hatte, wenn jemand das Skript laufen läßt, der nicht weiß, was das ist). Also, hier isses. Ist ja eigentlich recht kurz und simpel (das andere mit dem Arp ist etwas komplexer). Anleitung im Skript (oder mit "pydoc ./transposeseq.py"). Ggf. unten dazu fragen:
Python:
#!/usr/bin/python
# coding: utf-8

"""

transposeseq.py

(C) 2019, PySeq. Licence: GNU GPL version 2.

This script creates a jack-alsa-midi-client, that combines midi-input from an external
midi-keyboard (1) with midi input from a software midi sequencer (2) to transpose sequences, played by seq24.

Usage of the script:

1. An external keyboard sending midi on channel 1 should be connected with jack to
   input-port 1 of the script (called "transposeseq" in the jack-connections).

2. A software sequencer like seq24 should be connected with jack to input-port 2 of
   the script. The sequencer should send midi to the script on channel 2.

   When using seq24, set the section "[manual-alsa-ports]" in the file
   "/home/user/.seq24rc" to "1", to make seq24 create several ordinary
   jack-alsa-midi output ports.

3. The output-port of the script should be connected to a (virtual) instrument (like
   ZynAddSubFx for example). Remember to connect the audio output of the instrument
   to the system's output (soundcard) in jack, too.

4. When everything is connected, try sending a pattern of simple 1/8-notes from the
   sequencer to the script and additionally play some notes on the external keyboard.
   You should then hear, that the sequence is transposed according to the notes you
   play.

3. The sequencer program can send other midi patterns to a drum machine at the same time,
   using its other jack-alsa-midi outputs. The sequenced arpeggiator of the script will
   then be in sync to the sound of the drum machine.

-----

GNU GPL copyright notice:

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""

import alsaseq
import os, sys
import signal

NROFMIDIKEYS = 128
VELOCITY = 100

def makeConnections():
    execstr = "aconnect 'Oxygen 25':0 transposeseq:0"
    os.system(execstr)
    execstr = "aconnect seq24:0 transposeseq:1"
    os.system(execstr)
    execstr = "aconnect transposeseq:2 ZynAddSubFX:0"
    os.system(execstr)
    execstr = "jack_connect \"ZynAddSubFX:out_1\" \"system:playback_1\""
    os.system(execstr)
    execstr = "jack_connect \"ZynAddSubFX:out_2\" \"system:playback_2\""
    os.system(execstr)

def sendNoteOn(key):
    alsaseq.output((6, 0, 0, 253, (0, 0), (20, 0), (130, 0), (0, key, VELOCITY, 0, 0)))
         
def sendNoteOff(key):
    alsaseq.output((7, 0, 0, 253, (0, 0), (20, 0), (130, 0), (0, key, VELOCITY, 0, 0)))

def handleCtrlC(signal_received, frame):
    for i in range(128):
        sendNoteOff(i)
    print 
    print "Bye."
    print 
    sys.exit()

def main():
    alsaseq.client('transposeseq', 2, 1, False)
    # makeConnections()
    # os.system("clear")
    print
    print "transposeseq.py - seq24 Sequence Transposing"
    print
    print "(C) 2019, by PySeq"
    print
    print "Please make sure, that seq24 is STOPPED."
    print "(As we need to find out the pitch of the first note of the sequence.)"
    a = ""
    a = raw_input("When ready, press 'Return' to start (or enter 'q' to quit): ")
    if a == "q":
        print
        print "Ok, bye."
        print
        sys.exit()
    print
    print "Ok, ready. Please start the sequence on seq24 now."
    print "You should be able to to change the pitch of the sequence"
    print "with the external midi keyboard."
    print
    print "Press 'Control + c' to stop the program."
    print

    # Capture 'Ctrl+c':
    signal.signal(signal.SIGINT, handleCtrlC)

    # Retrieving pitch of first note of the sequence:
    basekey = -1
    while basekey < 0:
        if alsaseq.inputpending():
            event = alsaseq.input()
            if event[0] == 6 and event[7][0] == 1:
                basekey = event[7][1]
    diff = 0
    key = basekey + diff
    while True:

        if alsaseq.inputpending():

            event = alsaseq.input()

            # NoteOn-event from keyboard detected:
            if event[0] == 6 and event[7][0] == 0:
                diff = event[7][1] - basekey

            # NoteOn-event from sequencer detected:
            if event[0] == 6 and event[7][0] == 1:
                key = event[7][1] + diff
                if key >= 0 and key <= 127:
                    sendNoteOn(key)

            # NoteOff-event from sequencer detected:
            if event[0] == 7 and event[7][0] == 1:
                sendNoteOff(key)

if __name__ == '__main__':
    main()
 
  • Daumen hoch
M.i.a.u.: khz


Neueste Beiträge

News

Zurück
Oben