Skip to content

Commit

Permalink
Resolves #7; New name is now MappingInterface, simple class hierarc…
Browse files Browse the repository at this point in the history
…hy; see also #8
  • Loading branch information
Itaborala committed Jun 21, 2024
1 parent 48e9ab6 commit 78f6f02
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions synth/osc.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from abstract_classes import SonificationInterface
from core.vqh_interfaces import MappingInterface
import numpy as np
import time
from pythonosc.udp_client import SimpleUDPClient
import json
from synth.sc import MusicalScale

class OSCMapping(SonificationInterface):
class OSCMapping(MappingInterface):
def __init__(self, ip:str="127.0.0.1", port:int=1450) -> None:
self.client = SimpleUDPClient(ip, port)
self.scale = MusicalScale()
Expand Down
4 changes: 2 additions & 2 deletions synth/sc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abstract_classes import SonificationInterface
from core.vqh_interfaces import MappingInterface
import asyncio
import numpy as np
from supercollider import Synth, Server, Group, AudioBus
Expand Down Expand Up @@ -52,7 +52,7 @@ def get_note(self, x):
return x


class SuperColliderMapping(SonificationInterface):
class SuperColliderMapping(MappingInterface):
def __init__(self):
self.server = Server()
notesd = {"c":"amp1", "c#":"amp2", "d":"amp3", "d#":"amp4", "e":"amp5", "f":"amp6", "f#":"amp7", "g":"amp8", "g#":"amp9", "a":"amp10", "a#":"amp11", "b":"amp12", "new":"amp13"}
Expand Down
4 changes: 2 additions & 2 deletions synth/score.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abstract_classes import SonificationInterface
from core.vqh_interfaces import MappingInterface
import numpy as np
import time
import random
Expand All @@ -9,7 +9,7 @@
import threading


class ScoreBuilderMapping(SonificationInterface):
class ScoreBuilderMapping(MappingInterface):
def __init__(self):

self.score = stream.Stream()
Expand Down
4 changes: 2 additions & 2 deletions synth/sonification_library.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abstract_classes import SonificationInterface
from core.vqh_interfaces import MappingInterface
from synth.sc import SuperColliderMapping
from synth.zen import ZenMapping
from synth.osc import OSCMapping
Expand Down Expand Up @@ -84,7 +84,7 @@ def __init__(self):
"mapping": "post_page"
},
}
def get_mapping(self, son_type: int) -> SonificationInterface:
def get_mapping(self, son_type: int) -> MappingInterface:
"""Returns: sonification interface class associated with name.
"""

Expand Down
Empty file added synth/vqhscore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions synth/zen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abstract_classes import SonificationInterface
from core.vqh_interfaces import MappingInterface
import asyncio
import numpy as np
import time
Expand All @@ -8,7 +8,7 @@
import xml.etree.ElementTree as ET


class ZenMapping(SonificationInterface):
class ZenMapping(MappingInterface):
def __init__(self):

if os.path.exists('synth/credentials_zen_local.json'):
Expand Down

0 comments on commit 78f6f02

Please sign in to comment.