The Zizula Forum
October 22, 2017, 04:42:52 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Google Rating of this Forum:
 
   Home   Help Arcade Search Calendar Login Register  
Del.icio.us Digg FURL FaceBook Stumble Upon Reddit SlashDot Ask BlinkBits BlinkList Co.mments Delirious Google Bookmarks Linkagogo Ma.gnolia MSN Live Netscape Netvouz Newsvine RawSugar Rojo Smarking Socializer Sphinn Spurl Squidoo Tailrank Technorati Yahoo My Web

Pages: [1]   Go Down
  Print  
Author Topic: first try at a pyscle wrapper with ctypes  (Read 1840 times)
edexter
Moderator
Full Member
*****

Karma: 22
Offline Offline

Posts: 177



View Profile WWW
« on: August 08, 2011, 05:21:38 AM »

#!/usr/bin/env python
#This is my first attempt at a pyvst like wrapper for pyscle
#I think I have the stuctures but after CmachineInfo it still needs work
#same license as pyvst
import numpy
from ctypes import CDLL, POINTER

from aeffect import *

MI_VERSION = 11      #//Psycle 1.6.
SEQUENCER = 1
EFFECT = 0
GENERATOR = 3
NOTE_MAX = 119
NOTE_NO = 120
NOTE_OFF = 255
PI = 3.14159265358979323846

class CMachineParameter(Structure):
  _fields_ = [
    ("Name", c_char_p),
    ("Description", c_char_p),
    ("MinValue", c_int),
    ("MaxValue", c_int),
    ("DefaultValue", c_int)
    ]

class CmachineInfo(Structure):
  _fields_ = [
    ("Version", c_int),
    ("Flags", c_int),
    ("numParameters", c_int),
    ("Parameters", pointer(CmachineParameter),
    ("Name",c_char_p),
    ("ShortName", c_char_p),
    ("Author",c_char_p),
    ("About",c_char_p), #says command
    ("numberOfColumns",c_int)
     ]
class CFxCallback(object):
    self.MessBox(ptxt, caption, type)
    self.CallbackFunc(cbkID, par1, par2, par3)
    self.getWaveLData(inst, wave) #this is a pointer to a function
    self.getWaveRData(inst, wave) #this is a pointer to a function
    self.GetTickLength()
    self.GetBPM()
    self.GetTPB()

class CMachineInterface(object)
    #This is copied from the vst I am still clueless
    def __init__(self, filename, audio_callback = basic_callback):
    self.__lib = CDLL(filename)
    self.__callback = audiomaster_callback(audio_callback)
   
    #self.Init()
    self.SequencerTick()
    self.ParameterTweak(par, value)
    def work(psamplesleft,psamplesright, numofsamples, tracks)
    self.stop()

    #export/inport

    self.putdata(pData)
    self.getData(pdata)
    self.GetDataSize()
    self.Command()

    self.MuteTrack(i)' #not used yet
    self.IsTrackMuted(i)

    self.MidiNote(Channel, value, volicity)
    self.Event(data) #not used yet
    self.DescribeValue(txt, param, value)
    self.PlayWave(wave, note, volume) #probily never used
    self.SeqTick(channel, note, ins, cmd, val)

    self.StopWave #probily never used
   
   
Logged

http://dextracker.blogspot.com/ The number one spot for dex tracker audio software on the internet.
edexter
Moderator
Full Member
*****

Karma: 22
Offline Offline

Posts: 177



View Profile WWW
« Reply #1 on: August 08, 2011, 05:23:03 AM »

I don't think it matters but my test machine is the python 2.5+ series.
Logged

http://dextracker.blogspot.com/ The number one spot for dex tracker audio software on the internet.
maddison
Newbie
*

Karma: 0
Offline Offline

Posts: 3


View Profile WWW
« Reply #2 on: October 12, 2011, 05:25:25 AM »

Thanks for sharing this post
Logged

Pages: [1]   Go Up
  Print  

 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines | Sitemap Valid XHTML 1.0! Valid CSS!